@rainbow-robotics/preview-host 0.1.2-dev.44 → 0.1.2-dev.45

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 (91) hide show
  1. package/README.md +231 -27
  2. package/build.mjs +1 -12
  3. package/dist/assets/AmrCapabilityControl.DEC-3ZAW.js +1 -0
  4. package/dist/assets/MapInfo.rg67lYW5.js +1 -0
  5. package/dist/assets/RBQrBarCodeGuideModal.CegVepfq.js +4939 -0
  6. package/dist/assets/{__federation_expose_App.DTILpvFM.js → __federation_expose_App.CEGQzKIi.js} +287 -246
  7. package/dist/assets/__federation_fn_import.DdkEuT6t.js +23 -0
  8. package/dist/assets/__federation_shared_@emotion/{styled.wOy85H_m.js → styled.ETfwMsQo.js} +1 -1
  9. package/dist/assets/__federation_shared_@tanstack/{react-query.BqXJhb-5.js → react-query.fVz8BOIk.js} +1 -1
  10. package/dist/assets/__federation_shared_react-dom.CHMAxKsQ.js +1 -0
  11. package/dist/assets/{__federation_shared_react-simple-keyboard.BDWRGEbM.js → __federation_shared_react-simple-keyboard.CycbmZUL.js} +3 -3
  12. package/dist/assets/__federation_shared_react.DhiB56zQ.js +1 -0
  13. package/dist/assets/{cssMode.CxPsxiNP.js → cssMode.DbVSjsLx.js} +1 -1
  14. package/dist/assets/{emotion-styled-base.browser.esm.JngGwqgu.js → emotion-styled-base.browser.esm.BIcjgOzg.js} +1 -1
  15. package/dist/assets/{freemarker2.e18W-vVC.js → freemarker2._fexy6pR.js} +1 -1
  16. package/dist/assets/goalIconAtlas.B2lkzTN6.svg +39 -0
  17. package/dist/assets/goalIconAtlasReal.BcQvnHD9.svg +34 -0
  18. package/dist/assets/{handlebars.DpGUQTlC.js → handlebars.CmIcCyqS.js} +1 -1
  19. package/dist/assets/{html.qS8AwR-R.js → html.DRR6RUxW.js} +1 -1
  20. package/dist/assets/{htmlMode.D4pEgAMn.js → htmlMode.CoHatVoq.js} +1 -1
  21. package/dist/assets/{index.CHuCXVak.js → index.B3zY1kf7.js} +1 -1
  22. package/dist/assets/index.B_7c3sM4.js +1 -0
  23. package/dist/assets/index.CvtWB-ew.js +1 -0
  24. package/dist/assets/index.FZ9eMVCs.js +1 -0
  25. package/dist/assets/index.P6snMalu.js +9 -0
  26. package/dist/assets/{javascript.CIRAbwTJ.js → javascript.pVVbdZDk.js} +1 -1
  27. package/dist/assets/{jsonMode.CJcA6JGm.js → jsonMode.DgG2kYVi.js} +1 -1
  28. package/dist/assets/jsx-runtime.CBqCNPYB.js +9 -0
  29. package/dist/assets/keymapTileIndex.worker-Bmd4Ukaf.js +1 -0
  30. package/dist/assets/{liquid.Cd_ynsyQ.js → liquid.DvX7AUBT.js} +1 -1
  31. package/dist/assets/{lspLanguageFeatures.ZrhgItxw.js → lspLanguageFeatures.Br1RlGKu.js} +1 -1
  32. package/dist/assets/{mdx.E9Mhxtu7.js → mdx.BXnm0chj.js} +1 -1
  33. package/dist/assets/{python.BUTzvd2f.js → python.C2Xd8iVA.js} +1 -1
  34. package/dist/assets/{razor.CI_gj0Fd.js → razor.D0mLj0p_.js} +1 -1
  35. package/dist/assets/remoteEntry.js +1 -1
  36. package/dist/assets/{tsMode.DBpdjX7n.js → tsMode.Dqbl0l0j.js} +1 -1
  37. package/dist/assets/{typescript.WM3o_g0z.js → typescript.Buj1nTDy.js} +1 -1
  38. package/dist/assets/{xml.D7f39jWM.js → xml.DHpVTYfo.js} +1 -1
  39. package/dist/assets/{yaml.BLLpRCf_.js → yaml.Dz87BMLn.js} +1 -1
  40. package/dist/imgs/nexus/forms/gripper/g7_grip_dir_0.png +0 -0
  41. package/dist/imgs/nexus/forms/gripper/g7_grip_dir_1.png +0 -0
  42. package/dist/imgs/nexus/forms/gripper/g7_offset.png +0 -0
  43. package/dist/imgs/nexus/forms/gripper/g7_orientation_0.png +0 -0
  44. package/dist/imgs/nexus/forms/gripper/g7_orientation_1.png +0 -0
  45. package/dist/imgs/nexus/forms/gripper/g7_tip_width.png +0 -0
  46. package/dist/imgs/nexus/forms/gripper/gripper_10.png +0 -0
  47. package/dist/imgs/nexus/forms/gripper/gripper_7.png +0 -0
  48. package/dist/imgs/nexus/forms/gripper/gripper_8.png +0 -0
  49. package/dist/imgs/nexus/forms/gripper/gripper_9.png +0 -0
  50. package/dist/index.html +11 -10
  51. package/dist/plugin-shared/plugin-ui_host-ui.js +3 -0
  52. package/dist/plugin-shared/plugin-ui_react.js +3 -0
  53. package/dist/plugin-shared/plugin-ui_sdk.js +3 -0
  54. package/dist/plugin-shared/plugin-ui_ws.js +3 -0
  55. package/dist/plugin-shared/react-dom.js +4 -0
  56. package/dist/plugin-shared/react-dom_client.js +3 -0
  57. package/dist/plugin-shared/react.js +4 -0
  58. package/dist/plugin-shared/react_jsx-dev-runtime.js +3 -0
  59. package/dist/plugin-shared/react_jsx-runtime.js +3 -0
  60. package/package.json +1 -1
  61. package/serve.mjs +87 -33
  62. package/dist/assets/AmrCapabilityControl.BppT8lfW.js +0 -1
  63. package/dist/assets/ConveyorBelt.DYgETvU-.png +0 -0
  64. package/dist/assets/FactoryMap.CBpf9N92.js +0 -4881
  65. package/dist/assets/MapInfo.Bit_2DfJ.js +0 -1
  66. package/dist/assets/__federation_fn_import.Drmbxo5T.js +0 -23
  67. package/dist/assets/__federation_shared_react-dom.znG_qyPl.js +0 -1
  68. package/dist/assets/__federation_shared_react.Wsh8dz5j.js +0 -1
  69. package/dist/assets/_commonjsHelpers.Cpj98o6Y.js +0 -1
  70. package/dist/assets/index.ChsGqxH_.js +0 -9
  71. package/dist/assets/index.Dxudgz78.js +0 -1
  72. package/dist/assets/index.FxRLAiU5.js +0 -1
  73. package/dist/assets/index.ayADrA9_.js +0 -1
  74. package/dist/assets/jsx-runtime.CKZTQYsb.js +0 -9
  75. package/dist/assets/keymapTileIndex.worker-C2HCGd-D.js +0 -1
  76. package/dist/plugin-demo/assets/icon.svg +0 -3
  77. package/dist/plugin-demo/content.js +0 -9149
  78. package/dist/plugin-demo/manifest.json +0 -25
  79. package/dist/plugin-demo/sandbox.html +0 -10
  80. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/chunks/chunk-37HVFFJB.js +0 -1
  81. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/chunks/chunk-4MGSRUAS.js +0 -1
  82. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/chunks/chunk-Q6XGCIPE.js +0 -1
  83. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/connect.js +0 -1
  84. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/elements.js +0 -1
  85. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/react.js +0 -1
  86. package/dist/plugin-runtime/@rainbow-robotics/plugin-ui/sdk.js +0 -1
  87. package/dist/plugin-runtime/vendor/react-dom-client.js +0 -1
  88. package/dist/plugin-runtime/vendor/react-jsx-dev-runtime.js +0 -1
  89. package/dist/plugin-runtime/vendor/react-jsx-runtime.js +0 -1
  90. package/dist/plugin-runtime/vendor/react-runtime.js +0 -65
  91. package/dist/plugin-runtime/vendor/react.js +0 -1
