@egen-civitas/esm-styleguide 2.3.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/dist/_all.scss +0 -1
- package/dist/_vars.scss +4 -4
- package/dist/assistant/index.d.ts +7 -0
- package/dist/assistant/index.d.ts.map +1 -1
- package/dist/assistant/index.js +5 -0
- package/dist/assistant/live-orb.component.d.ts +6 -0
- package/dist/assistant/live-orb.component.d.ts.map +1 -1
- package/dist/assistant/live-orb.component.js +15 -3
- package/dist/assistant/robot/README.md +47 -0
- package/dist/assistant/robot/Robot.d.ts +16 -0
- package/dist/assistant/robot/Robot.d.ts.map +1 -0
- package/dist/assistant/robot/Robot.js +159 -0
- package/dist/assistant/robot/RobotStage.d.ts +31 -0
- package/dist/assistant/robot/RobotStage.d.ts.map +1 -0
- package/dist/assistant/robot/RobotStage.js +250 -0
- package/dist/assistant/robot/clips.d.ts +62 -0
- package/dist/assistant/robot/clips.d.ts.map +1 -0
- package/dist/assistant/robot/clips.js +179 -0
- package/dist/assistant/robot/controller.d.ts +133 -0
- package/dist/assistant/robot/controller.d.ts.map +1 -0
- package/dist/assistant/robot/controller.js +522 -0
- package/dist/assistant/robot/gestures.d.ts +23 -0
- package/dist/assistant/robot/gestures.d.ts.map +1 -0
- package/dist/assistant/robot/gestures.js +1301 -0
- package/dist/assistant/robot/hands.d.ts +55 -0
- package/dist/assistant/robot/hands.d.ts.map +1 -0
- package/dist/assistant/robot/hands.js +121 -0
- package/dist/assistant/robot/ik.d.ts +34 -0
- package/dist/assistant/robot/ik.d.ts.map +1 -0
- package/dist/assistant/robot/ik.js +57 -0
- package/dist/assistant/robot/index.d.ts +18 -0
- package/dist/assistant/robot/index.d.ts.map +1 -0
- package/dist/assistant/robot/index.js +9 -0
- package/dist/assistant/robot/lazy.d.ts +8 -0
- package/dist/assistant/robot/lazy.d.ts.map +1 -0
- package/dist/assistant/robot/lazy.js +33 -0
- package/dist/assistant/robot/materials.d.ts +46 -0
- package/dist/assistant/robot/materials.d.ts.map +1 -0
- package/dist/assistant/robot/materials.js +101 -0
- package/dist/assistant/robot/parts/Body.d.ts +28 -0
- package/dist/assistant/robot/parts/Body.d.ts.map +1 -0
- package/dist/assistant/robot/parts/Body.js +368 -0
- package/dist/assistant/robot/parts/Head.d.ts +11 -0
- package/dist/assistant/robot/parts/Head.d.ts.map +1 -0
- package/dist/assistant/robot/parts/Head.js +210 -0
- package/dist/assistant/robot/parts/primitives.d.ts +36 -0
- package/dist/assistant/robot/parts/primitives.d.ts.map +1 -0
- package/dist/assistant/robot/parts/primitives.js +127 -0
- package/dist/assistant/robot/skeleton.d.ts +66 -0
- package/dist/assistant/robot/skeleton.d.ts.map +1 -0
- package/dist/assistant/robot/skeleton.js +266 -0
- package/dist/cards/card-header.component.d.ts +1 -1
- package/dist/cards/card-header.component.js +1 -1
- package/dist/cards/card-header.stories.js +1 -1
- package/dist/components/_general.scss +3 -3
- package/dist/config-schema.d.ts +0 -17
- package/dist/config-schema.d.ts.map +1 -1
- package/dist/config-schema.js +0 -25
- package/dist/datepicker/datepicker.stories.js +1 -1
- package/dist/empty-card/empty-card.stories.js +2 -2
- package/dist/error-state/error-state.stories.js +2 -2
- package/dist/icons/icon-registration.d.ts.map +1 -1
- package/dist/icons/icon-registration.js +0 -30
- package/dist/icons/icons.d.ts +4 -32
- package/dist/icons/icons.d.ts.map +1 -1
- package/dist/icons/icons.js +18 -148
- package/dist/index.js +0 -2
- package/dist/internal.d.ts +0 -3
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +0 -3
- package/dist/notifications/actionable-notification.stories.js +5 -5
- package/dist/notifications/notification.stories.js +5 -5
- package/dist/page-header/page-header.component.d.ts +1 -1
- package/dist/page-header/page-header.component.js +1 -1
- package/dist/pagination/pagination.stories.js +2 -2
- package/dist/pictograms/pictogram-registration.d.ts.map +1 -1
- package/dist/pictograms/pictogram-registration.js +2 -36
- package/dist/pictograms/pictograms.d.ts +2 -20
- package/dist/pictograms/pictograms.d.ts.map +1 -1
- package/dist/pictograms/pictograms.js +2 -139
- package/dist/public.d.ts +0 -3
- package/dist/public.d.ts.map +1 -1
- package/dist/public.js +0 -3
- package/dist/responsive-wrapper/responsive-wrapper.stories.js +1 -1
- package/dist/snackbars/snackbar.stories.js +1 -1
- package/dist/toasts/toast.stories.js +1 -1
- package/dist/workbench/splitter.component.d.ts +14 -0
- package/dist/workbench/splitter.component.d.ts.map +1 -1
- package/dist/workbench/splitter.component.js +52 -0
- package/dist/workbench/tool-window-rail.component.d.ts.map +1 -1
- package/dist/workbench/tool-window-rail.component.js +9 -1
- package/dist/workbench/tool-window-zone.component.d.ts.map +1 -1
- package/dist/workbench/tool-window-zone.component.js +9 -1
- package/dist/workbench/workbench.module.scss +64 -1
- package/dist/workbench/workbench.store.d.ts +2 -0
- package/dist/workbench/workbench.store.d.ts.map +1 -1
- package/dist/workbench/workbench.store.js +9 -0
- package/dist/workspaces/container/workspace-container.component.d.ts +8 -8
- package/dist/workspaces/container/workspace-container.component.js +9 -9
- package/dist/workspaces2/workspace2.d.ts +3 -3
- package/dist/workspaces2/workspace2.js +3 -3
- package/mock-jest.tsx +0 -41
- package/mock.tsx +0 -41
- package/package.json +26 -23
- package/src/_vars.scss +4 -4
- package/dist/entity-banner/actions-menu/entity-banner-actions-menu.component.d.ts +0 -19
- package/dist/entity-banner/actions-menu/entity-banner-actions-menu.component.d.ts.map +0 -1
- package/dist/entity-banner/actions-menu/entity-banner-actions-menu.component.js +0 -137
- package/dist/entity-banner/actions-menu/entity-banner-actions-menu.module.scss +0 -23
- package/dist/entity-banner/contact-details/entity-banner-contact-details.component.d.ts +0 -9
- package/dist/entity-banner/contact-details/entity-banner-contact-details.component.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/entity-banner-contact-details.component.js +0 -207
- package/dist/entity-banner/contact-details/entity-banner-contact-details.module.scss +0 -47
- package/dist/entity-banner/contact-details/entity-banner-toggle-contact-details-button.component.d.ts +0 -12
- package/dist/entity-banner/contact-details/entity-banner-toggle-contact-details-button.component.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/entity-banner-toggle-contact-details-button.component.js +0 -15
- package/dist/entity-banner/contact-details/types.d.ts +0 -48
- package/dist/entity-banner/contact-details/types.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/types.js +0 -1
- package/dist/entity-banner/contact-details/useEntityAttributes.d.ts +0 -14
- package/dist/entity-banner/contact-details/useEntityAttributes.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/useEntityAttributes.js +0 -12
- package/dist/entity-banner/contact-details/useEntityGroupsForEntity.d.ts +0 -11
- package/dist/entity-banner/contact-details/useEntityGroupsForEntity.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/useEntityGroupsForEntity.js +0 -9
- package/dist/entity-banner/contact-details/useRelationships.d.ts +0 -35
- package/dist/entity-banner/contact-details/useRelationships.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/useRelationships.js +0 -37
- package/dist/entity-banner/entity-info/entity-banner-entity-identifiers.component.d.ts +0 -9
- package/dist/entity-banner/entity-info/entity-banner-entity-identifiers.component.d.ts.map +0 -1
- package/dist/entity-banner/entity-info/entity-banner-entity-identifiers.component.js +0 -77
- package/dist/entity-banner/entity-info/entity-banner-entity-info.component.d.ts +0 -9
- package/dist/entity-banner/entity-info/entity-banner-entity-info.component.d.ts.map +0 -1
- package/dist/entity-banner/entity-info/entity-banner-entity-info.component.js +0 -72
- package/dist/entity-banner/entity-info/entity-banner-entity-info.module.scss +0 -165
- package/dist/entity-banner/index.d.ts +0 -5
- package/dist/entity-banner/index.d.ts.map +0 -1
- package/dist/entity-banner/index.js +0 -4
- package/dist/entity-photo/entity-photo.component.d.ts +0 -21
- package/dist/entity-photo/entity-photo.component.d.ts.map +0 -1
- package/dist/entity-photo/entity-photo.component.js +0 -111
- package/dist/entity-photo/entity-photo.module.scss +0 -21
- package/dist/entity-photo/index.d.ts +0 -3
- package/dist/entity-photo/index.d.ts.map +0 -1
- package/dist/entity-photo/index.js +0 -2
- package/dist/entity-photo/placeholder-icon.component.d.ts +0 -9
- package/dist/entity-photo/placeholder-icon.component.d.ts.map +0 -1
- package/dist/entity-photo/placeholder-icon.component.js +0 -26
- package/dist/entity-photo/useEntityPhoto.d.ts +0 -29
- package/dist/entity-photo/useEntityPhoto.d.ts.map +0 -1
- package/dist/entity-photo/useEntityPhoto.js +0 -37
- package/dist/icons/svgs/baby.svg +0 -1
- package/dist/icons/svgs/chemistry.svg +0 -1
- package/dist/icons/svgs/drug-order.svg +0 -1
- package/dist/icons/svgs/generic-order-type.svg +0 -1
- package/dist/icons/svgs/hospital-bed.svg +0 -1
- package/dist/icons/svgs/image-medical.svg +0 -1
- package/dist/icons/svgs/lab-order.svg +0 -1
- package/dist/icons/svgs/material-order.svg +0 -1
- package/dist/icons/svgs/medication.svg +0 -1
- package/dist/icons/svgs/microscope.svg +0 -1
- package/dist/icons/svgs/mother.svg +0 -1
- package/dist/icons/svgs/procedure-order.svg +0 -1
- package/dist/icons/svgs/referral-order.svg +0 -1
- package/dist/icons/svgs/syringe.svg +0 -1
- package/dist/logo/_logo.scss +0 -34
- package/dist/logo/egen-logo-full.svg +0 -1
- package/dist/logo/egen-logo-icon.svg +0 -1
- package/dist/logo/egen-logo-partial.svg +0 -1
- package/dist/logo/egen-logo-white.svg +0 -1
- package/dist/logo/index.d.ts +0 -8
- package/dist/logo/index.d.ts.map +0 -1
- package/dist/logo/index.js +0 -22
- package/dist/numeric-datapoint/index.d.ts +0 -4
- package/dist/numeric-datapoint/index.d.ts.map +0 -1
- package/dist/numeric-datapoint/index.js +0 -3
- package/dist/numeric-datapoint/interpretation-utils.d.ts +0 -27
- package/dist/numeric-datapoint/interpretation-utils.d.ts.map +0 -1
- package/dist/numeric-datapoint/interpretation-utils.js +0 -66
- package/dist/numeric-datapoint/numeric-datapoint.component.d.ts +0 -44
- package/dist/numeric-datapoint/numeric-datapoint.component.d.ts.map +0 -1
- package/dist/numeric-datapoint/numeric-datapoint.component.js +0 -110
- package/dist/numeric-datapoint/numeric-datapoint.module.scss +0 -141
- package/dist/numeric-datapoint/use-concept-reference-range.d.ts +0 -13
- package/dist/numeric-datapoint/use-concept-reference-range.d.ts.map +0 -1
- package/dist/numeric-datapoint/use-concept-reference-range.js +0 -31
- package/dist/pictograms/svgs/blood-bank.svg +0 -1
- package/dist/pictograms/svgs/cardiology.svg +0 -1
- package/dist/pictograms/svgs/ct-scan.svg +0 -1
- package/dist/pictograms/svgs/dentistry.svg +0 -1
- package/dist/pictograms/svgs/emergency-department.svg +0 -1
- package/dist/pictograms/svgs/geriatrics.svg +0 -1
- package/dist/pictograms/svgs/gynaecology.svg +0 -1
- package/dist/pictograms/svgs/in-patient.svg +0 -1
- package/dist/pictograms/svgs/labs-2.svg +0 -1
- package/dist/pictograms/svgs/labs.svg +0 -1
- package/dist/pictograms/svgs/obstetrics.svg +0 -1
- package/dist/pictograms/svgs/patient-search.svg +0 -1
- package/dist/pictograms/svgs/patients.svg +0 -1
- package/dist/pictograms/svgs/pharmacy-1.svg +0 -1
- package/dist/pictograms/svgs/pharmacy-2.svg +0 -1
- package/dist/pictograms/svgs/triage.svg +0 -1
- package/dist/pictograms/svgs/x-ray.svg +0 -1
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import { Canvas, useThree } from "@react-three/fiber";
|
|
4
|
+
import { ACESFilmicToneMapping, PCFSoftShadowMap, PMREMGenerator, SRGBColorSpace } from "three";
|
|
5
|
+
import { RoomEnvironment } from "three/examples/jsm/environments/RoomEnvironment.js";
|
|
6
|
+
import { RobotController } from "./controller.js";
|
|
7
|
+
import { Robot } from "./Robot.js";
|
|
8
|
+
/** Éclairage « studio » : reflets doux sur le vinyle sans fichier HDR à télécharger. */ function StudioEnvironment({ intensity = 0.9 }) {
|
|
9
|
+
const { gl, scene } = useThree();
|
|
10
|
+
useEffect(()=>{
|
|
11
|
+
const pmrem = new PMREMGenerator(gl);
|
|
12
|
+
const env = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;
|
|
13
|
+
scene.environment = env;
|
|
14
|
+
scene.environmentIntensity = intensity;
|
|
15
|
+
return ()=>{
|
|
16
|
+
scene.environment = null;
|
|
17
|
+
env.dispose();
|
|
18
|
+
pmrem.dispose();
|
|
19
|
+
};
|
|
20
|
+
}, [
|
|
21
|
+
gl,
|
|
22
|
+
scene,
|
|
23
|
+
intensity
|
|
24
|
+
]);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const FRAMING = {
|
|
28
|
+
full: {
|
|
29
|
+
pos: [
|
|
30
|
+
0,
|
|
31
|
+
0.95,
|
|
32
|
+
4.0
|
|
33
|
+
],
|
|
34
|
+
target: [
|
|
35
|
+
0,
|
|
36
|
+
0.78,
|
|
37
|
+
0
|
|
38
|
+
],
|
|
39
|
+
fov: 30
|
|
40
|
+
},
|
|
41
|
+
bust: {
|
|
42
|
+
pos: [
|
|
43
|
+
0,
|
|
44
|
+
1.1,
|
|
45
|
+
2.3
|
|
46
|
+
],
|
|
47
|
+
target: [
|
|
48
|
+
0,
|
|
49
|
+
1.0,
|
|
50
|
+
0
|
|
51
|
+
],
|
|
52
|
+
fov: 30
|
|
53
|
+
},
|
|
54
|
+
close: {
|
|
55
|
+
pos: [
|
|
56
|
+
0,
|
|
57
|
+
1.3,
|
|
58
|
+
1.45
|
|
59
|
+
],
|
|
60
|
+
target: [
|
|
61
|
+
0,
|
|
62
|
+
1.27,
|
|
63
|
+
0
|
|
64
|
+
],
|
|
65
|
+
fov: 32
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
function CameraRig({ framing }) {
|
|
69
|
+
const { camera } = useThree();
|
|
70
|
+
useEffect(()=>{
|
|
71
|
+
const f = FRAMING[framing];
|
|
72
|
+
camera.position.set(...f.pos);
|
|
73
|
+
camera.lookAt(...f.target);
|
|
74
|
+
if ('fov' in camera) {
|
|
75
|
+
camera.fov = f.fov;
|
|
76
|
+
camera.updateProjectionMatrix();
|
|
77
|
+
}
|
|
78
|
+
}, [
|
|
79
|
+
camera,
|
|
80
|
+
framing
|
|
81
|
+
]);
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
function PointerGaze({ controller }) {
|
|
85
|
+
useEffect(()=>{
|
|
86
|
+
const onMove = (e)=>{
|
|
87
|
+
const nx = e.clientX / window.innerWidth * 2 - 1;
|
|
88
|
+
const ny = e.clientY / window.innerHeight * 2 - 1;
|
|
89
|
+
// x écran vers la droite = +x du robot vu de face → le robot « regarde » vers ce côté.
|
|
90
|
+
controller.setGaze({
|
|
91
|
+
yaw: -nx * 0.9,
|
|
92
|
+
pitch: -ny * 0.45
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
const onLeave = (e)=>{
|
|
96
|
+
if (e.relatedTarget === null) controller.setGaze(null);
|
|
97
|
+
};
|
|
98
|
+
window.addEventListener('pointermove', onMove, {
|
|
99
|
+
passive: true
|
|
100
|
+
});
|
|
101
|
+
document.addEventListener('mouseout', onLeave);
|
|
102
|
+
return ()=>{
|
|
103
|
+
window.removeEventListener('pointermove', onMove);
|
|
104
|
+
document.removeEventListener('mouseout', onLeave);
|
|
105
|
+
controller.setGaze(null);
|
|
106
|
+
};
|
|
107
|
+
}, [
|
|
108
|
+
controller
|
|
109
|
+
]);
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Scène 3D prête à l'emploi : canvas transparent, éclairage studio, ombre au sol, caméra cadrée.
|
|
114
|
+
* Le robot s'anime tout seul selon `state` ; pour des gestes précis, passer un `controller`
|
|
115
|
+
* (`controller.play('wave')`, `controller.walkTo(1, 0)`, `controller.pointAt('L', [...])`…).
|
|
116
|
+
*/ export function RobotStage({ controller: external, controllerOptions, state = 'idle', speechLevel = 0, theme, framing = 'full', followPointer = true, paused = false, className, style, children }) {
|
|
117
|
+
const own = useRef(null);
|
|
118
|
+
const controller = useMemo(()=>{
|
|
119
|
+
if (external) return external;
|
|
120
|
+
if (!own.current) own.current = new RobotController(controllerOptions);
|
|
121
|
+
return own.current;
|
|
122
|
+
}, [
|
|
123
|
+
external
|
|
124
|
+
]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
125
|
+
useEffect(()=>{
|
|
126
|
+
controller.setState(state);
|
|
127
|
+
}, [
|
|
128
|
+
controller,
|
|
129
|
+
state
|
|
130
|
+
]);
|
|
131
|
+
useEffect(()=>{
|
|
132
|
+
controller.speechLevel = speechLevel;
|
|
133
|
+
}, [
|
|
134
|
+
controller,
|
|
135
|
+
speechLevel
|
|
136
|
+
]);
|
|
137
|
+
const f = FRAMING[framing];
|
|
138
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
139
|
+
className: className,
|
|
140
|
+
style: {
|
|
141
|
+
width: '100%',
|
|
142
|
+
height: '100%',
|
|
143
|
+
...style
|
|
144
|
+
},
|
|
145
|
+
"data-slot": "robot-stage",
|
|
146
|
+
children: /*#__PURE__*/ _jsxs(Canvas, {
|
|
147
|
+
shadows: {
|
|
148
|
+
type: PCFSoftShadowMap
|
|
149
|
+
},
|
|
150
|
+
dpr: [
|
|
151
|
+
1,
|
|
152
|
+
2
|
|
153
|
+
],
|
|
154
|
+
frameloop: paused ? 'never' : 'always',
|
|
155
|
+
camera: {
|
|
156
|
+
position: f.pos,
|
|
157
|
+
fov: f.fov,
|
|
158
|
+
near: 0.1,
|
|
159
|
+
far: 50
|
|
160
|
+
},
|
|
161
|
+
gl: {
|
|
162
|
+
alpha: true,
|
|
163
|
+
antialias: true,
|
|
164
|
+
powerPreference: 'high-performance',
|
|
165
|
+
toneMapping: ACESFilmicToneMapping,
|
|
166
|
+
toneMappingExposure: 0.85,
|
|
167
|
+
outputColorSpace: SRGBColorSpace
|
|
168
|
+
},
|
|
169
|
+
style: {
|
|
170
|
+
background: 'transparent'
|
|
171
|
+
},
|
|
172
|
+
children: [
|
|
173
|
+
/*#__PURE__*/ _jsx(CameraRig, {
|
|
174
|
+
framing: framing
|
|
175
|
+
}),
|
|
176
|
+
/*#__PURE__*/ _jsx(StudioEnvironment, {}),
|
|
177
|
+
/*#__PURE__*/ _jsx("hemisphereLight", {
|
|
178
|
+
args: [
|
|
179
|
+
'#ffffff',
|
|
180
|
+
'#7d838f',
|
|
181
|
+
0.22
|
|
182
|
+
]
|
|
183
|
+
}),
|
|
184
|
+
/*#__PURE__*/ _jsx("directionalLight", {
|
|
185
|
+
position: [
|
|
186
|
+
-1.6,
|
|
187
|
+
5,
|
|
188
|
+
2.6
|
|
189
|
+
],
|
|
190
|
+
intensity: 1.5,
|
|
191
|
+
castShadow: true,
|
|
192
|
+
"shadow-mapSize": [
|
|
193
|
+
2048,
|
|
194
|
+
2048
|
|
195
|
+
],
|
|
196
|
+
"shadow-camera-left": -2.5,
|
|
197
|
+
"shadow-camera-right": 2.5,
|
|
198
|
+
"shadow-camera-top": 3,
|
|
199
|
+
"shadow-camera-bottom": -1,
|
|
200
|
+
"shadow-camera-near": 0.5,
|
|
201
|
+
"shadow-camera-far": 12,
|
|
202
|
+
"shadow-bias": -0.0004,
|
|
203
|
+
"shadow-normalBias": 0.02
|
|
204
|
+
}),
|
|
205
|
+
/*#__PURE__*/ _jsx("directionalLight", {
|
|
206
|
+
position: [
|
|
207
|
+
3,
|
|
208
|
+
1.5,
|
|
209
|
+
1.5
|
|
210
|
+
],
|
|
211
|
+
intensity: 0.45,
|
|
212
|
+
color: "#dfe8ff"
|
|
213
|
+
}),
|
|
214
|
+
/*#__PURE__*/ _jsxs("mesh", {
|
|
215
|
+
rotation: [
|
|
216
|
+
-Math.PI / 2,
|
|
217
|
+
0,
|
|
218
|
+
0
|
|
219
|
+
],
|
|
220
|
+
position: [
|
|
221
|
+
0,
|
|
222
|
+
0.001,
|
|
223
|
+
0
|
|
224
|
+
],
|
|
225
|
+
receiveShadow: true,
|
|
226
|
+
children: [
|
|
227
|
+
/*#__PURE__*/ _jsx("planeGeometry", {
|
|
228
|
+
args: [
|
|
229
|
+
30,
|
|
230
|
+
30
|
|
231
|
+
]
|
|
232
|
+
}),
|
|
233
|
+
/*#__PURE__*/ _jsx("shadowMaterial", {
|
|
234
|
+
opacity: 0.28
|
|
235
|
+
})
|
|
236
|
+
]
|
|
237
|
+
}),
|
|
238
|
+
/*#__PURE__*/ _jsx(Robot, {
|
|
239
|
+
controller: controller,
|
|
240
|
+
theme: theme
|
|
241
|
+
}),
|
|
242
|
+
followPointer ? /*#__PURE__*/ _jsx(PointerGaze, {
|
|
243
|
+
controller: controller
|
|
244
|
+
}) : null,
|
|
245
|
+
children
|
|
246
|
+
]
|
|
247
|
+
})
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
export default RobotStage;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type JointName, type PartialPose, type Side, type Vec3 } from './skeleton.js';
|
|
2
|
+
import type { HandShapeName } from './hands.js';
|
|
3
|
+
export interface ClipKey {
|
|
4
|
+
/** Instant de la clé, en secondes depuis le début du clip. */
|
|
5
|
+
t: number;
|
|
6
|
+
/** Angles (radians) des articulations concernées. Les autres ne sont pas touchées. */
|
|
7
|
+
pose?: PartialPose;
|
|
8
|
+
/** Forme des mains à partir de cet instant (l'autre côté n'est pas modifié). */
|
|
9
|
+
hands?: Partial<Record<Side, HandShapeName>>;
|
|
10
|
+
/** Hauteur dont le corps est soulevé (mètres) : sauts, sursauts. */
|
|
11
|
+
lift?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ClipDef {
|
|
14
|
+
name: string;
|
|
15
|
+
duration: number;
|
|
16
|
+
loop?: boolean;
|
|
17
|
+
fadeIn?: number;
|
|
18
|
+
fadeOut?: number;
|
|
19
|
+
keys: ClipKey[];
|
|
20
|
+
}
|
|
21
|
+
interface Track {
|
|
22
|
+
times: number[];
|
|
23
|
+
values: Vec3[];
|
|
24
|
+
}
|
|
25
|
+
export interface CompiledClip {
|
|
26
|
+
name: string;
|
|
27
|
+
duration: number;
|
|
28
|
+
loop: boolean;
|
|
29
|
+
fadeIn: number;
|
|
30
|
+
fadeOut: number;
|
|
31
|
+
tracks: Map<JointName, Track>;
|
|
32
|
+
lift: Track | null;
|
|
33
|
+
hands: {
|
|
34
|
+
L: {
|
|
35
|
+
t: number;
|
|
36
|
+
shape: HandShapeName;
|
|
37
|
+
}[];
|
|
38
|
+
R: {
|
|
39
|
+
t: number;
|
|
40
|
+
shape: HandShapeName;
|
|
41
|
+
}[];
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface ClipSample {
|
|
45
|
+
pose: PartialPose;
|
|
46
|
+
hands: Partial<Record<Side, HandShapeName>>;
|
|
47
|
+
lift: number;
|
|
48
|
+
}
|
|
49
|
+
/** Retourne un clip écrit pour le côté gauche, mais joué avec le côté droit. */
|
|
50
|
+
export declare function mirrorClip(def: ClipDef): ClipDef;
|
|
51
|
+
export declare function compileClip(def: ClipDef): CompiledClip;
|
|
52
|
+
export declare function sampleClip(clip: CompiledClip, time: number): ClipSample;
|
|
53
|
+
/** Poids 0..1 d'un clip à l'instant `time` (fondu d'entrée et de sortie). */
|
|
54
|
+
export declare function clipWeight(clip: CompiledClip, time: number, stopping: boolean, stopTime: number): number;
|
|
55
|
+
/** Vérifie qu'un clip ne sort jamais des butées (utile dans les tests). */
|
|
56
|
+
export declare function clipWithinLimits(def: ClipDef): {
|
|
57
|
+
joint: JointName;
|
|
58
|
+
t: number;
|
|
59
|
+
value: Vec3;
|
|
60
|
+
}[];
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=clips.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clips.d.ts","sourceRoot":"","sources":["../../../src/assistant/robot/clips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,eAAe,CA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AAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAehD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,CAuDtD;AAmBD,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAWvE;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMxG;AAED,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,IAAI,CAAA;CAAE,EAAE,CAW7F"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { JOINTS, REST_POSE, mirrorJointName } from "./skeleton.js";
|
|
2
|
+
/** Retourne un clip écrit pour le côté gauche, mais joué avec le côté droit. */ export function mirrorClip(def) {
|
|
3
|
+
return {
|
|
4
|
+
...def,
|
|
5
|
+
keys: def.keys.map((k)=>{
|
|
6
|
+
const pose = {};
|
|
7
|
+
for (const [n, v] of Object.entries(k.pose ?? {})){
|
|
8
|
+
const m = mirrorJointName(n);
|
|
9
|
+
pose[m] = m !== n ? [
|
|
10
|
+
v[0],
|
|
11
|
+
-v[1],
|
|
12
|
+
-v[2]
|
|
13
|
+
] : [
|
|
14
|
+
v[0],
|
|
15
|
+
v[1],
|
|
16
|
+
v[2]
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
const hands = {};
|
|
20
|
+
if (k.hands?.L) hands.R = k.hands.L;
|
|
21
|
+
if (k.hands?.R) hands.L = k.hands.R;
|
|
22
|
+
return {
|
|
23
|
+
...k,
|
|
24
|
+
pose,
|
|
25
|
+
hands
|
|
26
|
+
};
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function compileClip(def) {
|
|
31
|
+
const keys = [
|
|
32
|
+
...def.keys
|
|
33
|
+
].sort((a, b)=>a.t - b.t);
|
|
34
|
+
const tracks = new Map();
|
|
35
|
+
const lifts = [];
|
|
36
|
+
const hands = {
|
|
37
|
+
L: [],
|
|
38
|
+
R: []
|
|
39
|
+
};
|
|
40
|
+
for (const k of keys){
|
|
41
|
+
for (const [n, v] of Object.entries(k.pose ?? {})){
|
|
42
|
+
let tr = tracks.get(n);
|
|
43
|
+
if (!tr) tracks.set(n, tr = {
|
|
44
|
+
times: [],
|
|
45
|
+
values: []
|
|
46
|
+
});
|
|
47
|
+
tr.times.push(k.t);
|
|
48
|
+
tr.values.push(v);
|
|
49
|
+
}
|
|
50
|
+
if (k.lift !== undefined) lifts.push({
|
|
51
|
+
t: k.t,
|
|
52
|
+
v: k.lift
|
|
53
|
+
});
|
|
54
|
+
if (k.hands?.L) hands.L.push({
|
|
55
|
+
t: k.t,
|
|
56
|
+
shape: k.hands.L
|
|
57
|
+
});
|
|
58
|
+
if (k.hands?.R) hands.R.push({
|
|
59
|
+
t: k.t,
|
|
60
|
+
shape: k.hands.R
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
// Chaque piste part de la pose de repos et y revient, sauf si l'auteur du clip en a décidé autrement.
|
|
64
|
+
for (const [n, tr] of tracks){
|
|
65
|
+
const rest = REST_POSE[n];
|
|
66
|
+
if (tr.times[0] > 0) {
|
|
67
|
+
tr.times.unshift(0);
|
|
68
|
+
tr.values.unshift(def.loop ? tr.values[tr.values.length - 1] : [
|
|
69
|
+
...rest
|
|
70
|
+
]);
|
|
71
|
+
}
|
|
72
|
+
if (tr.times[tr.times.length - 1] < def.duration) {
|
|
73
|
+
tr.times.push(def.duration);
|
|
74
|
+
tr.values.push(def.loop ? tr.values[0] : [
|
|
75
|
+
...rest
|
|
76
|
+
]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
let lift = null;
|
|
80
|
+
if (lifts.length) {
|
|
81
|
+
const times = lifts.map((l)=>l.t);
|
|
82
|
+
const values = lifts.map((l)=>[
|
|
83
|
+
l.v,
|
|
84
|
+
0,
|
|
85
|
+
0
|
|
86
|
+
]);
|
|
87
|
+
if (times[0] > 0) {
|
|
88
|
+
times.unshift(0);
|
|
89
|
+
values.unshift([
|
|
90
|
+
0,
|
|
91
|
+
0,
|
|
92
|
+
0
|
|
93
|
+
]);
|
|
94
|
+
}
|
|
95
|
+
if (times[times.length - 1] < def.duration) {
|
|
96
|
+
times.push(def.duration);
|
|
97
|
+
values.push([
|
|
98
|
+
0,
|
|
99
|
+
0,
|
|
100
|
+
0
|
|
101
|
+
]);
|
|
102
|
+
}
|
|
103
|
+
lift = {
|
|
104
|
+
times,
|
|
105
|
+
values
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
name: def.name,
|
|
110
|
+
duration: def.duration,
|
|
111
|
+
loop: !!def.loop,
|
|
112
|
+
fadeIn: def.fadeIn ?? 0.25,
|
|
113
|
+
fadeOut: def.fadeOut ?? 0.3,
|
|
114
|
+
tracks,
|
|
115
|
+
lift,
|
|
116
|
+
hands
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const smooth = (u)=>u * u * (3 - 2 * u);
|
|
120
|
+
function sampleTrack(tr, t) {
|
|
121
|
+
const { times, values } = tr;
|
|
122
|
+
if (t <= times[0]) return values[0];
|
|
123
|
+
const last = times.length - 1;
|
|
124
|
+
if (t >= times[last]) return values[last];
|
|
125
|
+
let i = 0;
|
|
126
|
+
while(i < last && times[i + 1] < t)i++;
|
|
127
|
+
const t0 = times[i];
|
|
128
|
+
const t1 = times[i + 1];
|
|
129
|
+
const u = t1 > t0 ? smooth((t - t0) / (t1 - t0)) : 1;
|
|
130
|
+
const a = values[i];
|
|
131
|
+
const b = values[i + 1];
|
|
132
|
+
return [
|
|
133
|
+
a[0] + (b[0] - a[0]) * u,
|
|
134
|
+
a[1] + (b[1] - a[1]) * u,
|
|
135
|
+
a[2] + (b[2] - a[2]) * u
|
|
136
|
+
];
|
|
137
|
+
}
|
|
138
|
+
export function sampleClip(clip, time) {
|
|
139
|
+
const t = clip.loop ? time % clip.duration : Math.min(time, clip.duration);
|
|
140
|
+
const pose = {};
|
|
141
|
+
for (const [n, tr] of clip.tracks)pose[n] = sampleTrack(tr, t);
|
|
142
|
+
const hands = {};
|
|
143
|
+
for (const side of [
|
|
144
|
+
'L',
|
|
145
|
+
'R'
|
|
146
|
+
]){
|
|
147
|
+
let cur;
|
|
148
|
+
for (const h of clip.hands[side])if (h.t <= t) cur = h.shape;
|
|
149
|
+
if (cur) hands[side] = cur;
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
pose,
|
|
153
|
+
hands,
|
|
154
|
+
lift: clip.lift ? sampleTrack(clip.lift, t)[0] : 0
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/** Poids 0..1 d'un clip à l'instant `time` (fondu d'entrée et de sortie). */ export function clipWeight(clip, time, stopping, stopTime) {
|
|
158
|
+
const fin = clip.fadeIn > 0 ? Math.min(1, time / clip.fadeIn) : 1;
|
|
159
|
+
let fout = 1;
|
|
160
|
+
if (stopping) fout = clip.fadeOut > 0 ? Math.max(0, 1 - (time - stopTime) / clip.fadeOut) : 0;
|
|
161
|
+
else if (!clip.loop && clip.fadeOut > 0) fout = Math.min(1, (clip.duration - time) / clip.fadeOut);
|
|
162
|
+
return smooth(Math.max(0, Math.min(fin, fout)));
|
|
163
|
+
}
|
|
164
|
+
/** Vérifie qu'un clip ne sort jamais des butées (utile dans les tests). */ export function clipWithinLimits(def) {
|
|
165
|
+
const bad = [];
|
|
166
|
+
for (const k of def.keys){
|
|
167
|
+
for (const [n, v] of Object.entries(k.pose ?? {})){
|
|
168
|
+
const { min, max } = JOINTS[n];
|
|
169
|
+
for(let a = 0; a < 3; a++){
|
|
170
|
+
if (v[a] < min[a] - 1e-6 || v[a] > max[a] + 1e-6) bad.push({
|
|
171
|
+
joint: n,
|
|
172
|
+
t: k.t,
|
|
173
|
+
value: v
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return bad;
|
|
179
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { type ClipDef } from './clips.js';
|
|
2
|
+
import { type GestureName } from './gestures.js';
|
|
3
|
+
import { type HandShape, type HandShapeName } from './hands.js';
|
|
4
|
+
import { type Pose, type Side, type Vec3 } from './skeleton.js';
|
|
5
|
+
/** Ce que fait l'assistant en ce moment — pilote les comportements automatiques. */
|
|
6
|
+
export type AssistantState = 'idle' | 'listening' | 'thinking' | 'speaking';
|
|
7
|
+
export interface PlayOptions {
|
|
8
|
+
/** Bras à utiliser pour les gestes à un seul bras. Défaut : gauche (côté +x). */
|
|
9
|
+
side?: Side;
|
|
10
|
+
/** Rejouer en boucle jusqu'à `stopGesture()`. */
|
|
11
|
+
loop?: boolean;
|
|
12
|
+
/** Vitesse de lecture (1 = normale). */
|
|
13
|
+
speed?: number;
|
|
14
|
+
}
|
|
15
|
+
interface ReachState {
|
|
16
|
+
/** Dernière cible connue (conservée pendant le fondu de relâchement pour éviter un saut). */
|
|
17
|
+
target: Vec3 | null;
|
|
18
|
+
/** Poids de l'IK, 0..1, lissé. */
|
|
19
|
+
weight: number;
|
|
20
|
+
/** La main doit-elle atteindre la cible en ce moment ? */
|
|
21
|
+
active: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface ControllerOptions {
|
|
24
|
+
/** Graine du générateur aléatoire (comportements spontanés). Utile pour des tests déterministes. */
|
|
25
|
+
seed?: number;
|
|
26
|
+
/** Comportements spontanés (clignement, regard, gestes en parlant…). Défaut `true`. */
|
|
27
|
+
autoBehaviors?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Cerveau du robot : décide, à chaque image, de l'angle de chaque articulation.
|
|
31
|
+
*
|
|
32
|
+
* Il ne dépend NI de React NI de WebGL : il lit des commandes (jouer un geste, marcher,
|
|
33
|
+
* regarder, changer d'état) et écrit un résultat dans `pose` (angles lissés) et `root`
|
|
34
|
+
* (position et cap du robot). Le rendu (`Robot.tsx`) n'a qu'à recopier ces valeurs.
|
|
35
|
+
*
|
|
36
|
+
* Ordre de calcul à chaque image (le dernier gagne sur les mêmes articulations) :
|
|
37
|
+
* 1. pose de repos
|
|
38
|
+
* 2. attitude de l'état (écoute : léger penché, etc.)
|
|
39
|
+
* 3. démarche, si le robot marche
|
|
40
|
+
* 4. clips de gestes en cours (avec fondu d'entrée / sortie)
|
|
41
|
+
* 5. couches additives : respiration, balancement, regard
|
|
42
|
+
* 6. butées de chaque articulation, puis lissage exponentiel
|
|
43
|
+
* 7. doigts (forme de main lissée)
|
|
44
|
+
*/
|
|
45
|
+
export declare class RobotController {
|
|
46
|
+
/** Angles lissés de toutes les articulations, prêts à être appliqués au rendu. */
|
|
47
|
+
readonly pose: Pose;
|
|
48
|
+
/** Position (m) et cap (rad) du robot sur le sol ; `lift` = hauteur de saut (m). */
|
|
49
|
+
readonly root: {
|
|
50
|
+
x: number;
|
|
51
|
+
z: number;
|
|
52
|
+
yaw: number;
|
|
53
|
+
lift: number;
|
|
54
|
+
};
|
|
55
|
+
/** Fermeture des paupières, 0 (ouvert) à 1 (fermé). */
|
|
56
|
+
blink: number;
|
|
57
|
+
/** Niveau sonore de la voix, 0..1 : amplifie les mouvements de tête quand l'assistant parle. */
|
|
58
|
+
speechLevel: number;
|
|
59
|
+
/** Cibles d'atteinte des mains (repère du robot, mètres). Résolues par IK dans le rendu. */
|
|
60
|
+
readonly reach: Record<Side, ReachState>;
|
|
61
|
+
private state;
|
|
62
|
+
private time;
|
|
63
|
+
private rand;
|
|
64
|
+
private autoBehaviors;
|
|
65
|
+
private players;
|
|
66
|
+
private nextId;
|
|
67
|
+
private target;
|
|
68
|
+
private gazeManual;
|
|
69
|
+
private gazeGoal;
|
|
70
|
+
private gaze;
|
|
71
|
+
private nextGlanceAt;
|
|
72
|
+
private nextBlinkAt;
|
|
73
|
+
private blinkStart;
|
|
74
|
+
private nextTalkAt;
|
|
75
|
+
private nextNodAt;
|
|
76
|
+
private walkTarget;
|
|
77
|
+
private walkBlend;
|
|
78
|
+
private walkPhase;
|
|
79
|
+
private speed;
|
|
80
|
+
private yawRate;
|
|
81
|
+
private handManual;
|
|
82
|
+
private handGoal;
|
|
83
|
+
private hand;
|
|
84
|
+
constructor(options?: ControllerOptions);
|
|
85
|
+
/** Joue un geste de la bibliothèque. La promesse se résout quand il est terminé (ou interrompu). */
|
|
86
|
+
play(name: GestureName, options?: PlayOptions): Promise<void>;
|
|
87
|
+
/** Joue un clip personnalisé (voir `ClipDef`). */
|
|
88
|
+
playClip(def: ClipDef, options?: PlayOptions): Promise<void>;
|
|
89
|
+
/** Arrête les gestes en cours (tous, ou seulement `name`) avec un fondu. */
|
|
90
|
+
stopGesture(name?: string): void;
|
|
91
|
+
get isGesturing(): boolean;
|
|
92
|
+
setState(state: AssistantState): void;
|
|
93
|
+
getState(): AssistantState;
|
|
94
|
+
/**
|
|
95
|
+
* Oriente le regard (radians, relatif au corps) : `yaw` > 0 vers la gauche du robot (+x),
|
|
96
|
+
* `pitch` > 0 vers le haut. `null` rend la main aux regards spontanés.
|
|
97
|
+
*/
|
|
98
|
+
setGaze(gaze: {
|
|
99
|
+
yaw: number;
|
|
100
|
+
pitch: number;
|
|
101
|
+
} | null): void;
|
|
102
|
+
/** Marche jusqu'à (x, z) en mètres. Résolu à l'arrivée ; une nouvelle commande interrompt la précédente. */
|
|
103
|
+
walkTo(x: number, z: number, options?: {
|
|
104
|
+
arriveYaw?: number;
|
|
105
|
+
}): Promise<void>;
|
|
106
|
+
stopWalking(): void;
|
|
107
|
+
get isWalking(): boolean;
|
|
108
|
+
/** Tourne sur place vers le cap `yaw` (rad). */
|
|
109
|
+
turnTo(yaw: number): Promise<void>;
|
|
110
|
+
/** Tend la main `side` vers un point (repère du robot, m), `null` pour relâcher. */
|
|
111
|
+
reachAt(side: Side, target: Vec3 | null): void;
|
|
112
|
+
/** Convertit un point de la scène (x, y, z) en repère du robot (origine aux pieds, +z devant lui). */
|
|
113
|
+
toRobotFrame(x: number, y: number, z: number): Vec3;
|
|
114
|
+
/** Tend le bras `side` vers un point (repère du robot) et pointe l'index ; `null` relâche. */
|
|
115
|
+
pointAt(side: Side, target: Vec3 | null): void;
|
|
116
|
+
/** Force la forme d'une main ; `null` rend la main aux gestes. */
|
|
117
|
+
setHand(side: Side, shape: HandShapeName | HandShape | null): void;
|
|
118
|
+
update(rawDt: number): void;
|
|
119
|
+
private start;
|
|
120
|
+
private beginStop;
|
|
121
|
+
private advancePlayers;
|
|
122
|
+
private runAutoBehaviors;
|
|
123
|
+
private updateBlink;
|
|
124
|
+
private applyStateStance;
|
|
125
|
+
private updateLocomotion;
|
|
126
|
+
private finishWalk;
|
|
127
|
+
private walkBob;
|
|
128
|
+
private applyGait;
|
|
129
|
+
private applyAdditive;
|
|
130
|
+
private updateHands;
|
|
131
|
+
}
|
|
132
|
+
export {};
|
|
133
|
+
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/assistant/robot/controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,OAAO,EAEb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAkD,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EAAmD,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AACjH,OAAO,EAML,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,IAAI,EACV,MAAM,eAAe,CAAC;AAEvB,oFAAoF;AACpF,MAAM,MAAM,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