@nuralogix.ai/web-measurement-embedded-app 0.1.0-beta.6 → 0.1.0-beta.8

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.
@@ -12,14 +12,9 @@
12
12
  "NO_DEVICES_FOUND": "Keine Kamera-Geräte gefunden",
13
13
  "PLEASE_WAIT": "Bitte warten, die Messung beginnt in Kürze…",
14
14
  "SELECT_CAMERA": "Wählen Sie eine Kamera, um zu beginnen",
15
- "STARTING": "Wird gestartet...",
16
- "START_CAMERA": "Kamera starten",
17
- "START_MEASUREMENT": "Messung starten",
18
- "STOP_CAMERA": "Kamera stoppen",
19
- "STOP_MEASUREMENT": "Messung stoppen",
20
15
  "TILT_YOUR_FACE_LEFT": "Neigen Sie Ihr Gesicht nach links",
21
16
  "TILT_YOUR_FACE_RIGHT": "Neigen Sie Ihr Gesicht nach rechts",
22
17
  "TURN_LEFT": "Drehen Sie den Kopf nach links",
23
18
  "TURN_RIGHT": "Drehen Sie den Kopf nach rechts",
24
19
  "WAITING_FOR_RESULTS": "Warten auf Ergebnisse"
25
- }
20
+ }
@@ -12,14 +12,9 @@
12
12
  "NO_DEVICES_FOUND": "No camera devices found",
13
13
  "PLEASE_WAIT": "Please wait, measurement will start soon…",
14
14
  "SELECT_CAMERA": "Select a camera to begin",
15
- "STARTING": "Starting...",
16
- "START_CAMERA": "Start camera",
17
- "START_MEASUREMENT": "Start measurement",
18
- "STOP_CAMERA": "Stop camera",
19
- "STOP_MEASUREMENT": "Stop measurement",
20
15
  "TILT_YOUR_FACE_LEFT": "Tilt your face left",
21
16
  "TILT_YOUR_FACE_RIGHT": "Tilt your face right",
22
17
  "TURN_LEFT": "Turn left",
23
18
  "TURN_RIGHT": "Turn right",
24
19
  "WAITING_FOR_RESULTS": "Waiting for results"
25
- }
20
+ }
@@ -12,14 +12,9 @@
12
12
  "NO_DEVICES_FOUND": "No se encontraron cámaras",
13
13
  "PLEASE_WAIT": "Por favor, espere, la medición comenzará pronto…",
14
14
  "SELECT_CAMERA": "Para comenzar, seleccione una cámara",
15
- "STARTING": "Iniciando...",
16
- "START_CAMERA": "Iniciar la cámara",
17
- "START_MEASUREMENT": "Comenzar medición",
18
- "STOP_CAMERA": "Detener cámara",
19
- "STOP_MEASUREMENT": "Detener medición",
20
15
  "TILT_YOUR_FACE_LEFT": "Incline el rostro hacia la izquierda",
21
16
  "TILT_YOUR_FACE_RIGHT": "Incline el rostro hacia la derecha",
22
17
  "TURN_LEFT": "Gire a la izquierda",
23
18
  "TURN_RIGHT": "Gire a la derecha",
24
19
  "WAITING_FOR_RESULTS": "Esperando resultados."
25
- }
20
+ }
@@ -12,14 +12,9 @@
12
12
  "NO_DEVICES_FOUND": "Aucun appareil détecté",
13
13
  "PLEASE_WAIT": "Veuillez patienter, la mesure va bientôt commencer…",
14
14
  "SELECT_CAMERA": "Sélectionner une caméra pour commencer",
15
- "STARTING": "Démarrage...",
16
- "START_CAMERA": "Démarrer la caméra",
17
- "START_MEASUREMENT": "Démarrer la mesure",
18
- "STOP_CAMERA": "Arrêter la caméra",
19
- "STOP_MEASUREMENT": "Arrêter la mesure",
20
15
  "TILT_YOUR_FACE_LEFT": "Inclinez votre visage vers la gauche",
21
16
  "TILT_YOUR_FACE_RIGHT": "Inclinez votre visage vers la droite",
22
17
  "TURN_LEFT": "Tournez la tête à gauche",
23
18
  "TURN_RIGHT": "Tournez la tête à droite",
24
19
  "WAITING_FOR_RESULTS": "Dans l'attente des résultats"
25
- }
20
+ }
@@ -12,14 +12,9 @@
12
12
  "NO_DEVICES_FOUND": "Nessuna fotocamera trovata",
13
13
  "PLEASE_WAIT": "Per favore, aspetta, la misurazione inizierà presto…",
14
14
  "SELECT_CAMERA": "Selezionare una fotocamera per iniziare",
15
- "STARTING": "Avvio in corso...",
16
- "START_CAMERA": "Avviare fotocamera",
17
- "START_MEASUREMENT": "Inizia misurazione",
18
- "STOP_CAMERA": "Ferma fotocamera",
19
- "STOP_MEASUREMENT": "Interrompi misurazione",
20
15
  "TILT_YOUR_FACE_LEFT": "Inclina il viso a sinistra",
21
16
  "TILT_YOUR_FACE_RIGHT": "Inclina il viso a destra",
22
17
  "TURN_LEFT": "Gira a sinistra",
23
18
  "TURN_RIGHT": "Gira a destra",
24
19
  "WAITING_FOR_RESULTS": "In attesa dei risultati"
25
- }
20
+ }
@@ -12,14 +12,9 @@
12
12
  "NO_DEVICES_FOUND": "利用可能なカメラデバイスが見つかりません",
13
13
  "PLEASE_WAIT": "お待ちください、測定がまもなく開始されます…",
14
14
  "SELECT_CAMERA": "カメラを選択して開始",
15
- "STARTING": "開始中...",
16
- "START_CAMERA": "カメラを起動",
17
- "START_MEASUREMENT": "測定を開始",
18
- "STOP_CAMERA": "カメラを停止",
19
- "STOP_MEASUREMENT": "測定を停止",
20
15
  "TILT_YOUR_FACE_LEFT": "顔を左に傾けてください",
