quantum-component-library 0.0.1 → 1.0.0-qa

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 (119) hide show
  1. package/README.md +115 -69
  2. package/dist/babel-vendor-BOM86iTb.js +221 -0
  3. package/dist/babel-vendor-cKvSpnBp.cjs +3 -0
  4. package/dist/components/activity-list/index.d.ts +19 -0
  5. package/dist/components/copy-activity-form/index.d.ts +30 -0
  6. package/dist/components/copy-activity-form/index.stories.d.ts +6 -0
  7. package/dist/components/copy-module-form/index.d.ts +30 -0
  8. package/dist/components/copy-module-form/index.stories.d.ts +6 -0
  9. package/dist/components/index.d.ts +8 -0
  10. package/dist/components/module-form/index.d.ts +15 -0
  11. package/dist/components/parameter-edit-list/index.d.ts +13 -0
  12. package/dist/components/parameter-edit-select/index.d.ts +16 -0
  13. package/dist/components/test-filter-panel/index.d.ts +7 -0
  14. package/dist/components/ui/form/index.d.ts +4 -0
  15. package/dist/components/ui/form/label/index.d.ts +4 -0
  16. package/dist/components/ui/form/list-order-input/index.d.ts +14 -0
  17. package/dist/components/ui/form/radio-buttons/index.d.ts +16 -0
  18. package/dist/components/ui/form/range-slider-input/index.d.ts +17 -0
  19. package/dist/components/ui/index.d.ts +2 -1
  20. package/dist/components/ui/tag-group/index.d.ts +7 -0
  21. package/dist/components/upsert-activity-form/index.d.ts +18 -0
  22. package/dist/components/upsert-activity-form/index.stories.d.ts +6 -0
  23. package/dist/components/upsert-module-form/index.d.ts +17 -0
  24. package/dist/components/upsert-module-form/index.stories.d.ts +6 -0
  25. package/dist/components.cjs +13 -0
  26. package/dist/components.js +2078 -0
  27. package/dist/dnd-core-vendor-bgjKfDi6.cjs +1 -0
  28. package/dist/dnd-core-vendor-q7mfiuVu.js +750 -0
  29. package/dist/generated/fragment-masking.d.ts +19 -0
  30. package/dist/generated/gql.d.ts +271 -0
  31. package/dist/generated/graphql.d.ts +2326 -0
  32. package/dist/generated/index.d.ts +2 -0
  33. package/dist/generated-ChsGaiYd.cjs +1 -0
  34. package/dist/generated-GfcSQz21.js +65 -0
  35. package/dist/graphql/fragments/actions.d.ts +1 -0
  36. package/dist/graphql/fragments/analysis.d.ts +12 -0
  37. package/dist/graphql/fragments/groups.d.ts +1 -0
  38. package/dist/graphql/fragments/index.d.ts +6 -0
  39. package/dist/graphql/fragments/modules.d.ts +3 -0
  40. package/dist/graphql/fragments/playback.d.ts +11 -0
  41. package/dist/graphql/fragments/session.d.ts +3 -0
  42. package/dist/graphql/index.d.ts +3 -0
  43. package/dist/graphql/mutations/actions.d.ts +7 -0
  44. package/dist/graphql/mutations/index.d.ts +2 -0
  45. package/dist/graphql/mutations/modules.d.ts +13 -0
  46. package/dist/graphql/queries/actions.d.ts +19 -0
  47. package/dist/graphql/queries/groups.d.ts +9 -0
  48. package/dist/graphql/queries/index.d.ts +3 -0
  49. package/dist/graphql/queries/modules.d.ts +9 -0
  50. package/dist/graphql-CqPvuCvr.cjs +679 -0
  51. package/dist/graphql-DiUes2Np.js +735 -0
  52. package/dist/graphql-vendor-JsvuUrRs.cjs +14 -0
  53. package/dist/graphql-vendor-YnA_qhJA.js +669 -0
  54. package/dist/hooks.cjs +1 -0
  55. package/dist/hooks.js +84 -0
  56. package/dist/index.cjs +1 -0
  57. package/dist/index.d.ts +6 -1
  58. package/dist/index.js +132 -3159
  59. package/dist/lib/hooks/index.d.ts +7 -0
  60. package/dist/lib/hooks/use-graphql-client.d.ts +5 -0
  61. package/dist/lib/hooks/use-joints-for-limb-ids.d.ts +2 -0
  62. package/dist/lib/hooks/use-joints-for-sensor-locations.d.ts +2 -0
  63. package/dist/lib/hooks/use-limbs-for-sensor-locations.d.ts +2 -0
  64. package/dist/lib/hooks/use-part-options-for-joints.d.ts +3 -0
  65. package/dist/lib/hooks/use-part-options-for-limbs.d.ts +3 -0
  66. package/dist/lib/hooks/use-part-options-for-sensor-locations.d.ts +3 -0
  67. package/dist/lib/services/human.d.ts +69 -0
  68. package/dist/lib/services/index.d.ts +1 -0
  69. package/dist/lib/services/rom.json.d.ts +226 -0
  70. package/dist/lib/types/activity.d.ts +19 -0
  71. package/dist/lib/types/analysis.d.ts +115 -0
  72. package/dist/lib/types/athlete.d.ts +8 -0
  73. package/dist/lib/types/catalog.d.ts +35 -0
  74. package/dist/lib/types/error.d.ts +4 -0
  75. package/dist/lib/types/human-part.d.ts +23 -0
  76. package/dist/lib/types/human.d.ts +147 -0
  77. package/dist/lib/types/index.d.ts +14 -0
  78. package/dist/lib/types/parameters.d.ts +10 -0
  79. package/dist/lib/types/playback.d.ts +20 -0
  80. package/dist/lib/types/recording.d.ts +5 -0
  81. package/dist/lib/types/sensor-info.d.ts +105 -0
  82. package/dist/lib/types/threshold.d.ts +30 -0
  83. package/dist/lib/types/tracking.d.ts +82 -0
  84. package/dist/lib/types/upload.d.ts +28 -0
  85. package/dist/lib/utils/conversion.d.ts +27 -0
  86. package/dist/lib/utils/index.d.ts +6 -0
  87. package/dist/lib/utils/memo.d.ts +7 -0
  88. package/dist/lib/utils/parameters.d.ts +6 -0
  89. package/dist/lib/utils/text.d.ts +2 -0
  90. package/dist/lodash-vendor-D5A6v3mw.cjs +1 -0
  91. package/dist/lodash-vendor-Dz4vW7Gd.js +1120 -0
  92. package/dist/other-CmpBz5tg.js +15 -0
  93. package/dist/other-TR0ap-t4.cjs +1 -0
  94. package/dist/providers/index.d.ts +1 -0
  95. package/dist/providers/quantum-library-provider.d.ts +8 -0
  96. package/dist/providers.cjs +1 -0
  97. package/dist/providers.js +11 -0
  98. package/dist/quantum-component-library.css +1 -0
  99. package/dist/react-dnd-vendor-BWqlt2EC.cjs +2 -0
  100. package/dist/react-dnd-vendor-BZs2igAJ.js +1375 -0
  101. package/dist/react-icons-vendor-D2s8zw9h.cjs +1 -0
  102. package/dist/react-icons-vendor-TETORdU9.js +119 -0
  103. package/dist/react-select-vendor-By3h6JjH.cjs +4 -0
  104. package/dist/react-select-vendor-eBH7yy3O.js +2801 -0
  105. package/dist/services.cjs +1 -0
  106. package/dist/services.js +810 -0
  107. package/dist/styled-components-vendor-Bvwhddj9.js +1154 -0
  108. package/dist/styled-components-vendor-D09ATioU.cjs +60 -0
  109. package/dist/types.cjs +1 -0
  110. package/dist/types.js +316 -0
  111. package/dist/utils.cjs +1 -0
  112. package/dist/utils.js +128 -0
  113. package/dist/vendor-BeqUcSbw.cjs +45 -0
  114. package/dist/vendor-DvX9OX-j.js +7876 -0
  115. package/package.json +118 -60
  116. package/dist/components/ui/button.d.ts +0 -10
  117. package/dist/index.css +0 -1
  118. package/dist/index.umd.cjs +0 -22
  119. package/dist/lib/utils.d.ts +0 -2