package/README.md CHANGED
@@ -1,44 +1,248 @@
1
- # @repo/preview-host
1
+ # `@repo/preview-host`
2
2
 
3
- Standalone **mini-Muscat** (nexus) shell for previewing Muscat plugins with **no
4
- robot and no back end**. Built from `apps/web/nexus` in `plugin-preview` mode.
3
+ `@repo/preview-host`는 로봇과 백엔드 없이 Muscat 플러그인을 미리 확인할 수 있는 독립 실행형 **mini-Muscat(nexus) 셸**입니다.
5
4
 
6
- The shell renders the real Header / LNB / panels and the real `rb-components`,
7
- loads the developer's plugin via its manifest, and mocks every robot/back-end
8
- dependency (API-failure toasts suppressed, query retries off, rb static assets
9
- served locally).
5
+ `apps/web/nexus`를 `plugin-preview` 모드로 빌드하여 생성합니다.
10
6
 
11
- This package is consumed by `muscat-plugin-kit` (`muscat-pk dev:ui`) so external
12
- plugin developers get a faithful preview without the web-rainbow-ui source.
7
+ 이 프리뷰 셸은 실제 Muscat 환경과 최대한 동일한 UI를 제공합니다.
13
8
 
14
- ## Build
9
+ * 실제 Header
10
+ * 실제 LNB
11
+ * 실제 패널 구조
12
+ * 실제 `rb-components`
13
+ * 플러그인 manifest 기반 로딩
14
+
15
+ 반면 로봇 및 백엔드 관련 의존성은 모두 mock 처리합니다.
16
+
17
+ * 로봇 연결 불필요
18
+ * 백엔드 서버 불필요
19
+ * API 실패 toast 숨김
20
+ * query 재시도 비활성화
21
+ * RB 정적 리소스를 로컬에서 제공
22
+
23
+ 이 패키지는 `muscat-plugin-kit`의 다음 명령에서 사용합니다.
24
+
25
+ ```bash
26
+ muscat-pk dev:ui
27
+ ```
28
+
29
+ 이를 통해 외부 플러그인 개발자는 `web-rainbow-ui` 모노레포 소스 없이도 실제 Muscat과 유사한 환경에서 플러그인을 미리 확인할 수 있습니다.
30
+
31
+ ## 빌드
15
32
 
16
33
  ```bash
17
- node build.mjs # builds nexus (plugin-preview) and assembles ./dist
18
- node build.mjs --skip-build # only re-assemble (nexus already built)
34
+ node build.mjs
19
35
  ```
20
36
 
21
- `dist/` (git-ignored) is self-contained: the nexus bundle + rb assets
22
- (`/imgs`, `/fonts`, …) served at their runtime paths.
37
+ `nexus`를 `plugin-preview` 모드로 빌드한 뒤, 실행에 필요한 파일을 `./dist` 디렉터리에 구성합니다.
23
38
 
24
- ## Serve
39
+ 이미 `nexus` 빌드가 완료된 상태라면 다음 옵션을 사용할 수 있습니다.
40
+
41
+ ```bash
42
+ node build.mjs --skip-build
43
+ ```
44
+
45
+ 이 경우 `nexus`를 다시 빌드하지 않고 기존 빌드 결과를 기준으로 `./dist`만 다시 구성합니다.
46
+
47
+ 생성되는 `dist/` 디렉터리는 Git 관리 대상에서 제외됩니다.
48
+
49
+ `dist/`는 단독 실행 가능한 형태로 구성됩니다.
50
+
51
+ 포함되는 주요 항목은 다음과 같습니다.
52
+
53
+ * nexus 번들
54
+ * RB 정적 리소스
55
+ * 이미지
56
+ * 폰트
57
+ * 기타 런타임 리소스
58
+
59
+ 정적 리소스는 실제 런타임에서 사용하는 경로와 동일하게 제공됩니다.
60
+
61
+ ```text
62
+ /imgs
63
+ /fonts
64
+ ...
65
+ ```
66
+
67
+ ## 실행
25
68
 
26
69
  ```bash
27
70
  rb-preview-host --plugin <built-plugin-dir> [--port 4180] [--dist <dir>]
28
71
  ```
29
72
 