21
16
  "TILT_YOUR_FACE_RIGHT": "顔を右に傾けてください",
22
17
  "TURN_LEFT": "左を向いてください",
23
18
  "TURN_RIGHT": "右を向いてください",
24
19
  "WAITING_FOR_RESULTS": "結果が出るまで待機しています"
25
- }
20
+ }
@@ -12,14 +12,9 @@
12
12
  "NO_DEVICES_FOUND": "Nenhum dispositivo de câmera encontrado",
13
13
  "PLEASE_WAIT": "Por favor, aguarde, a medição começará em breve…",
14
14
  "SELECT_CAMERA": "Selecione uma câmera para começar",
15
- "STARTING": "Iniciando...",
16
- "START_CAMERA": "Iniciar a câmera",
17
- "START_MEASUREMENT": "Começar medição",
18
- "STOP_CAMERA": "Parar câmera",
19
- "STOP_MEASUREMENT": "Parar medição",
20
15
  "TILT_YOUR_FACE_LEFT": "Incline o rosto para a esquerda",
21
16
  "TILT_YOUR_FACE_RIGHT": "Incline o rosto para a direita",
22
17
  "TURN_LEFT": "Vire à esquerda",
23
18
  "TURN_RIGHT": "Vire à direita",
24
19
  "WAITING_FOR_RESULTS": "Aguardando resultados"
25
- }
20
+ }
@@ -12,14 +12,9 @@
12
12
  "NO_DEVICES_FOUND": "Nenhum dispositivo de câmara encontrado",
13
13
  "PLEASE_WAIT": "Por favor, espere, a medição começará em breve…",
14
14
  "SELECT_CAMERA": "Selecionar câmara para começar",
15
- "STARTING": "Iniciando...",
16
- "START_CAMERA": "Iniciar câmara",
17
- "START_MEASUREMENT": "Iniciar medição",
18
- "STOP_CAMERA": "Parar câmera",
19
- "STOP_MEASUREMENT": "Parar medição",
20
15
  "TILT_YOUR_FACE_LEFT": "Incline o rosto para a esquerda",
21
16
  "TILT_YOUR_FACE_RIGHT": "Incline o rosto para a direita",
22
17
  "TURN_LEFT": "Vire à esquerda",
23
18
  "TURN_RIGHT": "Vire à direita",
24
19
  "WAITING_FOR_RESULTS": "À espera de resultados"
25
- }
20
+ }
@@ -12,14 +12,9 @@
12
12
  "NO_DEVICES_FOUND": "未找到可用的摄像头设备",
13
13
  "PLEASE_WAIT": "请稍候,测量将很快开始。。。",
14
14
  "SELECT_CAMERA": "选择摄像头",
15
- "STARTING": "正在开始...",
16
- "START_CAMERA": "开启摄像头",
17
- "START_MEASUREMENT": "开始测量",
18
- "STOP_CAMERA": "停止摄像头",
19
- "STOP_MEASUREMENT": "停止测量",
20
15
  "TILT_YOUR_FACE_LEFT": "请将脸部向左倾斜",
21
16
  "TILT_YOUR_FACE_RIGHT": "请将脸部向右倾斜",
22
17
  "TURN_LEFT": "向左转头",
23
18
  "TURN_RIGHT": "向右转头",
24
19
  "WAITING_FOR_RESULTS": "等待结果"
25
- }
20
+ }
package/dist/stylex.css CHANGED
@@ -11,6 +11,18 @@
11
11
  border: 1px solid #dee2e6;
12
12
  }
13
13
 
14
+ .border-xfj9a5l {
15
+ border: 1px solid #0000;
16
+ }
17
+
18
+ .border-xuy8v58 {
19
+ border: 2px solid #333;
20
+ }
21
+
22
+ .border-xlqlr9h {
23
+ border: 2px solid #ffffffb3;
24
+ }
25
+
14
26
  .border-x1gs6z28 {
15
27
  border: none;
16
28
  }
@@ -27,14 +39,18 @@
27
39
  margin: 0;
28
40
  }
29
41
 
30
- .margin-x1bpp3o7 {
31
- margin: auto;
42
+ .padding-xu8om6g {
43
+ padding: .5rem .75rem;
32
44
  }
33
45
 
34
46
  .padding-xxm6lfi {
35
47
  padding: .75rem 0 1rem;
36
48
  }
37
49
 
50
+ .padding-x1717udv {
51
+ padding: 0;
52
+ }
53
+
38
54
  .padding-xc7ga6q {
39
55
  padding: 12px;
40
56
  }
@@ -53,10 +69,18 @@
53
69
  }
54
70
 
55
71
  @layer priority2 {
72
+ .borderColor-x1gp4mws {
73
+ border-color: #ffffffb3;
74
+ }
75
+
56
76
  .borderRadius-x12oqio5 {
57
77
  border-radius: 4px;
58
78
  }
59
79
 
80
+ .borderRadius-x16rqkct {
81
+ border-radius: 50%;
82
+ }
83
+
60
84
  .gap-xvh977a {
61
85
  gap: .25rem;
62
86
  }
@@ -65,6 +89,10 @@
65
89
  gap: .5rem;
66
90
  }
67
91
 
92
+ .outline-x1a2a7pz {
93
+ outline: none;
94
+ }
95
+
68
96
  .overflow-xysyzu8 {
69
97
  overflow: auto;
70
98
  }
@@ -72,6 +100,46 @@
72
100
  .overflow-xb3r6kr {
73
101
  overflow: hidden;
74
102
  }