@@ -0,0 +1,669 @@
1
+ import { f as q, m as R, t as te, a as re, b as B, d as ne, o as ie } from "./vendor-DvX9OX-j.js";
2
+ var ae = {
3
+ OPERATION_DEFINITION: "OperationDefinition"
4
+ };
5
+ class J extends Error {
6
+ constructor(t, n, a, c, u, s, f) {
7
+ super(t), this.name = "GraphQLError", this.message = t, u && (this.path = u), n && (this.nodes = Array.isArray(n) ? n : [n]), a && (this.source = a), c && (this.positions = c), s && (this.originalError = s);
8
+ var p = f;
9
+ if (!p && s) {
10
+ var v = s.extensions;
11
+ v && typeof v == "object" && (p = v);
12
+ }
13
+ this.extensions = p || {};
14
+ }
15
+ toJSON() {
16
+ return {
17
+ ...this,
18
+ message: this.message
19
+ };
20
+ }
21
+ toString() {
22
+ return this.message;
23
+ }
24
+ get [Symbol.toStringTag]() {
25
+ return "GraphQLError";
26
+ }
27
+ }
28
+ var i, r;
29
+ function m(e) {
30
+ return new J(`Syntax Error: Unexpected token at ${r} in ${e}`);
31
+ }
32
+ function P(e) {
33
+ if (e.lastIndex = r, e.test(i))
34
+ return i.slice(r, r = e.lastIndex);
35
+ }
36
+ var N = / +(?=[^\s])/y;
37
+ function oe(e) {
38
+ for (var t = e.split(`
39
+ `), n = "", a = 0, c = 0, u = t.length - 1, s = 0; s < t.length; s++)
40
+ N.lastIndex = 0, N.test(t[s]) && (s && (!a || N.lastIndex < a) && (a = N.lastIndex), c = c || s, u = s);
41
+ for (var f = c; f <= u; f++)
42
+ f !== c && (n += `
43
+ `), n += t[f].slice(a).replace(/\\"""/g, '"""');
44
+ return n;
45
+ }
46
+ function l() {
47
+ for (var e = 0 | i.charCodeAt(r++); e === 9 || e === 10 || e === 13 || e === 32 || e === 35 || e === 44 || e === 65279; e = 0 | i.charCodeAt(r++))
48
+ if (e === 35)
49
+ for (; (e = 0 | i.charCodeAt(r++)) && e !== 10 && e !== 13; )
50
+ ;
51
+ r--;
52
+ }
53
+ function M() {
54
+ for (var e = r, t = 0 | i.charCodeAt(r++); t >= 48 && t <= 57 || t >= 65 && t <= 90 || t === 95 || t >= 97 && t <= 122; t = 0 | i.charCodeAt(r++))
55
+ ;
56
+ if (e === r - 1)
57
+ throw m("Name");
58
+ var n = i.slice(e, --r);
59
+ return l(), n;
60
+ }
61
+ function A() {
62
+ return {
63
+ kind: "Name",
64
+ value: M()
65
+ };
66
+ }
67
+ var se = /(?:"""|(?:[\s\S]*?[^\\])""")/y, ce = /(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;
68
+ function w(e) {
69
+ var t;
70
+ switch (i.charCodeAt(r)) {
71
+ case 91:
72
+ r++, l();
73
+ for (var n = []; i.charCodeAt(r) !== 93; )
74
+ n.push(w(e));
75
+ return r++, l(), {
76
+ kind: "ListValue",
77
+ values: n
78
+ };
79
+ case 123:
80
+ r++, l();
81
+ for (var a = []; i.charCodeAt(r) !== 125; ) {
82
+ var c = A();
83
+ if (i.charCodeAt(r++) !== 58)
84
+ throw m("ObjectField");
85
+ l(), a.push({
86
+ kind: "ObjectField",
87
+ name: c,
88
+ value: w(e)
89
+ });
90
+ }
91
+ return r++, l(), {
92
+ kind: "ObjectValue",
93
+ fields: a
94
+ };
95
+ case 36:
96
+ if (e)
97
+ throw m("Variable");
98
+ return r++, {
99
+ kind: "Variable",
100
+ name: A()
101
+ };
102
+ case 34:
103
+ if (i.charCodeAt(r + 1) === 34 && i.charCodeAt(r + 2) === 34) {
104
+ if (r += 3, (t = P(se)) == null)
105
+ throw m("StringValue");
106
+ return l(), {
107
+ kind: "StringValue",
108
+ value: oe(t.slice(0, -3)),
109
+ block: !0
110
+ };
111
+ } else {
112
+ var u = r, s;
113
+ r++;
114
+ var f = !1;
115
+ for (s = 0 | i.charCodeAt(r++); s === 92 && (r++, f = !0) || s !== 10 && s !== 13 && s !== 34 && s; s = 0 | i.charCodeAt(r++))
116
+ ;
117
+ if (s !== 34)
118
+ throw m("StringValue");
119
+ return t = i.slice(u, r), l(), {
120
+ kind: "StringValue",
121
+ value: f ? JSON.parse(t) : t.slice(1, -1),
122
+ block: !1
123
+ };
124
+ }
125
+ case 45:
126
+ case 48:
127
+ case 49:
128
+ case 50:
129
+ case 51:
130
+ case 52:
131
+ case 53:
132
+ case 54:
133
+ case 55:
134
+ case 56:
135
+ case 57:
136
+ for (var p = r++, v; (v = 0 | i.charCodeAt(r++)) >= 48 && v <= 57; )
137
+ ;
138
+ var h = i.slice(p, --r);
139
+ if ((v = i.charCodeAt(r)) === 46 || v === 69 || v === 101) {
140
+ if ((t = P(ce)) == null)
141
+ throw m("FloatValue");
142
+ return l(), {
143
+ kind: "FloatValue",
144
+ value: h + t
145
+ };
146
+ } else
147
+ return l(), {
148
+ kind: "IntValue",
149
+ value: h
150
+ };
151
+ case 110:
152
+ if (i.charCodeAt(r + 1) === 117 && i.charCodeAt(r + 2) === 108 && i.charCodeAt(r + 3) === 108)
153
+ return r += 4, l(), {
154
+ kind: "NullValue"
155
+ };
156
+ break;
157
+ case 116:
158
+ if (i.charCodeAt(r + 1) === 114 && i.charCodeAt(r + 2) === 117 && i.charCodeAt(r + 3) === 101)
159
+ return r += 4, l(), {
160
+ kind: "BooleanValue",
161
+ value: !0
162
+ };
163
+ break;
164
+ case 102:
165
+ if (i.charCodeAt(r + 1) === 97 && i.charCodeAt(r + 2) === 108 && i.charCodeAt(r + 3) === 115 && i.charCodeAt(r + 4) === 101)
166
+ return r += 5, l(), {
167
+ kind: "BooleanValue",
168
+ value: !1
169
+ };
170
+ break;
171
+ }
172
+ return {
173
+ kind: "EnumValue",
174
+ value: M()
175
+ };
176
+ }
177
+ function X(e) {
178
+ if (i.charCodeAt(r) === 40) {
179
+ var t = [];
180
+ r++, l();
181
+ do {
182
+ var n = A();
183
+ if (i.charCodeAt(r++) !== 58)
184
+ throw m("Argument");
185
+ l(), t.push({
186
+ kind: "Argument",
187
+ name: n,
188
+ value: w(e)
189
+ });
190
+ } while (i.charCodeAt(r) !== 41);
191
+ return r++, l(), t;
192
+ }
193
+ }
194
+ function C(e) {
195
+ if (i.charCodeAt(r) === 64) {
196
+ var t = [];
197
+ do
198
+ r++, t.push({
199
+ kind: "Directive",
200
+ name: A(),
201
+ arguments: X(e)
202
+ });
203
+ while (i.charCodeAt(r) === 64);
204
+ return t;
205
+ }
206
+ }
207
+ function le() {
208
+ for (var e = 0; i.charCodeAt(r) === 91; )
209
+ e++, r++, l();
210
+ var t = {
211
+ kind: "NamedType",
212
+ name: A()
213
+ };
214
+ do
215
+ if (i.charCodeAt(r) === 33 && (r++, l(), t = {
216
+ kind: "NonNullType",
217
+ type: t
218
+ }), e) {
219
+ if (i.charCodeAt(r++) !== 93)
220
+ throw m("NamedType");
221
+ l(), t = {
222
+ kind: "ListType",
223
+ type: t
224
+ };
225
+ }
226
+ while (e--);
227
+ return t;
228
+ }
229
+ function T() {
230
+ if (i.charCodeAt(r++) !== 123)
231
+ throw m("SelectionSet");
232
+ return l(), j();
233
+ }
234
+ function j() {
235
+ var e = [];
236
+ do
237
+ if (i.charCodeAt(r) === 46) {
238
+ if (i.charCodeAt(++r) !== 46 || i.charCodeAt(++r) !== 46)
239
+ throw m("SelectionSet");
240
+ switch (r++, l(), i.charCodeAt(r)) {
241
+ case 64:
242
+ e.push({
243
+ kind: "InlineFragment",
244
+ typeCondition: void 0,
245
+ directives: C(!1),
246
+ selectionSet: T()
247
+ });
248
+ break;
249
+ case 111:
250
+ i.charCodeAt(r + 1) === 110 ? (r += 2, l(), e.push({
251
+ kind: "InlineFragment",
252
+ typeCondition: {
253
+ kind: "NamedType",
254
+ name: A()
255
+ },
256
+ directives: C(!1),
257
+ selectionSet: T()
258
+ })) : e.push({
259
+ kind: "FragmentSpread",
260
+ name: A(),
261
+ directives: C(!1)
262
+ });
263
+ break;
264
+ case 123:
265
+ r++, l(), e.push({
266
+ kind: "InlineFragment",
267
+ typeCondition: void 0,
268
+ directives: void 0,
269
+ selectionSet: j()
270
+ });
271
+ break;
272
+ default:
273
+ e.push({
274
+ kind: "FragmentSpread",
275
+ name: A(),
276
+ directives: C(!1)
277
+ });
278
+ }
279
+ } else {
280
+ var t = A(), n = void 0;
281
+ i.charCodeAt(r) === 58 && (r++, l(), n = t, t = A());
282
+ var a = X(!1), c = C(!1), u = void 0;
283
+ i.charCodeAt(r) === 123 && (r++, l(), u = j()), e.push({
284
+ kind: "Field",
285
+ alias: n,
286
+ name: t,
287
+ arguments: a,
288
+ directives: c,
289
+ selectionSet: u
290
+ });
291
+ }
292
+ while (i.charCodeAt(r) !== 125);
293
+ return r++, l(), {
294
+ kind: "SelectionSet",
295
+ selections: e
296
+ };
297
+ }
298
+ function ue() {
299
+ if (l(), i.charCodeAt(r) === 40) {
300
+ var e = [];
301
+ r++, l();
302
+ do {
303
+ var t = void 0;
304
+ if (i.charCodeAt(r) === 34 && (t = w(!0)), i.charCodeAt(r++) !== 36)
305
+ throw m("Variable");
306
+ var n = A();
307
+ if (i.charCodeAt(r++) !== 58)
308
+ throw m("VariableDefinition");
309
+ l();
310
+ var a = le(), c = void 0;
311
+ i.charCodeAt(r) === 61 && (r++, l(), c = w(!0)), l();
312
+ var u = {
313
+ kind: "VariableDefinition",
314
+ variable: {
315
+ kind: "Variable",
316
+ name: n
317
+ },
318
+ type: a,
319
+ defaultValue: c,
320
+ directives: C(!0)
321
+ };
322
+ t && (u.description = t), e.push(u);
323
+ } while (i.charCodeAt(r) !== 41);
324
+ return r++, l(), e;
325
+ }
326
+ }
327
+ function de(e) {
328
+ var t = A();
329
+ if (i.charCodeAt(r++) !== 111 || i.charCodeAt(r++) !== 110)
330
+ throw m("FragmentDefinition");
331
+ l();
332
+ var n = {
333
+ kind: "FragmentDefinition",
334
+ name: t,
335
+ typeCondition: {
336
+ kind: "NamedType",
337
+ name: A()
338
+ },
339
+ directives: C(!1),
340
+ selectionSet: T()
341
+ };
342
+ return e && (n.description = e), n;
343
+ }
344
+ function z() {
345
+ var e = [];
346
+ do {
347
+ var t = void 0;
348
+ if (i.charCodeAt(r) === 34 && (t = w(!0)), i.charCodeAt(r) === 123) {
349
+ if (t)
350
+ throw m("Document");
351
+ r++, l(), e.push({
352
+ kind: "OperationDefinition",
353
+ operation: "query",
354
+ name: void 0,
355
+ variableDefinitions: void 0,
356
+ directives: void 0,
357
+ selectionSet: j()
358
+ });
359
+ } else {
360
+ var n = M();
361
+ switch (n) {
362
+ case "fragment":
363
+ e.push(de(t));
364
+ break;
365
+ case "query":
366
+ case "mutation":
367
+ case "subscription":
368
+ var a, c = void 0;
369
+ (a = i.charCodeAt(r)) !== 40 && a !== 64 && a !== 123 && (c = A());
370
+ var u = {
371
+ kind: "OperationDefinition",
372
+ operation: n,
373
+ name: c,
374
+ variableDefinitions: ue(),
375
+ directives: C(!1),
376
+ selectionSet: T()
377
+ };
378
+ t && (u.description = t), e.push(u);
379
+ break;
380
+ default:
381
+ throw m("Document");
382
+ }
383
+ }
384
+ } while (r < i.length);
385
+ return e;
386
+ }
387
+ function fe(e, t) {
388
+ return i = e.body ? e.body : e, r = 0, l(), t && t.noLocation ? {
389
+ kind: "Document",
390
+ definitions: z()
391
+ } : {
392
+ kind: "Document",
393
+ definitions: z(),
394
+ loc: {
395
+ start: 0,
396
+ end: i.length,
397
+ startToken: void 0,
398
+ endToken: void 0,
399
+ source: {
400
+ body: i,
401
+ name: "graphql.web",
402
+ locationOffset: {
403
+ line: 1,
404
+ column: 1
405
+ }
406
+ }
407
+ }
408
+ };
409
+ }
410
+ function g(e, t, n) {
411
+ for (var a = "", c = 0; c < e.length; c++)
412
+ c && (a += t), a += n(e[c]);
413
+ return a;
414
+ }
415
+ function ve(e) {
416
+ return JSON.stringify(e);
417
+ }
418
+ function he(e) {
419
+ return `"""
420
+ ` + e.replace(/"""/g, '\\"""') + `
421
+ """`;
422
+ }
423
+ var y = `
424
+ `, d = {
425
+ OperationDefinition(e) {
426
+ var t = "";
427
+ e.description && (t += d.StringValue(e.description) + `
428
+ `), t += e.operation, e.name && (t += " " + e.name.value), e.variableDefinitions && e.variableDefinitions.length && (e.name || (t += " "), t += "(" + g(e.variableDefinitions, ", ", d.VariableDefinition) + ")"), e.directives && e.directives.length && (t += " " + g(e.directives, " ", d.Directive));
429
+ var n = d.SelectionSet(e.selectionSet);
430
+ return t !== "query" ? t + " " + n : n;
431
+ },
432
+ VariableDefinition(e) {
433
+ var t = "";
434
+ return e.description && (t += d.StringValue(e.description) + " "), t += d.Variable(e.variable) + ": " + S(e.type), e.defaultValue && (t += " = " + S(e.defaultValue)), e.directives && e.directives.length && (t += " " + g(e.directives, " ", d.Directive)), t;
435
+ },
436
+ Field(e) {
437
+ var t = e.alias ? e.alias.value + ": " + e.name.value : e.name.value;
438
+ if (e.arguments && e.arguments.length) {
439
+ var n = g(e.arguments, ", ", d.Argument);
440
+ t.length + n.length + 2 > 80 ? t += "(" + (y += " ") + g(e.arguments, y, d.Argument) + (y = y.slice(0, -2)) + ")" : t += "(" + n + ")";
441
+ }
442
+ return e.directives && e.directives.length && (t += " " + g(e.directives, " ", d.Directive)), e.selectionSet && e.selectionSet.selections.length && (t += " " + d.SelectionSet(e.selectionSet)), t;
443
+ },
444
+ StringValue(e) {
445
+ return e.block ? he(e.value).replace(/\n/g, y) : ve(e.value);
446
+ },
447
+ BooleanValue: (e) => "" + e.value,
448
+ NullValue: (e) => "null",
449
+ IntValue: (e) => e.value,
450
+ FloatValue: (e) => e.value,
451
+ EnumValue: (e) => e.value,
452
+ Name: (e) => e.value,
453
+ Variable: (e) => "$" + e.name.value,
454
+ ListValue: (e) => "[" + g(e.values, ", ", S) + "]",
455
+ ObjectValue: (e) => "{" + g(e.fields, ", ", d.ObjectField) + "}",
456
+ ObjectField: (e) => e.name.value + ": " + S(e.value),
457
+ Document(e) {
458
+ return !e.definitions || !e.definitions.length ? "" : g(e.definitions, `
459
+
460
+ `, S);
461
+ },
462
+ SelectionSet: (e) => "{" + (y += " ") + g(e.selections, y, S) + (y = y.slice(0, -2)) + "}",
463
+ Argument: (e) => e.name.value + ": " + S(e.value),
464
+ FragmentSpread(e) {
465
+ var t = "..." + e.name.value;
466
+ return e.directives && e.directives.length && (t += " " + g(e.directives, " ", d.Directive)), t;
467
+ },
468
+ InlineFragment(e) {
469
+ var t = "...";
470
+ return e.typeCondition && (t += " on " + e.typeCondition.name.value), e.directives && e.directives.length && (t += " " + g(e.directives, " ", d.Directive)), t += " " + d.SelectionSet(e.selectionSet);
471
+ },
472
+ FragmentDefinition(e) {
473
+ var t = "";
474
+ return e.description && (t += d.StringValue(e.description) + `
475
+ `), t += "fragment " + e.name.value, t += " on " + e.typeCondition.name.value, e.directives && e.directives.length && (t += " " + g(e.directives, " ", d.Directive)), t + " " + d.SelectionSet(e.selectionSet);
476
+ },
477
+ Directive(e) {
478
+ var t = "@" + e.name.value;
479
+ return e.arguments && e.arguments.length && (t += "(" + g(e.arguments, ", ", d.Argument) + ")"), t;
480
+ },
481
+ NamedType: (e) => e.name.value,
482
+ ListType: (e) => "[" + S(e.type) + "]",
483
+ NonNullType: (e) => S(e.type) + "!"
484
+ }, S = (e) => d[e.kind](e);
485
+ function pe(e) {
486
+ return y = `
487
+ `, d[e.kind] ? d[e.kind](e) : "";
488
+ }
489
+ var me = (e) => e && typeof e.message == "string" && (e.extensions || e.name === "GraphQLError") ? e : typeof e == "object" && typeof e.message == "string" ? new J(e.message, e.nodes, e.source, e.positions, e.path, e, e.extensions || {}) : new J(e);
490
+ class ge extends Error {
491
+ constructor(t) {
492
+ var n = (t.graphQLErrors || []).map(me), a = ((c, u) => {
493
+ var s = "";
494
+ if (c)
495
+ return `[Network] ${c.message}`;
496
+ if (u)
497
+ for (var f = 0, p = u.length; f < p; f++)
498
+ s && (s += `
499
+ `), s += `[GraphQL] ${u[f].message}`;
500
+ return s;
501
+ })(t.networkError, n);
502
+ super(a), this.name = "CombinedError", this.message = a, this.graphQLErrors = n, this.networkError = t.networkError, this.response = t.response;
503
+ }
504
+ toString() {
505
+ return this.message;
506
+ }
507
+ }
508
+ var _ = (e, t) => {
509
+ for (var n = 0 | (t || 5381), a = 0, c = 0 | e.length; a < c; a++)
510
+ n = (n << 5) + n + e.charCodeAt(a);
511
+ return n;
512
+ }, I = /* @__PURE__ */ new Set(), U = /* @__PURE__ */ new WeakMap(), b = (e, t) => {
513
+ if (e === null || I.has(e))
514
+ return "null";
515
+ if (typeof e != "object")
516
+ return JSON.stringify(e) || "";
517
+ if (e.toJSON)
518
+ return b(e.toJSON());
519
+ if (Array.isArray(e)) {
520
+ for (var n = "[", a = 0, c = e.length; a < c; a++)
521
+ n.length > 1 && (n += ","), n += b(e[a]) || "null";
522
+ return n += "]";
523
+ }
524
+ var u = Object.keys(e).sort();
525
+ if (!u.length && e.constructor && Object.getPrototypeOf(e).constructor !== Object.prototype.constructor) {
526
+ var s = U.get(e) || Math.random().toString(36).slice(2);
527
+ return U.set(e, s), b({
528
+ __key: s
529
+ });
530
+ }
531
+ I.add(e);
532
+ for (var f = "{", p = 0, v = u.length; p < v; p++) {
533
+ var h = b(e[u[p]]);
534
+ h && (f.length > 1 && (f += ","), f += b(u[p]) + ":" + h);
535
+ }
536
+ return I.delete(e), f += "}";
537
+ }, Ae = (e, t) => (I.clear(), b(e)), ke = /("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g, ye = /(?:#[^\n\r]+)?(?:[\r\n]+|$)/g, Se = (e, t) => t % 2 == 0 ? e.replace(ye, `
538
+ `) : e, H = (e) => e.split(ke).map(Se).join("").trim(), W = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), Y = (e) => {
539
+ var t;
540
+ return typeof e == "string" ? t = H(e) : e.loc && F.get(e.__key) === e ? t = e.loc.source.body : (t = W.get(e) || H(pe(e)), W.set(e, t)), typeof e != "string" && !e.loc && (e.loc = {
541
+ start: 0,
542
+ end: t.length,
543
+ source: {
544
+ body: t,
545
+ name: "gql",
546
+ locationOffset: {
547
+ line: 1,
548
+ column: 1
549
+ }
550
+ }
551
+ }), t;
552
+ }, K = (e) => {
553
+ var t;
554
+ if (e.documentId)
555
+ t = _(e.documentId);
556
+ else if (t = _(Y(e)), e.definitions) {
557
+ var n = we(e);
558
+ n && (t = _(`
559
+ # ${n}`, t));
560
+ }
561
+ return t;
562
+ }, Ce = (e) => {
563
+ var t, n;
564
+ return typeof e == "string" ? (t = K(e), n = F.get(t) || fe(e, {
565
+ noLocation: !0
566
+ })) : (t = e.__key || K(e), n = F.get(t) || e), n.loc || Y(n), n.__key = t, F.set(t, n), n;
567
+ }, be = (e, t, n) => {
568
+ var a = t || {}, c = Ce(e), u = Ae(a), s = c.__key;
569
+ return u !== "{}" && (s = _(u, s)), {
570
+ key: s,
571
+ query: c,
572
+ variables: a,
573
+ extensions: n
574
+ };
575
+ }, we = (e) => {
576
+ for (var t = 0, n = e.definitions.length; t < n; t++) {
577
+ var a = e.definitions[t];
578
+ if (a.kind === ae.OPERATION_DEFINITION)
579
+ return a.name ? a.name.value : void 0;
580
+ }
581
+ }, xe = (e, t, n) => ({
582
+ operation: e,
583
+ data: void 0,
584
+ error: new ge({
585
+ networkError: t,
586
+ response: n
587
+ }),
588
+ extensions: void 0,
589
+ hasNext: !1,
590
+ stale: !1
591
+ });
592
+ function Z(e, t, n) {
593
+ return {
594
+ ...t,
595
+ kind: e,
596
+ context: t.context ? {
597
+ ...t.context,
598
+ ...n
599
+ } : n || t.context
600
+ };
601
+ }
602
+ var $ = (e, t) => Z(e.kind, e, {
603
+ ...e.context,
604
+ authAttempt: t
605
+ });
606
+ function Ee(e) {
607
+ return ({ client: t, forward: n }) => {
608
+ var a = /* @__PURE__ */ new Set(), c = B(), u = B(), s = /* @__PURE__ */ new Map();
609
+ function f() {
610
+ v = void 0;
611
+ var x = s;
612
+ s = /* @__PURE__ */ new Map(), x.forEach(c.next);
613
+ }
614
+ function p(x) {
615
+ v = void 0;
616
+ var V = s;
617
+ s = /* @__PURE__ */ new Map(), V.forEach(((D) => {
618
+ u.next(xe(D, x));
619
+ }));
620
+ }
621
+ var v, h = null;
622
+ return (x) => {
623
+ function V() {
624
+ v = Promise.resolve().then((() => e({
625
+ mutate(o, O, k) {
626
+ var Q = t.createRequestOperation("mutation", be(o, O), k);
627
+ return te(ne(1)(q(((E) => E.operation.key === Q.key && Q.context._instance === E.operation.context._instance))(ie((() => {
628
+ var E = L(Q);
629
+ a.add(E.context._instance), c.next(E);
630
+ }))(G))));
631
+ },
632
+ appendHeaders(o, O) {
633
+ var k = typeof o.context.fetchOptions == "function" ? o.context.fetchOptions() : o.context.fetchOptions || {};
634
+ return Z(o.kind, o, {
635
+ ...o.context,
636
+ fetchOptions: {
637
+ ...k,
638
+ headers: {
639
+ ...k.headers,
640
+ ...O
641
+ }
642
+ }
643
+ });
644
+ }
645
+ }))).then(((o) => {
646
+ o && (h = o), f();
647
+ })).catch(((o) => {
648
+ process.env.NODE_ENV !== "production" && console.warn("authExchange()’s initialization function has failed, which is unexpected.\nIf your initialization function is expected to throw/reject, catch this error and handle it explicitly.\nUnless this error is handled it’ll be passed onto any `OperationResult` instantly and authExchange() will block further operations and retry.", o), p(o);
649
+ }));
650
+ }
651
+ V();
652
+ function D(o) {
653
+ s.set(o.key, $(o, !0)), h && !v && (v = h.refreshAuth().then(f).catch(p));
654
+ }
655
+ function L(o) {
656
+ return h ? h.addAuthToOperation(o) : o;
657
+ }
658
+ var ee = q(Boolean)(re(((o) => o.kind === "teardown" ? (s.delete(o.key), o) : o.context._instance && a.has(o.context._instance) ? o : o.context.authAttempt ? L(o) : v || !h ? (v || V(), s.has(o.key) || s.set(o.key, $(o, !1)), null) : (function(k) {
659
+ return !k.context.authAttempt && h && h.willAuthError && h.willAuthError(k);
660
+ })(o) ? (D(o), null) : L($(o, !1))))(R([c.source, x]))), G = n(ee);
661
+ return R([u.source, q(((o) => !a.has(o.operation.context._instance) && o.error && (function(k) {
662
+ return h && h.didAuthError && h.didAuthError(k.error, k.operation);
663
+ })(o) && !o.operation.context.authAttempt ? (D(o.operation), !1) : (a.has(o.operation.context._instance) && a.delete(o.operation.context._instance), !0)))(G)]);
664
+ };
665
+ };
666
+ }
667
+ export {
668
+ Ee as a
669
+ };
package/dist/hooks.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("./graphql-vendor-JsvuUrRs.cjs"),a=require("react"),l=require("urql"),i=require("./services.cjs"),u=require("./types.cjs"),f=({url:e,getAuthToken:t})=>new l.Client({url:e,requestPolicy:"cache-and-network",exchanges:[L.authExchange(r=>{const n=t();return Promise.resolve({addAuthToOperation(s){return n?r.appendHeaders(s,{Authorization:`Bearer ${n}`}):s},didAuthError:s=>/unauthorized/gi.test(s?.message),refreshAuth:()=>Promise.resolve()})}),l.fetchExchange]}),h=({url:e,getAuthToken:t})=>a.useMemo(()=>f({url:e,getAuthToken:t}),[e,t]),c=e=>{const t=i.getAllAvailableJoints();return a.useMemo(()=>t.filter(r=>r.id==="NavalSpine"||r.id==="ChestSpine"?!1:i.limbsRequiredForJoints[r.id].every(s=>e.includes(s))),[e,t])},m=e=>{const t=a.useMemo(()=>e.map(u.sensorLocationToLimbId).filter(n=>!!n),[e]);return c(t)},d=e=>a.useMemo(()=>{const r=i.getAllAvailableLimbs(),n=e.map(u.sensorLocationToLimbId);return r.filter(s=>n.includes(s.id))},[e]),p=(e,t)=>a.useMemo(()=>e.flatMap(n=>i.getEnabledJointPlanes(n,t).map(s=>({id:{joint:n},plane:s,...i.getDefaultJointRange(n,s)}))),[e,t]),b=(e,t)=>{const r=a.useMemo(()=>{const s=i.getAllAvailableLimbs();return e.filter(o=>s.some(g=>g.id===o))},[e]);return a.useMemo(()=>r.flatMap(s=>i.getEnabledSegmentPlanes(s,t).map(o=>({id:{segment:s},plane:o,...i.getDefaultLimbRange(s,o)}))),[r,t])},q=e=>{const t=d(e),r=m(e),n=p(r.map(o=>o.id),u.AngleDataSource.Sensor),s=b(t.map(o=>o.id),u.AngleDataSource.Sensor);return[...n,...s]};exports.useGraphqlClient=h;exports.useJointsForLimbIds=c;exports.useJointsForSensorLocations=m;exports.useLimbsForSensorLocations=d;exports.usePartOptionsForJoints=p;exports.usePartOptionsForLimbs=b;exports.usePartOptionsForSensorLocations=q;