30
- The plugin dir is the output of `muscat-pk build` and must contain
31
- `manifest.json`, `sandbox.html`, `content.js` and any `assets/`. It is mounted at
32
- `/plugin-dev/`; the shell reads it via these globals (injected by `serve.mjs`):
73
+ ### 옵션
74
+
75
+ `--plugin`은 `muscat-pk build`로 생성된 플러그인 빌드 디렉터리를 지정합니다.
76
+
77
+ ```bash
78
+ rb-preview-host --plugin ./dist/plugin
79
+ ```
80
+
81
+ `--port`는 preview host가 실행될 포트를 지정합니다.
82
+
83
+ 기본값은 `4180`입니다.
84
+
85
+ ```bash
86
+ rb-preview-host \
87
+ --plugin ./dist/plugin \
88
+ --port 4180
89
+ ```
90
+
91
+ `--dist`는 preview-host의 정적 번들 디렉터리를 별도로 지정할 때 사용합니다.
92
+
93
+ ```bash
94
+ rb-preview-host \
95
+ --plugin ./dist/plugin \
96
+ --dist ./preview-host-dist
97
+ ```
98
+
99
+ ## 플러그인 빌드 디렉터리 요구사항
100
+
101
+ `--plugin`으로 지정한 디렉터리는 `muscat-pk build`의 출력 디렉터리여야 합니다.
102
+
103
+ 다음 파일을 포함해야 합니다.
104
+
105
+ ```text
106
+ manifest.json
107
+ sandbox.html
108
+ content.js
109
+ assets/
110
+ ```
111
+
112
+ `assets/`는 플러그인에서 별도 정적 리소스를 사용하는 경우에만 존재할 수 있습니다.
113
+
114
+ 지정된 플러그인 디렉터리는 preview host에서 다음 경로로 마운트됩니다.
115
+
116
+ ```text
117
+ /plugin-dev/
118
+ ```
119
+
120
+ 프리뷰 셸은 `serve.mjs`가 주입한 전역 변수를 통해 플러그인과 정적 리소스 위치를 확인합니다.
121
+
122
+ ## 전역 변수
123
+
124
+ ### `window.__RB_PLUGIN_PREVIEW_HOST__`
125
+
126
+ preview-host 모드를 활성화합니다.
127
+
128
+ ```ts
129
+ window.__RB_PLUGIN_PREVIEW_HOST__ = true;
130
+ ```
131
+
132
+ 이 값이 활성화되면 nexus는 실제 백엔드 대신 mock 환경으로 동작합니다.
133
+
134
+ 대표적으로 다음 처리가 적용됩니다.
135
+
136
+ * 로봇 연결 mock
137
+ * 백엔드 API mock
138
+ * API 실패 toast 억제
139
+ * query 재시도 비활성화
140
+
141
+ ### `window.__RB_PLUGIN_PREVIEW_BASE__`
142
+
143
+ 플러그인이 제공되는 기본 URL입니다.
144
+
145
+ 기본값은 다음과 같습니다.
146
+
147
+ ```text
148
+ /plugin-dev
149
+ ```
150
+
151
+ 예시:
152
+
153
+ ```ts
154
+ window.__RB_PLUGIN_PREVIEW_BASE__ = "/plugin-dev";
155
+ ```
156
+
157
+ 프리뷰 셸은 이 경로를 기준으로 다음 파일을 읽습니다.
158
+
159
+ ```text
160
+ /plugin-dev/manifest.json
161
+ /plugin-dev/sandbox.html
162
+ /plugin-dev/content.js
163
+ /plugin-dev/assets/*
164
+ ```
165
+
166
+ ### `window.__RB_ASSETS_BASE_URL__`
167
+
168
+ RB 정적 리소스를 제공하는 origin을 지정합니다.
169
+
170
+ 예시:
171
+
172
+ ```ts
173
+ window.__RB_ASSETS_BASE_URL__ = "http://localhost:4180";
174
+ ```
175
+
176
+ 이를 통해 nexus 및 `rb-components`가 사용하는 정적 리소스를 preview host에서 로드할 수 있습니다.
33
177
 
34
- | global | meaning |
35
- |---|---|
36
- | `window.__RB_PLUGIN_PREVIEW_HOST__` | enable preview-host mode (mock back end) |
37
- | `window.__RB_PLUGIN_PREVIEW_BASE__` | base URL of the plugin (default `/plugin-dev`) |
38
- | `window.__RB_ASSETS_BASE_URL__` | origin for rb static assets |
178
+ 대표적인 리소스 경로는 다음과 같습니다.
179
+
180
+ ```text
181
+ /imgs
182
+ /fonts
183
+ ```
184
+
185
+ ## 전역 변수 정리
186
+
187
+ | 전역 변수 | 의미 |
188
+ | ----------------------------------- | --------------------------------------- |
189
+ | `window.__RB_PLUGIN_PREVIEW_HOST__` | preview-host 모드를 활성화하고 백엔드 의존성을 mock 처리 |
190
+ | `window.__RB_PLUGIN_PREVIEW_BASE__` | 플러그인이 마운트된 기본 URL. 기본값은 `/plugin-dev` |
191
+ | `window.__RB_ASSETS_BASE_URL__` | RB 이미지, 폰트 등 정적 리소스를 제공하는 origin |
192
+
193
+ ## 개발 모드와의 관계
194
+
195
+ `muscat-pk dev:ui`는 nexus의 Vite 개발 서버를 직접 실행합니다.
196
+
197
+ ```bash
198
+ vite --mode plugin-preview
199
+ ```
200
+
201
+ 이 방식은 HMR이 활성화된 개발용 preview-host 런타임입니다.
202
+
203
+ 즉, `muscat-pk dev:ui`와 `@repo/preview-host`는 서로 다른 구현이 아니라 동일한 preview-host 런타임을 다른 형태로 사용하는 구조입니다.
204
+
205
+ ### `muscat-pk dev:ui`
206
+
207
+ 모노레포 소스를 기준으로 Vite 개발 서버를 직접 실행합니다.
208
+
209
+ 특징은 다음과 같습니다.
210
+
211
+ * Vite 기반 개발 서버
212
+ * HMR 지원
213
+ * 소스 변경 즉시 반영
214
+ * 개발 환경에 적합
215
+
216
+ ### `@repo/preview-host`
217
+
218
+ 동일한 런타임을 정적 번들로 패키징한 배포용 형태입니다.
219
+
220
+ 특징은 다음과 같습니다.
221
+
222
+ * 모노레포 소스 불필요
223
+ * 사전 빌드된 nexus 번들 사용
224
+ * 독립 실행 가능
225
+ * 외부 플러그인 개발자에게 배포 가능
226
+
227
+ 전체 관계는 다음과 같습니다.
228
+
229
+ ```text
230
+ apps/web/nexus
231
+ └─ plugin-preview 모드
232
+ ├─ muscat-pk dev:ui
233
+ │ └─ Vite 개발 서버 직접 실행
234
+ │ └─ HMR 지원
235
+ │
236
+ └─ @repo/preview-host
237
+ └─ 정적 번들로 패키징
238
+ └─ 모노레포 소스 없이 실행
239
+ ```
39
240
 
40
- ## How it relates to dev mode
241
+ 결과적으로 외부 개발자는 `web-rainbow-ui` 소스를 직접 보유하지 않아도 다음 요소를 포함한 실제 Muscat과 유사한 프리뷰 환경을 사용할 수 있습니다.
41
242
 
42
- `muscat-pk dev:ui` runs nexus's `vite --mode plugin-preview` directly (HMR), which
43
- is the same preview-host runtime. This packaged static bundle is the
44
- distributable form for developers who don't have the monorepo source.
243
+ * 실제 nexus 레이아웃
244
+ * 실제 Header 및 LNB
245
+ * 실제 패널
246
+ * 실제 `rb-components`
247
+ * 실제 manifest 기반 플러그인 로딩
248
+ * mock 처리된 로봇 및 백엔드 환경
package/build.mjs CHANGED
@@ -18,7 +18,6 @@ const nexusDir = resolve(repoRoot, "apps/web/nexus");
18
18
  const nexusDist = resolve(nexusDir, "dist-preview");
19
19
  const assetsPublic = resolve(repoRoot, "apps/web/assets/public");
20
20
  const outDir = resolve(here, "dist");
21
- const pluginUiRoot = resolve(here, "../plugin-ui");
22
21
 
23
22
  const skipBuild = process.argv.includes("--skip-build");
24
23
 
@@ -27,6 +26,7 @@ if (!skipBuild) {
27
26
  execSync("yarn workspace @app/nexus build:preview", {
28
27
  cwd: repoRoot,
29
28
  stdio: "inherit",
29
+ env: { ...process.env, VITE_PLUGIN_PREVIEW: "true" },
30
30
  });
31
31
  }
32
32
 
@@ -50,15 +50,4 @@ for (const dir of ["imgs", "fonts", "sounds", "data"]) {
50
50
  if (existsSync(src)) cpSync(src, resolve(outDir, dir), { recursive: true });
51
51
  }
52
52
 