103
+
104
+ .transition-x169l3ba {
105
+ transition: all .2s;
106
+ }
107
+
108
+ .transition-x5gkzjs {
109
+ transition: background-color .2s;
110
+ }
111
+
112
+ .borderColor-xowlo53:active {
113
+ border-color: #007aff;
114
+ }
115
+
116
+ .borderColor-x117on2v:active {
117
+ border-color: #5ac8fa;
118
+ }
119
+
120
+ @media (hover: hover) {
121
+ .borderColor-xoy28b.borderColor-xoy28b:hover {
122
+ border-color: #007aff;
123
+ }
124
+
125
+ .borderColor-xs52nbu.borderColor-xs52nbu:hover {
126
+ border-color: #5ac8fa;
127
+ }
128
+
129
+ .borderColor-x1g2krxu.borderColor-x1g2krxu:hover {
130
+ border-color: #00000059;
131
+ }
132
+
133
+ .borderColor-x19yqvnk.borderColor-x19yqvnk:hover {
134
+ border-color: #ffffffbf;
135
+ }
136
+ }
137
+
138
+ @media (hover: none) {
139
+ .transition-x1r1yelf.transition-x1r1yelf:active {
140
+ transition: all .1s;
141
+ }
142
+ }
75
143
  }
76
144
 
77
145
  @layer priority3 {
@@ -87,6 +155,22 @@
87
155
  background-color: #f8f9fa;
88
156
  }
89
157
 
158
+ .backgroundColor-xas4zb2 {
159
+ background-color: #0000000d;
160
+ }
161
+
162
+ .backgroundColor-x1si8nl4 {
163
+ background-color: #0000001a;
164
+ }
165
+
166
+ .backgroundColor-x3tctdg {
167
+ background-color: #ffffff1f;
168
+ }
169
+
170
+ .backgroundColor-x1q9rc7u {
171
+ background-color: #ffffff40;
172
+ }
173
+
90
174
  .backgroundColor-x12peec7 {
91
175
  background-color: #fff;
92
176
  }
@@ -95,6 +179,10 @@
95
179
  box-sizing: border-box;
96
180
  }
97
181
 
182
+ .color-x1525slw {
183
+ color: #333;
184
+ }
185
+
98
186
  .color-x36lisw {
99
187
  color: #6c757d;
100
188
  }
@@ -111,6 +199,10 @@
111
199
  container-type: size;
112
200
  }
113
201
 
202
+ .cursor-x1h6gzvc {
203
+ cursor: not-allowed;
204
+ }
205
+
114
206
  .cursor-x1ypdohk {
115
207
  cursor: pointer;
116
208
  }
@@ -127,6 +219,10 @@
127
219
  flex-grow: 1;
128
220
  }
129
221
 
222
+ .flexShrink-x2lah0s {
223
+ flex-shrink: 0;
224
+ }
225
+
130
226
  .fontFamily-x6n8kwa {
131
227
  font-family: system-ui, -apple-system, sans-serif;
132
228
  }
@@ -143,6 +239,14 @@
143
239
  justify-content: center;
144
240
  }
145
241
 
242
+ .opacity-xbyyjgo {
243
+ opacity: .5;
244
+ }
245
+
246
+ .pointerEvents-x47corl {
247
+ pointer-events: none;
248
+ }
249
+
146
250
  .position-x10l6tqk {
147
251
  position: absolute;
148
252
  }
@@ -159,6 +263,14 @@
159
263
  text-align: left;
160
264
  }
161
265
 
266
+ .transform-x1cb1t30 {
267
+ transform: translateY(-50%);
268
+ }
269
+
270
+ .userSelect-x87ps6o {
271
+ user-select: none;
272
+ }
273
+
162
274
  .visibility-xlshs6z {
163
275
  visibility: hidden;
164
276
  }
@@ -170,6 +282,46 @@
170
282
  .zIndex-x1355qak {
171
283
  z-index: 20;
172
284
  }
285
+
286
+ .backgroundColor-ximwwh7:active {
287
+ background-color: #007aff33;
288
+ }
289
+
290
+ .backgroundColor-x1qmpg0c:active {
291
+ background-color: #5ac8fa40;
292
+ }
293
+
294
+ .transform-xvruv2t:active {
295
+ transform: scale(.9);
296
+ }
297
+
298
+ @media (hover: hover) {
299
+ .backgroundColor-xzuoiqm.backgroundColor-xzuoiqm:hover {
300
+ background-color: #0003;
301
+ }
302
+
303
+ .backgroundColor-x2oa872.backgroundColor-x2oa872:hover {
304
+ background-color: #007aff1a;
305
+ }
306
+
307
+ .backgroundColor-x1i6p5e5.backgroundColor-x1i6p5e5:hover {
308
+ background-color: #ffffff4d;
309
+ }
310
+
311
+ .backgroundColor-x1bnmw9t.backgroundColor-x1bnmw9t:hover {
312
+ background-color: #5ac8fa2e;
313
+ }
314
+
315
+ .transform-xje0exv.transform-xje0exv:hover {
316
+ transform: scale(1.05);
317
+ }
318
+ }
319
+
320
+ @media (hover: none) {
321
+ .transform-x26m0zi.transform-x26m0zi:active {
322
+ transform: scale(.85);
323
+ }
324
+ }
173
325
  }
174
326
 
175
327
  @layer priority4 {
@@ -177,6 +329,18 @@
177
329
  height: 100%;
178
330
  }
179
331
 
332
+ .height-xlup9mm {
333
+ height: 16px;
334
+ }
335
+
336
+ .height-x10w6t97 {
337
+ height: 32px;
338
+ }
339
+
340
+ .height-x1peatla {
341
+ height: 64px;
342
+ }
343
+
180
344
  .marginBottom-x1yztbdb {
181
345
  margin-bottom: 16px;
182
346
  }
@@ -189,10 +353,6 @@
189
353
  margin-bottom: 8px;
190
354
  }
191
355
 
192
- .marginTop-x1tbvfm1 {
193
- margin-top: .25rem;
194
- }
195
-
196
356
  .marginTop-x1mjqqkp {
197
357
  margin-top: .5rem;
198
358
  }
@@ -221,12 +381,28 @@
221
381
  min-height: 3rem;
222
382
  }
223
383
 
384
+ .right-x1suesbl {
385
+ right: .75rem;
386
+ }
387
+
388
+ .top-xwa60dl {
389
+ top: 50%;
390
+ }
391
+
224
392
  .width-xh8yej3 {
225
393
  width: 100%;
226
394
  }
227
395
 
228
- .width-x65xoit {
229
- width: 70%;
396
+ .width-x1kky2od {
397
+ width: 16px;
398
+ }
399
+
400
+ .width-x1td3qas {
401
+ width: 32px;
402
+ }
403
+
404
+ .width-x1fu8urw {
405
+ width: 64px;
230
406
  }
231
407
 
232
408
  @container (aspect-ratio >= 1) {
package/lib/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var Lt="0.1.0-beta.6";const U={RESULTS:"results",ERROR:"error",APPEVENT:"appEvent",CANCELLED:"cancelled",DESTROYED:"destroyed",LOGS:"logs"};var Ye=(t=>(t.measurement="Measurement",t.collector="Collector",t.camera="Camera",t.app="App",t))(Ye||{});const N={INFO:"INFO",WARN:"WARN",ERROR:"ERROR"},L={CAMERA_STARTED:"CAMERA_STARTED",APP_LOADED:"APP_LOADED",MEASUREMENT_PREPARED:"MEASUREMENT_PREPARED",ASSETS_DOWNLOADED:"ASSETS_DOWNLOADED",MEASUREMENT_STARTED:"MEASUREMENT_STARTED",MEASUREMENT_COMPLETED:"MEASUREMENT_COMPLETED",CAMERA_PERMISSION_GRANTED:"CAMERA_PERMISSION_GRANTED",INTERMEDIATE_RESULTS:"INTERMEDIATE_RESULTS",RESULTS_RECEIVED:"RESULTS_RECEIVED",MEASUREMENT_CANCELED:"MEASUREMENT_CANCELED",CONSTRAINT_VIOLATION:"CONSTRAINT_VIOLATION",PAGE_UNLOADED:"PAGE_UNLOADED",PAGE_VISIBILITY_CHANGE:"PAGE_VISIBILITY_CHANGE"},Dt={CAMERA_STARTED:{event:L.CAMERA_STARTED,level:N.INFO},APP_LOADED:{event:L.APP_LOADED,level:N.INFO},MEASUREMENT_PREPARED:{event:L.MEASUREMENT_PREPARED,level:N.INFO},ASSETS_DOWNLOADED:{event:L.ASSETS_DOWNLOADED,level:N.INFO},MEASUREMENT_STARTED:{event:L.MEASUREMENT_STARTED,level:N.INFO},MEASUREMENT_COMPLETED:{event:L.MEASUREMENT_COMPLETED,level:N.INFO},CAMERA_PERMISSION_GRANTED:{event:L.CAMERA_PERMISSION_GRANTED,level:N.INFO},INTERMEDIATE_RESULTS:{event:L.INTERMEDIATE_RESULTS,level:N.INFO},RESULTS_RECEIVED:{event:L.RESULTS_RECEIVED,level:N.INFO},MEASUREMENT_CANCELED:{event:L.MEASUREMENT_CANCELED,level:N.WARN},CONSTRAINT_VIOLATION:{event:L.CONSTRAINT_VIOLATION,level:N.ERROR},PAGE_UNLOADED:{event:L.PAGE_UNLOADED,level:N.INFO},PAGE_VISIBILITY_CHANGE:{event:L.PAGE_VISIBILITY_CHANGE,level:N.INFO}},ne={DESTROY:"destroy",CANCEL:"cancel",SET_THEME:"setTheme",SET_LANGUAGE:"setLanguage",GET_LOGS:"getLogs"};var Je=(t=>(t.CAMERA_PERMISSION_DENIED="CAMERA_PERMISSION_DENIED",t.WORKER_ERROR="WORKER_ERROR",t.PROFILE_INFO_NOT_SET="PROFILE_INFO_NOT_SET",t.NO_DEVICES_FOUND="NO_DEVICES_FOUND",t.PAGE_NOT_VISIBLE="PAGE_NOT_VISIBLE",t.CAMERA_START_FAILED="CAMERA_START_FAILED",t.MEASUREMENT_LOW_SNR="MEASUREMENT_LOW_SNR",t.COLLECTOR="COLLECTOR",t.WEBSOCKET_DISCONNECTED="WEBSOCKET_DISCONNECTED",t.MEASUREMENT_PREPARE_FAILED="MEASUREMENT_PREPARE_FAILED",t))(Je||{}),Xe="0.1.0-beta.2",J=(t=>(t.DELETE="DELETE",t.GET="GET",t.PATCH="PATCH",t.POST="POST",t.PUT="PUT",t.CONNECT="CONNECT",t))(J||{}),H=(t=>(t.ON_BEFORE_REST_CALL_ERROR="ON_BEFORE_REST_CALL_ERROR",t))(H||{});const ze=typeof DedicatedWorkerGlobalScope<"u",_e=async({baseUrl:t,urlFragment:e,method:i,headers:a,data:c},d)=>{const n=`${t}/${e}`;let r={Code:"",Message:""};try{const u=await fetch(n,{method:i,cache:"no-store",credentials:"include",headers:a,...c!=null&&{body:JSON.stringify(c)}}),h=u.headers.get("content-type"),p=u.status.toString();r={Code:"UNSUPPORTED_RESPONSE_CONTENT_TYPE",Message:"UNSUPPORTED_RESPONSE_CONTENT_TYPE"},p==="503"&&(r={Code:"SERVICE_UNAVAILABLE",Message:"Service unavailable"}),p==="429"&&(r={Code:"TOO_MANY_REQUESTS",Message:"Too many requests"}),h!=null&&(h.startsWith("application/json;")&&(r=await u.json()),h.startsWith("text/plain;")&&(r={data:await u.text()}));let S=u.headers;if(ze){const C={};u.headers.forEach((k,O)=>{C[O]=k}),S=C}try{d(p,p==="200"?void 0:r)}catch(C){console.error("Error running onAfterRESTCall callback",C)}return{status:p,headers:S,body:r}}catch(u){return u instanceof SyntaxError?r={Code:"SYNTAX_ERROR",Message:"SYNTAX_ERROR"}:r={Code:"UNEXPECTED_ERROR",Message:"UNEXPECTED_ERROR"},{status:"UNKNOWN",headers:ze?{}:new Headers,body:r}}},ge=()=>new Headers({"Content-Type":"application/json"});var It=Object.defineProperty,xt=(t,e,i)=>e in t?It(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ft=(t,e,i)=>xt(t,e+"",i);class Me{constructor(e){Ft(this,"parent"),this.parent=e}async onBeforeRESTCall(){try{return this.parent.onBeforeRESTCall(),{Code:"SUCCESS",Message:"SUCCESS"}}catch{return{Code:H.ON_BEFORE_REST_CALL_ERROR,Message:H.ON_BEFORE_REST_CALL_ERROR}}}getDefaults(e){return{baseUrl:JSON.parse(this.parent.getUrl()).http.slice(0,-1),method:J[e],headers:ge()}}getHeaderWithDeviceToken(){const e=ge();return e.set("Authorization",`Bearer ${this.parent.getSession().deviceToken}`),e}getHeaderWithUserToken(){const e=ge();return e.set("Authorization",`Bearer ${this.parent.getSession().userToken}`),e}getHeaderWithSessionEnabled(){const e=ge();return e.set("x-nura-session","true"),e}}class Mt extends Me{async create(e,i){const{Code:a,Message:c}=await this.onBeforeRESTCall();if(a===H.ON_BEFORE_REST_CALL_ERROR)return{status:a,body:{Code:a,Message:c},headers:new Headers};const{status:d,body:n,headers:r}=await _e({...this.getDefaults(J.POST),headers:i==="device"?this.getHeaderWithDeviceToken():this.getHeaderWithUserToken(),urlFragment:"measurements",data:e},this.parent.onAfterRESTCall);return d==="200"&&this.parent.setSession({lastMeasurementId:n.ID}),{status:d,body:n,headers:r}}}class Pt extends Me{async retrieveSdkConfigData(e,i){const{Code:a,Message:c}=await this.onBeforeRESTCall();if(a===H.ON_BEFORE_REST_CALL_ERROR)return{status:a,body:{Code:a,Message:c},headers:new Headers};const{status:d,body:n,headers:r}=await _e({...this.getDefaults(J.POST),headers:i==="device"?this.getHeaderWithDeviceToken():this.getHeaderWithUserToken(),urlFragment:"studies/sdkconfig",data:e},this.parent.onAfterRESTCall);return d==="200"&&this.parent.setSession({studyCfgData:n.ConfigFile,studyCfgHash:n.MD5Hash}),{status:d,body:n,headers:r}}}class Wt extends Me{async renew(e,i){const{Code:a,Message:c}=await this.onBeforeRESTCall();if(a===H.ON_BEFORE_REST_CALL_ERROR)return{status:a,body:{Code:a,Message:c},headers:new Headers};const{status:d,body:n,headers:r}=await _e({...this.getDefaults(J.POST),headers:i==="device"?this.getHeaderWithDeviceToken():this.getHeaderWithUserToken(),urlFragment:"auths/renew",data:e},this.parent.onAfterRESTCall);if(d==="200"){const u=n.Token,h=n.RefreshToken,p={...i==="user"&&{userToken:u,userRefreshToken:h},...i==="device"&&{deviceToken:u,deviceRefreshToken:h}};this.parent.setSession(p)}return{status:d,body:n,headers:r}}async validate(e){const{Code:i,Message:a}=await this.onBeforeRESTCall();return i===H.ON_BEFORE_REST_CALL_ERROR?{status:i,body:{Code:i,Message:a},headers:new Headers}:await _e({...this.getDefaults(J.GET),headers:e==="device"?this.getHeaderWithDeviceToken():this.getHeaderWithUserToken(),urlFragment:"auth/v1/validate"},this.parent.onAfterRESTCall)}}var Ut=Object.defineProperty,qe=t=>{throw TypeError(t)},$t=(t,e,i)=>e in t?Ut(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Pe=(t,e,i)=>$t(t,typeof e!="symbol"?e+"":e,i),Ze=(t,e,i)=>e.has(t)||qe("Cannot "+i),We=(t,e,i)=>(Ze(t,e,"read from private field"),i?i.call(t):e.get(t)),Qe=(t,e,i)=>e.has(t)?qe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),we=(t,e,i,a)=>(Ze(t,e,"write to private field"),e.set(t,i),i),oe,X;class Bt{constructor(e){Qe(this,oe,{http:new URL("https://api.deepaffex.ai")}),Qe(this,X),Pe(this,"onBeforeRESTCall"),Pe(this,"onAfterRESTCall"),Pe(this,"http"),we(this,X,{deviceToken:"",deviceRefreshToken:"",userToken:"",userRefreshToken:"",deviceId:"",roleId:"",userId:"",selectedStudy:"",lastMeasurementId:"",studyCfgHash:"",studyCfgData:""}),this.http={measurements:new Mt(this),studies:new Pt(this),auths:new Wt(this)},this.onBeforeRESTCall=e?.onBeforeRESTCall?e.onBeforeRESTCall:()=>{},this.onAfterRESTCall=e?.onAfterRESTCall?e.onAfterRESTCall:()=>{},e?.url!=null&&we(this,oe,e.url)}static new(e){return new this(e??void 0)}getUrl(){return JSON.stringify(We(this,oe))}setUrl(e){we(this,oe,{http:new URL(e)})}getSession(){return We(this,X)}setSession(e){const i=["deviceToken","deviceRefreshToken","userToken","userRefreshToken","deviceId","userId","roleId","selectedStudy","lastMeasurementId","studyCfgHash","studyCfgData"];Object.keys(e).every(d=>i.includes(d)&&typeof e[d]=="string")&&we(this,X,{...We(this,X),...e})}}oe=new WeakMap,X=new WeakMap;const Gt=t=>Bt.new(t);var Ht=Object.defineProperty,et=t=>{throw TypeError(t)},Vt=(t,e,i)=>e in t?Ht(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Kt=(t,e,i)=>Vt(t,e+"",i),jt=(t,e,i)=>e.has(t)||et("Cannot "+i),Yt=(t,e,i)=>e.has(t)?et("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Ue=(t,e,i)=>(jt(t,e,"access private method"),i),le,$e,tt;let it=t=>new Int8Array(t);class Jt extends EventTarget{constructor(){super(...arguments),Yt(this,le),Kt(this,"canDecompress",!1)}static init(){return new this}dispatch(e,i){this.dispatchEvent(new CustomEvent(e,{detail:i}))}getBytesDownloadedEvent(e,i,a,c){return new CustomEvent("bytesDownloaded",{detail:{bytes:e,uncompressedSize:i,url:a,done:c}})}getBytesDownloadErrorEvent(e,i){return new CustomEvent("downloadedError",{detail:{url:e,error:i}})}decompressBrotli(e){const i=atob(e),a=new Uint8Array(i.length);for(let n=0;n<i.length;n++)a[n]=i.charCodeAt(n);const c=new Int8Array(a.length);for(let n=0;n<a.length;n++)c[n]=a[n]>=128?a[n]-256:a[n];return it(c).buffer}async fetchAsset(e,i,a,c,d){const n=i+a,r=e.find(h=>h.file===a).uncompressedSize,u=(h,p,S,C)=>Ue(this,le,$e).call(this,this.getBytesDownloadedEvent(h,p,S,C));try{const p=(await fetch(n)).body?.getReader();if(!p)throw new Error("Failed to get reader from response body.");let S=0;const C=new ReadableStream({async start(O){await P();async function P(){const{done:G,value:re}=await p.read();if(G){O.close(),u(S,r,n,!0);return}re&&(O.enqueue(re),S+=re.length,u(S,r,n,!1)),await P()}}}),k=new Response(C);if(c){const O=await k.json(),{base64EncodedValue:P}=O;if(d==="gzip"){await Ue(this,le,tt).call(this,P);return}return this.decompressBrotli(P)}else return await k.arrayBuffer()}catch(h){Ue(this,le,$e).call(this,this.getBytesDownloadErrorEvent(n,h))}}}le=new WeakSet,$e=function(t){this.dispatchEvent(t)},tt=async function(t){const e=Uint8Array.from(atob(t),h=>h.charCodeAt(0)),a=new Blob([e]).stream().pipeThrough(new DecompressionStream("gzip")),c=await new Response(a).arrayBuffer(),d=new TextDecoder().decode(new Uint8Array(c)),n=new Blob([d],{type:"application/javascript"}),r=URL.createObjectURL(n);it=(await import(r)).BrotliDecode,this.canDecompress=!0,URL.revokeObjectURL(r)};var Xt=Object.defineProperty,zt=(t,e,i)=>e in t?Xt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,st=(t,e,i)=>zt(t,typeof e!="symbol"?e+"":e,i);class qt{constructor(){st(this,"version",{webSDK:"",extractionLib:{version:"",sdkId:""},faceTracker:""}),st(this,"debugLogs",[])}appendLog(e){this.debugLogs.push(e)}transferLogs(){}generateHTMLTable(){return`
1
+ var Lt="0.1.0-beta.8";const U={RESULTS:"results",ERROR:"error",APPEVENT:"appEvent",CANCELLED:"cancelled",DESTROYED:"destroyed",LOGS:"logs"};var Ye=(t=>(t.measurement="Measurement",t.collector="Collector",t.camera="Camera",t.app="App",t))(Ye||{});const N={INFO:"INFO",WARN:"WARN",ERROR:"ERROR"},L={CAMERA_STARTED:"CAMERA_STARTED",APP_LOADED:"APP_LOADED",MEASUREMENT_PREPARED:"MEASUREMENT_PREPARED",ASSETS_DOWNLOADED:"ASSETS_DOWNLOADED",MEASUREMENT_STARTED:"MEASUREMENT_STARTED",MEASUREMENT_COMPLETED:"MEASUREMENT_COMPLETED",CAMERA_PERMISSION_GRANTED:"CAMERA_PERMISSION_GRANTED",INTERMEDIATE_RESULTS:"INTERMEDIATE_RESULTS",RESULTS_RECEIVED:"RESULTS_RECEIVED",MEASUREMENT_CANCELED:"MEASUREMENT_CANCELED",CONSTRAINT_VIOLATION:"CONSTRAINT_VIOLATION",PAGE_UNLOADED:"PAGE_UNLOADED",PAGE_VISIBILITY_CHANGE:"PAGE_VISIBILITY_CHANGE"},Dt={CAMERA_STARTED:{event:L.CAMERA_STARTED,level:N.INFO},APP_LOADED:{event:L.APP_LOADED,level:N.INFO},MEASUREMENT_PREPARED:{event:L.MEASUREMENT_PREPARED,level:N.INFO},ASSETS_DOWNLOADED:{event:L.ASSETS_DOWNLOADED,level:N.INFO},MEASUREMENT_STARTED:{event:L.MEASUREMENT_STARTED,level:N.INFO},MEASUREMENT_COMPLETED:{event:L.MEASUREMENT_COMPLETED,level:N.INFO},CAMERA_PERMISSION_GRANTED:{event:L.CAMERA_PERMISSION_GRANTED,level:N.INFO},INTERMEDIATE_RESULTS:{event:L.INTERMEDIATE_RESULTS,level:N.INFO},RESULTS_RECEIVED:{event:L.RESULTS_RECEIVED,level:N.INFO},MEASUREMENT_CANCELED:{event:L.MEASUREMENT_CANCELED,level:N.WARN},CONSTRAINT_VIOLATION:{event:L.CONSTRAINT_VIOLATION,level:N.ERROR},PAGE_UNLOADED:{event:L.PAGE_UNLOADED,level:N.INFO},PAGE_VISIBILITY_CHANGE:{event:L.PAGE_VISIBILITY_CHANGE,level:N.INFO}},ne={DESTROY:"destroy",CANCEL:"cancel",SET_THEME:"setTheme",SET_LANGUAGE:"setLanguage",GET_LOGS:"getLogs"};var Je=(t=>(t.CAMERA_PERMISSION_DENIED="CAMERA_PERMISSION_DENIED",t.WORKER_ERROR="WORKER_ERROR",t.PROFILE_INFO_NOT_SET="PROFILE_INFO_NOT_SET",t.NO_DEVICES_FOUND="NO_DEVICES_FOUND",t.PAGE_NOT_VISIBLE="PAGE_NOT_VISIBLE",t.CAMERA_START_FAILED="CAMERA_START_FAILED",t.MEASUREMENT_LOW_SNR="MEASUREMENT_LOW_SNR",t.COLLECTOR="COLLECTOR",t.WEBSOCKET_DISCONNECTED="WEBSOCKET_DISCONNECTED",t.MEASUREMENT_PREPARE_FAILED="MEASUREMENT_PREPARE_FAILED",t))(Je||{}),Xe="0.1.0-beta.2",J=(t=>(t.DELETE="DELETE",t.GET="GET",t.PATCH="PATCH",t.POST="POST",t.PUT="PUT",t.CONNECT="CONNECT",t))(J||{}),H=(t=>(t.ON_BEFORE_REST_CALL_ERROR="ON_BEFORE_REST_CALL_ERROR",t))(H||{});const ze=typeof DedicatedWorkerGlobalScope<"u",_e=async({baseUrl:t,urlFragment:e,method:i,headers:a,data:c},d)=>{const n=`${t}/${e}`;let r={Code:"",Message:""};try{const u=await fetch(n,{method:i,cache:"no-store",credentials:"include",headers:a,...c!=null&&{body:JSON.stringify(c)}}),h=u.headers.get("content-type"),p=u.status.toString();r={Code:"UNSUPPORTED_RESPONSE_CONTENT_TYPE",Message:"UNSUPPORTED_RESPONSE_CONTENT_TYPE"},p==="503"&&(r={Code:"SERVICE_UNAVAILABLE",Message:"Service unavailable"}),p==="429"&&(r={Code:"TOO_MANY_REQUESTS",Message:"Too many requests"}),h!=null&&(h.startsWith("application/json;")&&(r=await u.json()),h.startsWith("text/plain;")&&(r={data:await u.text()}));let S=u.headers;if(ze){const C={};u.headers.forEach((k,O)=>{C[O]=k}),S=C}try{d(p,p==="200"?void 0:r)}catch(C){console.error("Error running onAfterRESTCall callback",C)}return{status:p,headers:S,body:r}}catch(u){return u instanceof SyntaxError?r={Code:"SYNTAX_ERROR",Message:"SYNTAX_ERROR"}:r={Code:"UNEXPECTED_ERROR",Message:"UNEXPECTED_ERROR"},{status:"UNKNOWN",headers:ze?{}:new Headers,body:r}}},ge=()=>new Headers({"Content-Type":"application/json"});var It=Object.defineProperty,xt=(t,e,i)=>e in t?It(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ft=(t,e,i)=>xt(t,e+"",i);class Me{constructor(e){Ft(this,"parent"),this.parent=e}async onBeforeRESTCall(){try{return this.parent.onBeforeRESTCall(),{Code:"SUCCESS",Message:"SUCCESS"}}catch{return{Code:H.ON_BEFORE_REST_CALL_ERROR,Message:H.ON_BEFORE_REST_CALL_ERROR}}}getDefaults(e){return{baseUrl:JSON.parse(this.parent.getUrl()).http.slice(0,-1),method:J[e],headers:ge()}}getHeaderWithDeviceToken(){const e=ge();return e.set("Authorization",`Bearer ${this.parent.getSession().deviceToken}`),e}getHeaderWithUserToken(){const e=ge();return e.set("Authorization",`Bearer ${this.parent.getSession().userToken}`),e}getHeaderWithSessionEnabled(){const e=ge();return e.set("x-nura-session","true"),e}}class Mt extends Me{async create(e,i){const{Code:a,Message:c}=await this.onBeforeRESTCall();if(a===H.ON_BEFORE_REST_CALL_ERROR)return{status:a,body:{Code:a,Message:c},headers:new Headers};const{status:d,body:n,headers:r}=await _e({...this.getDefaults(J.POST),headers:i==="device"?this.getHeaderWithDeviceToken():this.getHeaderWithUserToken(),urlFragment:"measurements",data:e},this.parent.onAfterRESTCall);return d==="200"&&this.parent.setSession({lastMeasurementId:n.ID}),{status:d,body:n,headers:r}}}class Pt extends Me{async retrieveSdkConfigData(e,i){const{Code:a,Message:c}=await this.onBeforeRESTCall();if(a===H.ON_BEFORE_REST_CALL_ERROR)return{status:a,body:{Code:a,Message:c},headers:new Headers};const{status:d,body:n,headers:r}=await _e({...this.getDefaults(J.POST),headers:i==="device"?this.getHeaderWithDeviceToken():this.getHeaderWithUserToken(),urlFragment:"studies/sdkconfig",data:e},this.parent.onAfterRESTCall);return d==="200"&&this.parent.setSession({studyCfgData:n.ConfigFile,studyCfgHash:n.MD5Hash}),{status:d,body:n,headers:r}}}class Wt extends Me{async renew(e,i){const{Code:a,Message:c}=await this.onBeforeRESTCall();if(a===H.ON_BEFORE_REST_CALL_ERROR)return{status:a,body:{Code:a,Message:c},headers:new Headers};const{status:d,body:n,headers:r}=await _e({...this.getDefaults(J.POST),headers:i==="device"?this.getHeaderWithDeviceToken():this.getHeaderWithUserToken(),urlFragment:"auths/renew",data:e},this.parent.onAfterRESTCall);if(d==="200"){const u=n.Token,h=n.RefreshToken,p={...i==="user"&&{userToken:u,userRefreshToken:h},...i==="device"&&{deviceToken:u,deviceRefreshToken:h}};this.parent.setSession(p)}return{status:d,body:n,headers:r}}async validate(e){const{Code:i,Message:a}=await this.onBeforeRESTCall();return i===H.ON_BEFORE_REST_CALL_ERROR?{status:i,body:{Code:i,Message:a},headers:new Headers}:await _e({...this.getDefaults(J.GET),headers:e==="device"?this.getHeaderWithDeviceToken():this.getHeaderWithUserToken(),urlFragment:"auth/v1/validate"},this.parent.onAfterRESTCall)}}var Ut=Object.defineProperty,qe=t=>{throw TypeError(t)},$t=(t,e,i)=>e in t?Ut(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Pe=(t,e,i)=>$t(t,typeof e!="symbol"?e+"":e,i),Ze=(t,e,i)=>e.has(t)||qe("Cannot "+i),We=(t,e,i)=>(Ze(t,e,"read from private field"),i?i.call(t):e.get(t)),Qe=(t,e,i)=>e.has(t)?qe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),we=(t,e,i,a)=>(Ze(t,e,"write to private field"),e.set(t,i),i),oe,X;class Bt{constructor(e){Qe(this,oe,{http:new URL("https://api.deepaffex.ai")}),Qe(this,X),Pe(this,"onBeforeRESTCall"),Pe(this,"onAfterRESTCall"),Pe(this,"http"),we(this,X,{deviceToken:"",deviceRefreshToken:"",userToken:"",userRefreshToken:"",deviceId:"",roleId:"",userId:"",selectedStudy:"",lastMeasurementId:"",studyCfgHash:"",studyCfgData:""}),this.http={measurements:new Mt(this),studies:new Pt(this),auths:new Wt(this)},this.onBeforeRESTCall=e?.onBeforeRESTCall?e.onBeforeRESTCall:()=>{},this.onAfterRESTCall=e?.onAfterRESTCall?e.onAfterRESTCall:()=>{},e?.url!=null&&we(this,oe,e.url)}static new(e){return new this(e??void 0)}getUrl(){return JSON.stringify(We(this,oe))}setUrl(e){we(this,oe,{http:new URL(e)})}getSession(){return We(this,X)}setSession(e){const i=["deviceToken","deviceRefreshToken","userToken","userRefreshToken","deviceId","userId","roleId","selectedStudy","lastMeasurementId","studyCfgHash","studyCfgData"];Object.keys(e).every(d=>i.includes(d)&&typeof e[d]=="string")&&we(this,X,{...We(this,X),...e})}}oe=new WeakMap,X=new WeakMap;const Gt=t=>Bt.new(t);var Ht=Object.defineProperty,et=t=>{throw TypeError(t)},Vt=(t,e,i)=>e in t?Ht(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Kt=(t,e,i)=>Vt(t,e+"",i),jt=(t,e,i)=>e.has(t)||et("Cannot "+i),Yt=(t,e,i)=>e.has(t)?et("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Ue=(t,e,i)=>(jt(t,e,"access private method"),i),le,$e,tt;let it=t=>new Int8Array(t);class Jt extends EventTarget{constructor(){super(...arguments),Yt(this,le),Kt(this,"canDecompress",!1)}static init(){return new this}dispatch(e,i){this.dispatchEvent(new CustomEvent(e,{detail:i}))}getBytesDownloadedEvent(e,i,a,c){return new CustomEvent("bytesDownloaded",{detail:{bytes:e,uncompressedSize:i,url:a,done:c}})}getBytesDownloadErrorEvent(e,i){return new CustomEvent("downloadedError",{detail:{url:e,error:i}})}decompressBrotli(e){const i=atob(e),a=new Uint8Array(i.length);for(let n=0;n<i.length;n++)a[n]=i.charCodeAt(n);const c=new Int8Array(a.length);for(let n=0;n<a.length;n++)c[n]=a[n]>=128?a[n]-256:a[n];return it(c).buffer}async fetchAsset(e,i,a,c,d){const n=i+a,r=e.find(h=>h.file===a).uncompressedSize,u=(h,p,S,C)=>Ue(this,le,$e).call(this,this.getBytesDownloadedEvent(h,p,S,C));try{const p=(await fetch(n)).body?.getReader();if(!p)throw new Error("Failed to get reader from response body.");let S=0;const C=new ReadableStream({async start(O){await P();async function P(){const{done:G,value:re}=await p.read();if(G){O.close(),u(S,r,n,!0);return}re&&(O.enqueue(re),S+=re.length,u(S,r,n,!1)),await P()}}}),k=new Response(C);if(c){const O=await k.json(),{base64EncodedValue:P}=O;if(d==="gzip"){await Ue(this,le,tt).call(this,P);return}return this.decompressBrotli(P)}else return await k.arrayBuffer()}catch(h){Ue(this,le,$e).call(this,this.getBytesDownloadErrorEvent(n,h))}}}le=new WeakSet,$e=function(t){this.dispatchEvent(t)},tt=async function(t){const e=Uint8Array.from(atob(t),h=>h.charCodeAt(0)),a=new Blob([e]).stream().pipeThrough(new DecompressionStream("gzip")),c=await new Response(a).arrayBuffer(),d=new TextDecoder().decode(new Uint8Array(c)),n=new Blob([d],{type:"application/javascript"}),r=URL.createObjectURL(n);it=(await import(r)).BrotliDecode,this.canDecompress=!0,URL.revokeObjectURL(r)};var Xt=Object.defineProperty,zt=(t,e,i)=>e in t?Xt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,st=(t,e,i)=>zt(t,typeof e!="symbol"?e+"":e,i);class qt{constructor(){st(this,"version",{webSDK:"",extractionLib:{version:"",sdkId:""},faceTracker:""}),st(this,"debugLogs",[])}appendLog(e){this.debugLogs.push(e)}transferLogs(){}generateHTMLTable(){return`
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuralogix.ai/web-measurement-embedded-app",
3
- "version": "0.1.0-beta.6",
3
+ "version": "0.1.0-beta.8",
4
4
  "description": "Web Measurement Embedded App",
5
5
  "homepage": "https://docs.deepaffex.ai/wmea/",
6
6
  "contributors": [