53
- // plugin-ui dist-browser — bundled in so preview-host has no npm runtime dep on plugin-ui.
54
- // This lets `npm i -g muscat-plugin-kit` resolve cleanly (no react peerDep chain).
55
- const distBrowser = resolve(pluginUiRoot, "dist-browser");
56
- if (!existsSync(distBrowser)) {
57
- throw new Error(
58
- `plugin-ui dist-browser not found at ${distBrowser}.\nRun: yarn workspace @rainbow-robotics/plugin-ui build`,
59
- );
60
- }
61
- cpSync(distBrowser, resolve(outDir, "plugin-runtime"), { recursive: true });
62
- console.log("[preview-host] bundled plugin-runtime from plugin-ui/dist-browser");
63
-
64
53
  console.log("[preview-host] dist ready →", outDir);
@@ -0,0 +1 @@
1
+ import{importShared as f}from"./__federation_fn_import.DdkEuT6t.js";import{dr as g,aE as s,_ as t,aM as v,dl as p,a0 as b,dk as c,cv as O,bL as E,aC as F,aL as B,cg as P,cs as w,aO as D,f1 as _,fJ as L}from"./RBQrBarCodeGuideModal.CegVepfq.js";import{f as T}from"./index.FZ9eMVCs.js";const{useQuery:M}=await f("@tanstack/react-query"),C=[{key:"dock",endpoint:"/{robot_model}/capability/dock",labelKey:"move.amr.rightPanel.capability.dock"},{key:"io",endpoint:"/{robot_model}/capability/Io",labelKey:"move.amr.rightPanel.capability.io"},{key:"camera",endpoint:"/{robot_model}/capability/camera",labelKey:"move.amr.rightPanel.capability.camera"},{key:"lidar2d",endpoint:"/{robot_model}/capability/lidar2d",labelKey:"move.amr.rightPanel.capability.lidar2d"},{key:"lidar3d",endpoint:"/{robot_model}/capability/lidar3d",labelKey:"move.amr.rightPanel.capability.lidar3d"},{key:"imu",endpoint:"/{robot_model}/capability/imu",labelKey:"move.amr.rightPanel.capability.imu"},{key:"safetyBumper",endpoint:"/{robot_model}/capability/safetyBumper",labelKey:"move.amr.rightPanel.capability.safetyBumper"},{key:"safetyInterlock",endpoint:"/{robot_model}/capability/safetyInterlock",labelKey:"move.amr.rightPanel.capability.safetyInterlock"},{key:"safetyObstacle",endpoint:"/{robot_model}/capability/safetyObstacle",labelKey:"move.amr.rightPanel.capability.safetyObstacle"},{key:"safetyOperationStop",endpoint:"/{robot_model}/capability/safetyOperationStop",labelKey:"move.amr.rightPanel.capability.safetyOperationStop"},{key:"safetySpeedControl",endpoint:"/{robot_model}/capability/safetySpeedControl",labelKey:"move.amr.rightPanel.capability.safetySpeedControl"},{key:"tabos",endpoint:"/{robot_model}/capability/tabos",labelKey:"move.amr.rightPanel.capability.tabos"}],R=e=>typeof e=="object"&&e!==null&&"enabled"in e&&e.enabled===!1,K=e=>{if(e instanceof Error)return e.message;if(typeof e=="object"&&e!==null&&"message"in e){const a=e.message;if(typeof a=="string")return a}},q=async({robot_model:e})=>{const a=await Promise.allSettled(C.map(l=>{const n=l.endpoint.replace("{robot_model}",e);return T.get(n)}));return C.map((l,n)=>{const r=a[n];return r.status==="fulfilled"?{...l,supported:!R(r.value),data:r.value}:{...l,supported:!1,data:null,errorMessage:K(r.reason)}})},$=({robot_model:e,enabled:a=!0})=>M({queryKey:["amrCapabilities",e],queryFn:()=>q({robot_model:e}),enabled:!!e&&a,staleTime:5*1e3,gcTime:60*1e3}),{useMutation:U}=await f("@tanstack/react-query"),V=()=>U({mutationFn:({robot_model:e,target:a,frequency:l})=>T.post(`/${e}/control/streamFrequency`,{target:a,frequency:Math.min(10,Math.max(0,l))})}),{useState:k}=await f("react"),j=4294967295,x=e=>{if(!(e==null||e===j))return`${e} ms`},z={0:"NONE",1:"CHARGING",2:"COMPLETE",3:"FAIL",4:"CANCEL"},G={0:"DEFAULT",1:"TABOS"},Y={0:"CABLE",1:"CONTACT",2:"INDUCTIVE"},H={0:"RPLIDAR",1:"SICK",2:"LAKI",3:"LIVOX",4:"HOKUYO"},Q={0:"ORBBEC"},i=({label:e,children:a})=>s(p,{className:"items-center justify-between gap-3",children:[t("span",{className:"typo-compact-xs-normal text-fg-subtle shrink-0",children:e}),t("span",{className:b("typo-compact-xs-normal text-right",a!=null?"text-fg-default":"text-fg-subtler"),children:a??"—"})]}),X={default:"gray",success:"green",warning:"orange",danger:"red"},y=({label:e,variant:a="default"})=>t(D,{type:"soft",color:X[a],children:e}),h=({label:e,value:a})=>t(i,{label:e,children:t(y,{label:a?"ON":"OFF",variant:a?"success":"default"})}),u=({label:e,bits:a})=>s(c,{className:"gap-1",children:[t("span",{className:"typo-compact-xs-normal text-fg-subtle",children:e}),a?.length?t(p,{className:"gap-1",children:a.map((l,n)=>t("div",{className:b("size-4 rounded-sm border text-center leading-4",l?"border-fg-success bg-fill-success-subtlest":"border-border-subtler bg-fill-disabled"),children:t("span",{className:b("typo-compact-2xs-normal",l?"text-fg-success":"text-fg-subtler"),children:n})},n))}):t("span",{className:"typo-compact-xs-normal text-fg-subtler",children:"—"})]}),N=({label:e,connection:a,rows:l,children:n})=>{const{t:r}=g();return s(c,{className:"bg-fill-disabled gap-1.5 rounded-md p-2.5",children:[s(p,{className:"items-center justify-between gap-3",children:[t("span",{className:"typo-compact-xs-semibold text-fg-default min-w-0 break-words",children:e}),t("span",{className:b("typo-compact-2xs-medium shrink-0",a?"text-fg-success":"text-fg-subtler"),children:r(a?"settings.amr.frs.status.connected":"settings.amr.frs.status.disconnected")})]}),l.map(({key:o,value:d})=>t(i,{label:o,children:d},o)),n]})},J=({label:e,value:a})=>t(D,{type:"soft",color:a?"green":"gray",children:s(p,{className:"items-center gap-1",children:[a?t(_,{className:"size-3"}):t(L,{className:"size-3"}),t("span",{children:e}),t("span",{className:"font-semibold",children:a?"On":"Off"})]})}),I=({flags:e})=>t(p,{className:"flex-wrap gap-1.5",children:e.map(({label:a,value:l})=>t(J,{label:a,value:l},a))}),W=({streams:e})=>e.length?s(c,{className:"border-subtle mt-0.5 gap-1 border-t pt-1.5",children:[t("span",{className:"typo-compact-xs-normal text-fg-subtle",children:"Streams"}),t(p,{className:"flex-wrap gap-1",children:e.map(a=>s(p,{className:"border-subtle bg-alt-1 items-center gap-1 rounded px-1.5 py-1",children:[t("span",{className:"typo-compact-2xs-semibold text-fg-default",children:a.quality}),s("span",{className:"typo-compact-2xs-normal text-fg-subtle",children:[a.width,"x",a.height]}),s("span",{className:"typo-compact-2xs-normal text-fg-subtler",children:[a.fps,"fps"]})]},`${a.camId}-${a.quality}`))})]}):null,Z=({data:e})=>{const a=z[e.chargeState??-1]??String(e.chargeState),l=e.chargeState===1?"success":e.chargeState===3?"danger":e.chargeState===4?"warning":"default";return s(c,{className:"gap-2",children:[s(c,{className:"bg-fill-disabled gap-2 rounded-md p-2.5",children:[t(h,{label:"Dock State",value:e.dockState}),t(i,{label:"Charge State",children:t(y,{label:a,variant:l})}),s(i,{label:"Battery",children:[e.batteryPercent?.toFixed(1)," %"]}),s(i,{label:"Charge Current",children:[e.chargeCurrent?.toFixed(2)," A"]}),s(i,{label:"Contact Voltage",children:[e.contactVoltage?.toFixed(2)," V"]}),t(i,{label:"Battery Type",children:t(y,{label:G[e.batteryType??0]??"—"})})]}),s(p,{className:"items-center gap-1.5 px-0.5",children:[t("span",{className:"typo-compact-xs-normal text-fg-subtle shrink-0",children:"Charge Type"}),e.chargeType?.length?t(p,{className:"flex-wrap gap-1.5",children:e.chargeType.map(n=>t(y,{label:Y[n]??String(n),variant:"default"},n))}):t("span",{className:"typo-compact-xs-normal text-fg-subtler",children:"—"})]})]})},ee=({data:e})=>s(c,{className:"gap-3 p-0.5",children:[t(u,{label:"MCU0 DIO",bits:e.mcu0Dio}),t(u,{label:"MCU1 DIO",bits:e.mcu1Dio}),t(u,{label:"MCU0 DIN",bits:e.mcu0Din}),t(u,{label:"MCU1 DIN",bits:e.mcu1Din})]}),ae=({data:e})=>s(c,{className:"gap-2",children:[t(I,{flags:[{label:"Obstacle",value:e.enabledObs},{label:"Depth",value:e.enabledDepth},{label:"Filter",value:e.enabledFilter}]}),e.info?.length?e.info.map((a,l)=>{const n=typeof a.type=="number"?Q[a.type]??String(a.type):a.type??"—",r=a.camId??a.index??l,o=e.rtspInfo?.filter(d=>d.camId===r)??[];return t(N,{label:`Camera ${r}${a.serial?` · ${a.serial}`:""}`,connection:a.connection,rows:[{key:"Type",value:n},{key:"TF",value:a.tf?.length?a.tf.map(d=>d.toFixed(2)).join(", "):void 0},{key:"Data Age",value:x(a.dataAgeMs)}],children:t(W,{streams:o})},l)}):t("span",{className:"typo-compact-xs-normal text-fg-subtler px-0.5",children:"—"})]}),A=({data:e,is3d:a=!1})=>s(c,{className:"gap-2",children:[t(I,{flags:[{label:"Obstacle",value:e.enabledObs}]}),e.info?.length?e.info.map((l,n)=>t(N,{label:`Lidar ${l.index??n}${l.serial?` · ${l.serial}`:""}`,connection:l.connection,rows:[{key:"Type",value:H[l.type]??String(l.type??"—")},...a?[]:[{key:"IP",value:l.ip}],{key:"Safety",value:l.safety!==void 0?l.safety?"Safety":"Normal":void 0},{key:"TF",value:l.tf?.length?l.tf.map(r=>r.toFixed(2)).join(", "):void 0},{key:"Data Age",value:x(l.dataAgeMs)}]},n)):t("span",{className:"typo-compact-xs-normal text-fg-subtler px-0.5",children:"—"})]}),te=({data:e})=>t(c,{className:"gap-2",children:e.info?.length?e.info.map((a,l)=>t(N,{label:`IMU ${a.index??l}${a.serial?` · ${a.serial}`:""}`,connection:a.connection,rows:[{key:"Type",value:a.type===1?"IMU":"DEFAULT"},{key:"Data Age",value:x(a.dataAgeMs)}]},l)):t("span",{className:"typo-compact-xs-normal text-fg-subtler px-0.5",children:"—"})}),le=({data:e})=>{const a=[{label:"Bumper State",value:e.bumperState},{label:"Interlock State",value:e.interlockState},{label:"Obstacle Detect",value:e.obsDetect},{label:"Operation Stop",value:e.operationStopState},{label:"Speed Control",value:e.speedControlState}].filter(l=>l.value!==void 0);return s(c,{className:"bg-fill-disabled gap-2 rounded-md p-2.5",children:[t(h,{label:"Enabled",value:e.enabled}),a.map(l=>t(h,{label:l.label,value:l.value},l.label))]})},se=({data:e})=>s(c,{className:"bg-fill-disabled gap-2 rounded-md p-2.5",children:[s(i,{label:"Voltage",children:[e.tabosVoltage?.toFixed(2)," V"]}),s(i,{label:"Current",children:[e.tabosCurrent?.toFixed(2)," A"]}),s(i,{label:"SOC",children:[e.tabosSoc?.toFixed(1)," %"]}),s(i,{label:"SOH",children:[e.tabosSoh?.toFixed(1)," %"]}),s(i,{label:"Temp",children:[e.tabosTemp?.toFixed(1)," °C"]})]}),ne=({capKey:e,data:a})=>{switch(e){case"dock":return t(Z,{data:a});case"io":return t(ee,{data:a});case"camera":return t(ae,{data:a});case"lidar2d":return t(A,{data:a});case"lidar3d":return t(A,{data:a,is3d:!0});case"imu":return t(te,{data:a});case"tabos":return t(se,{data:a});default:return t(le,{data:a})}},re=[{label:"LiDAR 2D",value:"lidar2d"},{label:"LiDAR 3D",value:"lidar3d"},{label:"OBS Map",value:"obsMap"}],ce=({robotModel:e})=>{const[a,l]=k("lidar2d"),[n,r]=k("1"),{mutate:o,isPending:d}=V();return s(c,{className:"gap-2 pb-1",children:[s(p,{className:"items-center justify-between gap-2",children:[t("span",{className:"typo-compact-xs-normal text-fg-subtle",children:"Target"}),t(F,{size:"2xs",variant:"brand",disabled:d,onClick:()=>{const m=Math.min(10,Math.max(0,Number(n)));o({robot_model:e,target:a,frequency:m})},children:"Set"})]}),t(P,{size:"sm",value:a,handleChange:m=>l(m),children:re.map(({label:m,value:S})=>t(B,{value:S,children:m},S))}),t(p,{className:"items-center gap-2",children:t(w,{className:"flex-1",size:"sm",value:n,step:1,digit:0,fixedDigit:0,min:"0",max:"10",handleChange:m=>r(m)})})]})},oe=({item:e})=>{const{t:a}=g();return e.supported?e.data?t("div",{className:"pb-1",children:t(ne,{capKey:e.key,data:e.data})}):null:t("p",{className:"typo-compact-xs-normal text-fg-disabled px-1 py-2",children:a("move.amr.rightPanel.capability.status.notSupported")})},ie=()=>{const{t:e}=g();return t(E,{className:"flex-1 [&_[data-slot='empty-view-section']]:h-full",type:"icon",icon:t(O,{size:20}),message:e("move.amr.rightPanel.capability.status.loading")})},ue=({className:e,robotModel:a})=>{const{t:l}=g(),{data:n,isLoading:r}=$({robot_model:a});return s(c,{className:b("AmrCapabilityControl h-full min-h-0",e),children:[r&&t(ie,{}),(n??[]).map(o=>t("div",{className:"border-subtler border-b px-1 py-1",children:t(v,{disabled:!o.supported,title:t(p,{className:"w-full items-center justify-between gap-2",children:t("span",{className:b("typo-compact-sm2-semibold min-w-0 truncate",o.supported?"text-fg-default":"text-fg-disabled"),children:l(o.labelKey)})}),children:t(oe,{item:o})})},o.key)),t("div",{className:"border-subtler border-b px-1 py-1",children:t(v,{title:t("span",{className:"typo-compact-sm2-semibold text-fg-default",children:l("move.amr.rightPanel.capability.streamFrequency")}),children:t(ce,{robotModel:a})})})]})};export{ue as default};
@@ -0,0 +1 @@
1
+ import{fv as g,fw as C,fx as $,fy as M,du as z,dr as P,aE as s,dk as d,_ as e,fz as H,fA as X,dl as r,fB as Y,fC as A,aC as L,fD as D,fE as O,fF as _,fG as E,fH as I,fI as K}from"./RBQrBarCodeGuideModal.CegVepfq.js";class J extends g{centerToLegX=.19725;centerToLegY=.09;centerToHipX=.11493;hipToThigh=.10285;thighToKnee=.3;kneeToFoot=.294;rearRightLeg;rearLeftLeg;frontRightLeg;frontLeftLeg;constructor(){super(),this.name="RBQ10_Robot",this.userData.keep=!0,this.init()}loadObj(o){return new Promise((n,c)=>{new C().load(o,p=>n(p),void 0,p=>c(p))})}init(){const n=["fuselage","leg3","hip1","hip3","thigh_right","thigh_left","calf","foot"].map(c=>{const a=$(`/rbq10/${c}.obj`);return this.loadObj(a).then(p=>({name:c,obj:p}))});Promise.all(n).then(c=>{const a={};c.forEach(i=>{a[i.name]=i.obj}),this.name="rbq10";const p=a.fuselage.clone();p.name="fuselage",this.add(p),this.rotateX(M.degToRad(90)),this.rearRightLeg=this.createRearRightLeg(a),this.rearRightLeg.position.set(-this.centerToLegX,0,this.centerToLegY),this.add(this.rearRightLeg),this.rearLeftLeg=this.createRearLeftLeg(a),this.rearLeftLeg.position.set(-this.centerToLegX,0,-this.centerToLegY),this.add(this.rearLeftLeg),this.frontRightLeg=this.createFrontRightLeg(a),this.frontRightLeg.position.set(this.centerToLegX,0,this.centerToLegY),this.add(this.frontRightLeg),this.frontLeftLeg=this.createFrontLeftLeg(a),this.frontLeftLeg.position.set(this.centerToLegX,0,-this.centerToLegY),this.add(this.frontLeftLeg)}).catch(c=>{console.error("Error loading robot parts:",c)})}createRearRightLeg(o){const n=new g;n.name="rearRightLegGroup";const c=o.leg3.clone();c.name="rearRightLegReducer",n.add(c);const a=new g;a.name="rearRightHipGroup",a.position.set(-this.centerToHipX,0,0);const p=o.hip3.clone();p.name="rearRightHipMesh",p.rotateY(M.degToRad(180)),a.add(p),n.add(a);const i=new g;i.name="rearRightThighGroup",i.position.set(0,0,this.hipToThigh);const l=o.thigh_right.clone();l.name="rearRightThighMesh",i.add(l),a.add(i);const m=new g;m.name="rearRightCalfGroup",m.position.set(0,-this.thighToKnee,0);const u=o.calf.clone();u.name="rearRightCalfMesh",m.add(u),i.add(m);const t=new g;t.name="rearRightFootGroup",t.position.set(0,-this.kneeToFoot,0);const f=o.foot.clone();return f.name="rearRightFootMesh",t.add(f),m.add(t),n}createRearLeftLeg(o){const n=new g;n.name="rearLeftLegGroup";const c=o.leg3.clone();c.name="rearLeftLegReducer",n.add(c);const a=new g;a.name="rearLeftHipGroup",a.position.set(-this.centerToHipX,0,0);const p=o.hip1.clone();p.name="rearLeftHipMesh",a.add(p),n.add(a);const i=new g;i.name="rearLeftThighGroup",i.position.set(0,0,-this.hipToThigh);const l=o.thigh_left.clone();l.name="rearLeftThighMesh",i.add(l),a.add(i);const m=new g;m.name="rearLeftCalfGroup",m.position.set(0,-this.thighToKnee,0);const u=o.calf.clone();u.name="rearLeftCalfMesh",m.add(u),i.add(m);const t=new g;t.name="rearLeftFootGroup",t.position.set(0,-this.kneeToFoot,0);const f=o.foot.clone();return f.name="rearLeftFootMesh",t.add(f),m.add(t),n}createFrontRightLeg(o){const n=new g;n.name="frontRightLegGroup";const c=o.leg3.clone();c.name="frontRightLegReducer",n.add(c);const a=new g;a.name="frontRightHipGroup",a.position.set(this.centerToHipX,0,0);const p=o.hip1.clone();p.name="frontRightHipMesh",p.rotateY(M.degToRad(180)),a.add(p),n.add(a);const i=new g;i.name="frontRightThighGroup",i.position.set(0,0,this.hipToThigh);const l=o.thigh_right.clone();l.name="frontRightThighMesh",i.add(l),a.add(i);const m=new g;m.name="frontRightCalfGroup",m.position.set(0,-this.thighToKnee,0);const u=o.calf.clone();u.name="frontRightCalfMesh",m.add(u),i.add(m);const t=new g;t.name="frontRightFootGroup",t.position.set(0,-this.kneeToFoot,0);const f=o.foot.clone();return f.name="frontRightFootMesh",t.add(f),m.add(t),n}createFrontLeftLeg(o){const n=new g;n.name="frontLeftLegGroup";const c=o.leg3.clone();c.name="frontLeftLegReducer",n.add(c);const a=new g;a.name="frontLeftHipGroup",a.position.set(this.centerToHipX,0,0);const p=o.hip3.clone();p.name="frontLeftHipMesh",a.add(p),n.add(a);const i=new g;i.name="frontLeftThighGroup",i.position.set(0,0,-this.hipToThigh);const l=o.thigh_left.clone();l.name="frontLeftThighMesh",i.add(l),a.add(i);const m=new g;m.name="frontLeftCalfGroup",m.position.set(0,-this.thighToKnee,0);const u=o.calf.clone();u.name="frontLeftCalfMesh",m.add(u),i.add(m);const t=new g;t.name="frontLeftFootGroup",t.position.set(0,-this.kneeToFoot,0);const f=o.foot.clone();return f.name="frontLeftFootMesh",t.add(f),m.add(t),n}update(){}}const w=h=>{const o=Math.floor(h/3600).toString().padStart(2,"0"),n=Math.floor(h%3600/60).toString().padStart(2,"0"),c=Math.floor(h%60).toString().padStart(2,"0");return`${o}:${n}:${c}`},V=({mappingStatus:h="idle",elapsedSeconds:o=0,completedKeyframeCount:n=0,totalKeyframePoints:c=0,onStartMapping:a,onStopMapping:p,onSaveMapping:i,onDiscard:l,mapList:m})=>{const{modal:u}=z(),{t}=P(),f=h==="recording",b=h==="stopped"||h==="saving"||h==="discarding",y=h==="saving"||h==="discarding",x=n>0,T=t(x?"move.amr.rightPanel.map.mapping.readyToSave":"move.amr.rightPanel.map.mapping.cannotSaveYet"),v=x?null:t("move.amr.rightPanel.map.mapping.noKeyframeReceived"),G=async()=>{try{await a?.()}catch(N){console.error(N)}},S=async()=>{try{await p?.()}catch(N){console.error(N)}},j=async()=>{await l?.()},k=async N=>i?.(N)??{ok:!1,reason:"save-failed"},F=()=>{u({component:D,props:{onSaveMapping:k,completedKeyframeCount:n,totalKeyframePoints:c,durationSeconds:o,existingMapNames:m}})};return s(d,{className:"h-full overflow-y-auto p-3",children:[!f&&!b&&s(d,{className:"flex-1 items-center gap-1 pt-[4rem]",children:[e(H,{className:"text-fg-brand size-8"}),e("p",{className:"typo-compact-xs-semibold text-fg-brand",children:t("move.amr.rightPanel.map.mapping.readyToMap")}),s("p",{className:"typo-title-02-bold text-fg-default text-center",children:[t("move.amr.rightPanel.map.mapping.clickStartMapping"),e("br",{}),t("move.amr.rightPanel.map.mapping.toBegin")]})]}),f&&s(d,{className:"flex-1 pt-[4rem]",children:[s(d,{className:"items-center gap-1",children:[e(X,{className:"text-fg-danger size-8"}),e("p",{className:"typo-compact-xs-semibold text-fg-danger",children:t("move.amr.rightPanel.map.mapping.recordingActive")}),e("p",{className:"typo-title-02-bold text-fg-default text-center",children:t("move.amr.rightPanel.map.mapping.buildingKeyframes")})]}),s(d,{className:"gap-2 p-3",children:[e("p",{className:"typo-compact-xs2-semibold text-fg-default",children:t("move.amr.rightPanel.map.mapping.captureStatus")}),s(d,{className:"bg-bg-alt-1 gap-1 rounded-md p-2.5",children:[s(r,{className:"items-center justify-between gap-3",children:[e("p",{className:"typo-compact-xs-normal text-fg-subtler",children:t("move.amr.rightPanel.map.mapping.saveStatus")}),e("p",{className:`typo-compact-xs-semibold text-right ${x?"text-fg-success":"text-fg-danger"}`,children:T})]}),v&&e("p",{className:"typo-compact-2xs-normal text-fg-subtler text-right",children:v}),s(r,{className:"items-center justify-between gap-3",children:[e("p",{className:"typo-compact-xs-normal text-fg-subtler",children:t("move.amr.rightPanel.map.mapping.keyframesReceived")}),e("p",{className:"typo-compact-xs-semibold text-fg-default text-right",children:n.toLocaleString()})]}),s(r,{className:"items-center justify-between gap-3",children:[e("p",{className:"typo-compact-xs-normal text-fg-subtler",children:t("move.amr.rightPanel.map.mapping.keyframePoints")}),e("p",{className:"typo-compact-xs-semibold text-fg-default text-right",children:t("move.amr.rightPanel.map.mapping.points",{count:c.toLocaleString()})})]}),s(r,{className:"items-center justify-between gap-3",children:[e("p",{className:"typo-compact-xs-normal text-fg-subtler",children:t("move.amr.rightPanel.task.duration")}),e("p",{className:"typo-compact-xs-semibold text-fg-default text-right",children:w(o)})]})]})]})]}),b&&s(d,{className:"flex-1 pt-[4rem]",children:[s(d,{className:"items-center gap-1",children:[e(Y,{className:`${x?"text-fg-success":"text-fg-danger"} size-8`}),e("p",{className:`typo-compact-xs-semibold ${x?"text-fg-success":"text-fg-danger"}`,children:t(x?"move.amr.rightPanel.map.mapping.readyToSaveTitle":"move.amr.rightPanel.map.mapping.noKeyframeCaptured")}),e("p",{className:"typo-title-02-bold text-fg-default text-center",children:t(x?"move.amr.rightPanel.map.mapping.mapReadyToSave":"move.amr.rightPanel.map.mapping.cannotSaveRecording")}),e("p",{className:"typo-compact-xs-normal text-fg-subtler text-center",children:t(x?"move.amr.rightPanel.map.mapping.canSaveAsNewMap":"move.amr.rightPanel.map.mapping.keyframeRequired")})]}),s(d,{className:"gap-2 p-3",children:[e("p",{className:"typo-compact-xs2-semibold text-fg-default",children:t("move.amr.rightPanel.map.mapping.result")}),s(d,{className:"bg-bg-alt-1 gap-1 rounded-md p-2.5",children:[s(r,{className:"items-center justify-between gap-3",children:[e("p",{className:"typo-compact-xs-normal text-fg-subtler",children:t("move.amr.rightPanel.map.mapping.saveStatus")}),e("p",{className:`typo-compact-xs-semibold text-right ${x?"text-fg-success":"text-fg-danger"}`,children:T})]}),v&&e("p",{className:"typo-compact-2xs-normal text-fg-subtler text-right",children:v}),s(r,{className:"items-center justify-between gap-3",children:[e("p",{className:"typo-compact-xs-normal text-fg-subtler",children:t("move.amr.rightPanel.map.mapping.keyframesReceived")}),e("p",{className:"typo-compact-xs-semibold text-fg-default text-right",children:n.toLocaleString()})]}),s(r,{className:"items-center justify-between gap-3",children:[e("p",{className:"typo-compact-xs-normal text-fg-subtler",children:t("move.amr.rightPanel.map.mapping.keyframePoints")}),e("p",{className:"typo-compact-xs-semibold text-fg-default text-right",children:t("move.amr.rightPanel.map.mapping.points",{count:c.toLocaleString()})})]}),s(r,{className:"items-center justify-between gap-3",children:[e("p",{className:"typo-compact-xs-normal text-fg-subtler",children:t("move.amr.rightPanel.task.duration")}),e("p",{className:"typo-compact-xs-semibold text-fg-default text-right",children:w(o)})]})]})]})]}),!b&&s(r,{className:"shrink-0 justify-between gap-2",children:[e(L,{onClick:S,disabled:!f||y,className:"gap-1 px-3.5",leadingIcon:e(A,{}),variant:"danger",children:t("move.amr.rightPanel.common.stop")}),e(L,{onClick:G,disabled:f||y,className:"flex-1 gap-1 px-3.5",variant:"brand",children:t("move.amr.rightPanel.map.mapping.startMapping")})]}),b&&s(d,{className:"shrink-0 gap-2",children:[!x&&e(d,{className:"items-center",children:e("p",{className:"typo-compact-2xs-normal text-fg-danger",children:t("move.amr.rightPanel.map.mapping.keyframeRequired")})}),s(r,{className:"justify-between gap-2",children:[e(L,{onClick:j,disabled:y,className:"gap-1 px-3.5",children:t(h==="discarding"?"move.amr.rightPanel.map.mapping.discarding":"move.amr.rightPanel.common.discard")}),e(L,{onClick:F,disabled:!x||y,className:"flex-1 gap-1 px-3.5",variant:"brand",children:t(h==="saving"?"move.amr.rightPanel.common.saving":"move.amr.rightPanel.common.save")})]})]})]})},q=()=>({GOAL:0,ROUTE:0,ALIGN:0}),U=h=>h>=1e6?`${(h/1e6).toFixed(1)}M`:h>=1e3?`${(h/1e3).toFixed(1)}K`:`${h}`,R=h=>`${h<0?"-":"+"}${Math.abs(h).toFixed(1)}m`,B=({currentMapName:h,createdAt:o,lastModified:n,mapCloudCount:c,mapBounds:a,topologyCount:p,nodeTypeCounts:i})=>{const{t:l}=P(),m=a?`${R(a.minX)} ~ ${R(a.maxX)}`:"--",u=a?`${R(a.minY)} ~ ${R(a.maxY)}`:"--",t=a?Math.abs(a.maxX-a.minX)*Math.abs(a.maxY-a.minY):null,f=t===null?"--":`${t.toFixed(1)} m²`,b=i??q();return s(d,{className:"items-start overflow-y-auto",children:[s(d,{className:"border-border-subtler w-full gap-1.5 border-b-[1px] p-3",children:[s(d,{className:"gap-0.5 self-stretch",children:[e("p",{className:"typo-compact-xs2-normal text-fg-subtle",children:l("move.amr.rightPanel.map.info.mapName")}),e("p",{className:"typo-compact-md-semibold text-fg-default",children:h})]}),s(d,{className:"items-start gap-1 self-stretch",children:[s(r,{className:"items-center justify-between self-stretch",children:[e("p",{className:"typo-compact-xs-normal text-fg-subtler",children:l("move.amr.rightPanel.common.created")}),e("p",{className:"typo-compact-xs-normal text-fg-subtle",children:o??"--"})]}),s(r,{className:"items-center justify-between self-stretch",children:[e("p",{className:"typo-compact-xs-normal text-fg-subtler",children:l("move.amr.rightPanel.map.info.lastModified")}),e("p",{className:"typo-compact-xs-normal text-fg-subtle",children:n??"--"})]})]})]}),s(d,{className:"border-border-subtler w-full gap-2 border-b-[1px] p-3",children:[e("p",{className:"typo-compact-md-semibold text-fg-default",children:l("move.amr.rightPanel.map.info.statistics")}),s(r,{className:"items-center justify-between self-stretch",children:[s(r,{className:"items-center gap-[6px]",children:[e("div",{className:"bg-fill-subtler flex size-6 items-center justify-center rounded-full",children:e(O,{className:"text-fg-subtle size-4"})}),e("p",{className:"typo-compact-xs2-normal text-fg-subtle",children:l("move.amr.rightPanel.map.info.nodes")})]}),e("p",{className:"typo-compact-xs2-normal text-fg-default",children:p})]}),s(r,{className:"items-center justify-between self-stretch",children:[e(r,{children:s(r,{className:"items-center gap-[6px]",children:[e("div",{className:"bg-fill-subtler flex size-6 items-center justify-center rounded-full",children:e(_,{className:"text-fg-subtle size-4"})}),e("p",{className:"typo-compact-xs2-normal text-fg-subtle",children:l("move.amr.rightPanel.map.info.pointCloud")})]})}),s("p",{className:"typo-compact-xs2-normal text-fg-default",children:[U(c)," pts"]})]})]}),s(d,{className:"border-border-subtler w-full gap-2 border-b-[1px] p-3",children:[e("p",{className:"typo-compact-md-semibold text-fg-default",children:l("move.amr.rightPanel.map.info.mapBoundaries")}),s(r,{className:"items-center justify-between self-stretch",children:[e(r,{className:"items-center gap-[6px]",children:e("p",{className:"typo-compact-xs2-normal text-fg-subtle",children:l("move.amr.rightPanel.map.info.xRange")})}),e("p",{className:"typo-compact-xs2-normal text-fg-default",children:m})]}),s(r,{className:"items-center justify-between self-stretch",children:[e(r,{children:e(r,{className:"items-center gap-[6px]",children:e("p",{className:"typo-compact-xs2-normal text-fg-subtle",children:l("move.amr.rightPanel.map.info.yRange")})})}),e("p",{className:"typo-compact-xs2-normal text-fg-default",children:u})]}),s(r,{className:"items-center justify-between self-stretch",children:[e(r,{className:"items-center gap-[6px]",children:e("p",{className:"typo-compact-xs2-normal text-fg-subtle",children:l("move.amr.rightPanel.map.info.totalArea")})}),e("p",{className:"typo-compact-xs2-normal text-fg-default",children:f})]})]}),s(d,{className:"border-border-subtler w-full gap-2 border-b-[1px] p-3",children:[e("p",{className:"typo-compact-md-semibold text-fg-default",children:l("move.amr.rightPanel.menu.topology")}),s(r,{className:"items-center justify-between self-stretch",children:[s(r,{className:"items-center gap-[6px]",children:[e("div",{className:"bg-fill-warning-subtler flex size-6 items-center justify-center rounded-full",children:e(E,{className:"text-fg-warning size-4"})}),e("p",{className:"typo-compact-xs2-normal text-fg-subtle",children:l("move.amr.rightPanel.topology.nodeType.goal")})]}),e("p",{className:"typo-compact-xs2-normal text-fg-default",children:b.GOAL})]}),s(r,{className:"items-center justify-between self-stretch",children:[e(r,{children:s(r,{className:"items-center gap-[6px]",children:[e("div",{className:"bg-fill-brand-subtler flex size-6 items-center justify-center rounded-full",children:e(I,{className:"text-fg-brand size-4"})}),e("p",{className:"typo-compact-xs2-normal text-fg-subtle",children:l("move.amr.rightPanel.topology.nodeType.route")})]})}),e("p",{className:"typo-compact-xs2-normal text-fg-default",children:b.ROUTE})]}),s(r,{className:"items-center justify-between self-stretch",children:[s(r,{className:"items-center gap-[6px]",children:[e("div",{className:"bg-fill-success-subtler flex size-6 items-center justify-center rounded-full",children:e(K,{className:"text-fg-success size-4"})}),e("p",{className:"typo-compact-xs2-normal text-fg-subtle",children:l("move.amr.rightPanel.topology.nodeType.align")})]}),e("p",{className:"typo-compact-xs2-normal text-fg-default",children:b.ALIGN})]})]})]})};export{B as M,J as R,V as a};