@pie-element/charting 12.1.2-next.2 → 12.1.2-next.20

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 (37) hide show
  1. package/author.js +2 -0
  2. package/dist/author/charting-config.js +4 -4
  3. package/dist/author/configure.js +3 -3
  4. package/dist/author/correct-response.js +4 -4
  5. package/dist/author/index.d.ts +1 -0
  6. package/dist/author/index.js +5 -2
  7. package/dist/author/utils.js +1 -1
  8. package/dist/browser/assets/Symbola-4c507403.woff2 +0 -0
  9. package/dist/browser/author/index.js +2245 -301
  10. package/dist/browser/author/index.js.map +1 -1
  11. package/dist/browser/{chart-C1GUG3cz.js → chart-Cs8wCdj9.js} +18463 -24468
  12. package/dist/browser/chart-Cs8wCdj9.js.map +1 -0
  13. package/dist/browser/controller/index.js +3 -3
  14. package/dist/browser/controller/index.js.map +1 -1
  15. package/dist/browser/delivery/index.js +104 -86
  16. package/dist/browser/delivery/index.js.map +1 -1
  17. package/dist/browser/{dist-CA-Ok7CW.js → dist-D6aoYeoC.js} +6 -2
  18. package/dist/browser/{dist-CA-Ok7CW.js.map → dist-D6aoYeoC.js.map} +1 -1
  19. package/dist/browser/editor-runtime/assets/Symbola-4c507403.woff2 +0 -0
  20. package/dist/browser/editor-runtime/author/index.js +3186 -0
  21. package/dist/browser/editor-runtime/author/index.js.map +1 -0
  22. package/dist/browser/editor-runtime/chart-DzM_FFhs.js +36529 -0
  23. package/dist/browser/editor-runtime/chart-DzM_FFhs.js.map +1 -0
  24. package/dist/browser/editor-runtime/controller/index.js +194 -0
  25. package/dist/browser/editor-runtime/controller/index.js.map +1 -0
  26. package/dist/browser/editor-runtime/delivery/index.js +535 -0
  27. package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
  28. package/dist/browser/editor-runtime/dist-4_gVzyUN.js +334 -0
  29. package/dist/browser/editor-runtime/dist-4_gVzyUN.js.map +1 -0
  30. package/dist/controller/index.js +1 -1
  31. package/dist/delivery/index.d.ts +3 -0
  32. package/dist/delivery/index.js +25 -7
  33. package/dist/delivery/main.js +1 -1
  34. package/dist/index.iife.js +104 -140
  35. package/package.json +33 -23
  36. package/dist/browser/chart-C1GUG3cz.js.map +0 -1
  37. package/dist/browser/charting.css +0 -2
@@ -0,0 +1,3186 @@
1
+ import { C as e, f as t, g as n, i as r, r as i, t as a, v as o } from "../dist-4_gVzyUN.js";
2
+ import { A as s, C as c, D as l, E as u, F as d, G as f, H as p, I as m, J as h, K as g, L as _, M as v, N as y, O as b, P as x, Q as S, R as C, T as w, U as T, V as E, W as D, X as O, Y as k, Z as A, _ as j, a as M, c as ee, d as N, f as P, h as F, i as I, l as L, m as te, o as R, p as z, q as B, r as V, t as ne, u as re, v as ie, w as ae, z as H } from "../chart-DzM_FFhs.js";
3
+ import * as U from "react";
4
+ import W, { Component as G, createElement as oe, useEffect as se, useState as ce } from "react";
5
+ import { createRoot as le } from "react-dom/client";
6
+ import { jsx as K, jsxs as q } from "react/jsx-runtime";
7
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/utils/createChainedFunction.js
8
+ var ue = m;
9
+ //#endregion
10
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/FormControlLabel/formControlLabelClasses.js
11
+ function de(e) {
12
+ return k("MuiFormControlLabel", e);
13
+ }
14
+ var J = h("MuiFormControlLabel", [
15
+ "root",
16
+ "labelPlacementStart",
17
+ "labelPlacementTop",
18
+ "labelPlacementBottom",
19
+ "disabled",
20
+ "label",
21
+ "error",
22
+ "required",
23
+ "asterisk"
24
+ ]), fe = (e) => {
25
+ let { classes: t, disabled: n, labelPlacement: r, error: i, required: a } = e;
26
+ return B({
27
+ root: [
28
+ "root",
29
+ n && "disabled",
30
+ `labelPlacement${d(r)}`,
31
+ i && "error",
32
+ a && "required"
33
+ ],
34
+ label: ["label", n && "disabled"],
35
+ asterisk: ["asterisk", i && "error"]
36
+ }, de, t);
37
+ }, pe = T("label", {
38
+ name: "MuiFormControlLabel",
39
+ slot: "Root",
40
+ overridesResolver: (e, t) => {
41
+ let { ownerState: n } = e;
42
+ return [
43
+ { [`& .${J.label}`]: t.label },
44
+ t.root,
45
+ t[`labelPlacement${d(n.labelPlacement)}`]
46
+ ];
47
+ }
48
+ })(C(({ theme: e }) => ({
49
+ display: "inline-flex",
50
+ alignItems: "center",
51
+ cursor: "pointer",
52
+ verticalAlign: "middle",
53
+ WebkitTapHighlightColor: "transparent",
54
+ marginLeft: -11,
55
+ marginRight: 16,
56
+ [`&.${J.disabled}`]: { cursor: "default" },
57
+ [`& .${J.label}`]: { [`&.${J.disabled}`]: { color: (e.vars || e).palette.text.disabled } },
58
+ variants: [
59
+ {
60
+ props: { labelPlacement: "start" },
61
+ style: {
62
+ flexDirection: "row-reverse",
63
+ marginRight: -11
64
+ }
65
+ },
66
+ {
67
+ props: { labelPlacement: "top" },
68
+ style: { flexDirection: "column-reverse" }
69
+ },
70
+ {
71
+ props: { labelPlacement: "bottom" },
72
+ style: { flexDirection: "column" }
73
+ },
74
+ {
75
+ props: ({ labelPlacement: e }) => e === "start" || e === "top" || e === "bottom",
76
+ style: { marginLeft: 16 }
77
+ }
78
+ ]
79
+ }))), me = T("span", {
80
+ name: "MuiFormControlLabel",
81
+ slot: "Asterisk"
82
+ })(C(({ theme: e }) => ({ [`&.${J.error}`]: { color: (e.vars || e).palette.error.main } }))), he = /*#__PURE__*/ U.forwardRef(function(e, t) {
83
+ let n = H({
84
+ props: e,
85
+ name: "MuiFormControlLabel"
86
+ }), { checked: r, className: i, componentsProps: a = {}, control: o, disabled: s, disableTypography: c, inputRef: l, label: d, labelPlacement: f = "end", name: p, onChange: m, required: h, slots: g = {}, slotProps: v = {}, value: y, ...x } = n, S = u(), C = s ?? o.props.disabled ?? S?.disabled, w = h ?? o.props.required, T = {
87
+ disabled: C,
88
+ required: w
89
+ };
90
+ [
91
+ "checked",
92
+ "name",
93
+ "onChange",
94
+ "value",
95
+ "inputRef"
96
+ ].forEach((e) => {
97
+ o.props[e] === void 0 && n[e] !== void 0 && (T[e] = n[e]);
98
+ });
99
+ let E = b({
100
+ props: n,
101
+ muiFormControl: S,
102
+ states: ["error"]
103
+ }), D = {
104
+ ...n,
105
+ disabled: C,
106
+ labelPlacement: f,
107
+ required: w,
108
+ error: E.error
109
+ }, k = fe(D), [A, j] = _("typography", {
110
+ elementType: F,
111
+ externalForwardedProps: {
112
+ slots: g,
113
+ slotProps: {
114
+ ...a,
115
+ ...v
116
+ }
117
+ },
118
+ ownerState: D
119
+ }), M = d;
120
+ return M != null && M.type !== F && !c && (M = /*#__PURE__*/ K(A, {
121
+ component: "span",
122
+ ...j,
123
+ className: O(k.label, j?.className),
124
+ children: M
125
+ })), /*#__PURE__*/ q(pe, {
126
+ className: O(k.root, i),
127
+ ownerState: D,
128
+ ref: t,
129
+ ...x,
130
+ children: [/*#__PURE__*/ U.cloneElement(o, T), w ? /*#__PURE__*/ q("div", { children: [M, /*#__PURE__*/ q(me, {
131
+ ownerState: D,
132
+ "aria-hidden": !0,
133
+ className: k.asterisk,
134
+ children: [" ", "*"]
135
+ })] }) : M]
136
+ });
137
+ });
138
+ //#endregion
139
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/InputAdornment/inputAdornmentClasses.js
140
+ function ge(e) {
141
+ return k("MuiInputAdornment", e);
142
+ }
143
+ var _e = h("MuiInputAdornment", [
144
+ "root",
145
+ "filled",
146
+ "standard",
147
+ "outlined",
148
+ "positionStart",
149
+ "positionEnd",
150
+ "disablePointerEvents",
151
+ "hiddenLabel",
152
+ "sizeSmall"
153
+ ]), ve, ye = (e, t) => {
154
+ let { ownerState: n } = e;
155
+ return [
156
+ t.root,
157
+ t[`position${d(n.position)}`],
158
+ n.disablePointerEvents === !0 && t.disablePointerEvents,
159
+ t[n.variant]
160
+ ];
161
+ }, be = (e) => {
162
+ let { classes: t, disablePointerEvents: n, hiddenLabel: r, position: i, size: a, variant: o } = e;
163
+ return B({ root: [
164
+ "root",
165
+ n && "disablePointerEvents",
166
+ i && `position${d(i)}`,
167
+ o,
168
+ r && "hiddenLabel",
169
+ a && `size${d(a)}`
170
+ ] }, ge, t);
171
+ }, xe = T("div", {
172
+ name: "MuiInputAdornment",
173
+ slot: "Root",
174
+ overridesResolver: ye
175
+ })(C(({ theme: e }) => ({
176
+ display: "flex",
177
+ maxHeight: "2em",
178
+ alignItems: "center",
179
+ whiteSpace: "nowrap",
180
+ color: (e.vars || e).palette.action.active,
181
+ variants: [
182
+ {
183
+ props: { variant: "filled" },
184
+ style: { [`&.${_e.positionStart}&:not(.${_e.hiddenLabel})`]: { marginTop: 16 } }
185
+ },
186
+ {
187
+ props: { position: "start" },
188
+ style: { marginRight: 8 }
189
+ },
190
+ {
191
+ props: { position: "end" },
192
+ style: { marginLeft: 8 }
193
+ },
194
+ {
195
+ props: { disablePointerEvents: !0 },
196
+ style: { pointerEvents: "none" }
197
+ }
198
+ ]
199
+ }))), Se = /*#__PURE__*/ U.forwardRef(function(e, t) {
200
+ let n = H({
201
+ props: e,
202
+ name: "MuiInputAdornment"
203
+ }), { children: r, className: i, component: a = "div", disablePointerEvents: o = !1, disableTypography: s = !1, position: c, variant: d, ...f } = n, p = u() || {}, m = d;
204
+ d && p.variant, p && !m && (m = p.variant);
205
+ let h = {
206
+ ...n,
207
+ hiddenLabel: p.hiddenLabel,
208
+ size: p.size,
209
+ disablePointerEvents: o,
210
+ position: c,
211
+ variant: m
212
+ }, g = be(h);
213
+ return /*#__PURE__*/ K(l.Provider, {
214
+ value: null,
215
+ children: /*#__PURE__*/ K(xe, {
216
+ as: a,
217
+ ownerState: h,
218
+ className: O(g.root, i),
219
+ ref: t,
220
+ ...f,
221
+ children: typeof r == "string" && !s ? /*#__PURE__*/ K(F, {
222
+ color: "textSecondary",
223
+ children: r
224
+ }) : /*#__PURE__*/ q(U.Fragment, { children: [c === "start" ? ve ||= /*#__PURE__*/ K("span", {
225
+ className: "notranslate",
226
+ "aria-hidden": !0,
227
+ children: "​"
228
+ }) : null, r] })
229
+ })
230
+ });
231
+ }), Ce = x(/*#__PURE__*/ K("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" }), "RadioButtonUnchecked"), we = x(/*#__PURE__*/ K("path", { d: "M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z" }), "RadioButtonChecked"), Te = T("span", {
232
+ name: "MuiRadioButtonIcon",
233
+ shouldForwardProp: D
234
+ })({
235
+ position: "relative",
236
+ display: "flex"
237
+ }), Ee = T(Ce, { name: "MuiRadioButtonIcon" })({ transform: "scale(1)" }), De = T(we, { name: "MuiRadioButtonIcon" })(C(({ theme: e }) => ({
238
+ left: 0,
239
+ position: "absolute",
240
+ transform: "scale(0)",
241
+ transition: e.transitions.create("transform", {
242
+ easing: e.transitions.easing.easeIn,
243
+ duration: e.transitions.duration.shortest
244
+ }),
245
+ variants: [{
246
+ props: { checked: !0 },
247
+ style: {
248
+ transform: "scale(1)",
249
+ transition: e.transitions.create("transform", {
250
+ easing: e.transitions.easing.easeOut,
251
+ duration: e.transitions.duration.shortest
252
+ })
253
+ }
254
+ }]
255
+ })));
256
+ function Oe(e) {
257
+ let { checked: t = !1, classes: n = {}, fontSize: r } = e, i = {
258
+ ...e,
259
+ checked: t
260
+ };
261
+ return /*#__PURE__*/ q(Te, {
262
+ className: n.root,
263
+ ownerState: i,
264
+ children: [/*#__PURE__*/ K(Ee, {
265
+ fontSize: r,
266
+ className: n.background,
267
+ ownerState: i
268
+ }), /*#__PURE__*/ K(De, {
269
+ fontSize: r,
270
+ className: n.dot,
271
+ ownerState: i
272
+ })]
273
+ });
274
+ }
275
+ //#endregion
276
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/RadioGroup/RadioGroupContext.js
277
+ var ke = /*#__PURE__*/ U.createContext(void 0);
278
+ //#endregion
279
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/RadioGroup/useRadioGroup.js
280
+ function Ae() {
281
+ return U.useContext(ke);
282
+ }
283
+ //#endregion
284
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Radio/radioClasses.js
285
+ function je(e) {
286
+ return k("MuiRadio", e);
287
+ }
288
+ var Me = h("MuiRadio", [
289
+ "root",
290
+ "checked",
291
+ "disabled",
292
+ "colorPrimary",
293
+ "colorSecondary",
294
+ "sizeSmall"
295
+ ]), Ne = (e) => {
296
+ let { classes: t, color: n, size: r } = e, i = { root: [
297
+ "root",
298
+ `color${d(n)}`,
299
+ r !== "medium" && `size${d(r)}`
300
+ ] };
301
+ return {
302
+ ...t,
303
+ ...B(i, je, t)
304
+ };
305
+ }, Pe = T(M, {
306
+ shouldForwardProp: (e) => D(e) || e === "classes",
307
+ name: "MuiRadio",
308
+ slot: "Root",
309
+ overridesResolver: (e, t) => {
310
+ let { ownerState: n } = e;
311
+ return [
312
+ t.root,
313
+ n.size !== "medium" && t[`size${d(n.size)}`],
314
+ t[`color${d(n.color)}`]
315
+ ];
316
+ }
317
+ })(C(({ theme: e }) => ({
318
+ color: (e.vars || e).palette.text.secondary,
319
+ [`&.${Me.disabled}`]: { color: (e.vars || e).palette.action.disabled },
320
+ variants: [
321
+ {
322
+ props: {
323
+ color: "default",
324
+ disabled: !1,
325
+ disableRipple: !1
326
+ },
327
+ style: { "&:hover": { backgroundColor: e.alpha((e.vars || e).palette.action.active, (e.vars || e).palette.action.hoverOpacity) } }
328
+ },
329
+ ...Object.entries(e.palette).filter(s()).map(([t]) => ({
330
+ props: {
331
+ color: t,
332
+ disabled: !1,
333
+ disableRipple: !1
334
+ },
335
+ style: { "&:hover": { backgroundColor: e.alpha((e.vars || e).palette[t].main, (e.vars || e).palette.action.hoverOpacity) } }
336
+ })),
337
+ ...Object.entries(e.palette).filter(s()).map(([t]) => ({
338
+ props: {
339
+ color: t,
340
+ disabled: !1
341
+ },
342
+ style: { [`&.${Me.checked}`]: { color: (e.vars || e).palette[t].main } }
343
+ })),
344
+ {
345
+ props: { disableRipple: !1 },
346
+ style: { "&:hover": { "@media (hover: none)": { backgroundColor: "transparent" } } }
347
+ }
348
+ ]
349
+ })));
350
+ function Fe(e, t) {
351
+ return typeof t == "object" && t ? e === t : String(e) === String(t);
352
+ }
353
+ var Ie = /*#__PURE__*/ K(Oe, { checked: !0 }), Le = /*#__PURE__*/ K(Oe, {}), Re = /*#__PURE__*/ U.forwardRef(function(e, t) {
354
+ let n = H({
355
+ props: e,
356
+ name: "MuiRadio"
357
+ }), { checked: r, checkedIcon: i = Ie, color: a = "primary", icon: o = Le, name: s, onChange: c, size: l = "medium", className: d, disabled: f, disableRipple: p = !1, slots: m = {}, slotProps: h = {}, inputProps: g, ...v } = n, y = u(), b = f;
358
+ y && b === void 0 && (b = y.disabled), b ??= !1;
359
+ let x = {
360
+ ...n,
361
+ disabled: b,
362
+ disableRipple: p,
363
+ color: a,
364
+ size: l
365
+ }, S = Ne(x), C = Ae(), w = r, T = ue(c, C && C.onChange), E = s;
366
+ C && (w === void 0 && (w = Fe(C.value, n.value)), E === void 0 && (E = C.name));
367
+ let D = h.input ?? g, [k, A] = _("root", {
368
+ ref: t,
369
+ elementType: Pe,
370
+ className: O(S.root, d),
371
+ shouldForwardComponentProp: !0,
372
+ externalForwardedProps: {
373
+ slots: m,
374
+ slotProps: h,
375
+ ...v
376
+ },
377
+ getSlotProps: (e) => ({
378
+ ...e,
379
+ onChange: (t, ...n) => {
380
+ e.onChange?.(t, ...n), T(t, ...n);
381
+ }
382
+ }),
383
+ ownerState: x,
384
+ additionalProps: {
385
+ type: "radio",
386
+ icon: /*#__PURE__*/ U.cloneElement(o, { fontSize: o.props.fontSize ?? l }),
387
+ checkedIcon: /*#__PURE__*/ U.cloneElement(i, { fontSize: i.props.fontSize ?? l }),
388
+ disabled: b,
389
+ name: E,
390
+ checked: w,
391
+ slots: m,
392
+ slotProps: { input: typeof D == "function" ? D(x) : D }
393
+ }
394
+ });
395
+ return /*#__PURE__*/ K(k, {
396
+ ...A,
397
+ classes: S
398
+ });
399
+ });
400
+ //#endregion
401
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Switch/switchClasses.js
402
+ function ze(e) {
403
+ return k("MuiSwitch", e);
404
+ }
405
+ var Y = h("MuiSwitch", [
406
+ "root",
407
+ "edgeStart",
408
+ "edgeEnd",
409
+ "switchBase",
410
+ "colorPrimary",
411
+ "colorSecondary",
412
+ "sizeSmall",
413
+ "sizeMedium",
414
+ "checked",
415
+ "disabled",
416
+ "input",
417
+ "thumb",
418
+ "track"
419
+ ]), Be = (e) => {
420
+ let { classes: t, edge: n, size: r, color: i, checked: a, disabled: o } = e, s = B({
421
+ root: [
422
+ "root",
423
+ n && `edge${d(n)}`,
424
+ `size${d(r)}`
425
+ ],
426
+ switchBase: [
427
+ "switchBase",
428
+ `color${d(i)}`,
429
+ a && "checked",
430
+ o && "disabled"
431
+ ],
432
+ thumb: ["thumb"],
433
+ track: ["track"],
434
+ input: ["input"]
435
+ }, ze, t);
436
+ return {
437
+ ...t,
438
+ ...s
439
+ };
440
+ }, Ve = T("span", {
441
+ name: "MuiSwitch",
442
+ slot: "Root",
443
+ overridesResolver: (e, t) => {
444
+ let { ownerState: n } = e;
445
+ return [
446
+ t.root,
447
+ n.edge && t[`edge${d(n.edge)}`],
448
+ t[`size${d(n.size)}`]
449
+ ];
450
+ }
451
+ })({
452
+ display: "inline-flex",
453
+ width: 58,
454
+ height: 38,
455
+ overflow: "hidden",
456
+ padding: 12,
457
+ boxSizing: "border-box",
458
+ position: "relative",
459
+ flexShrink: 0,
460
+ zIndex: 0,
461
+ verticalAlign: "middle",
462
+ "@media print": { colorAdjust: "exact" },
463
+ variants: [
464
+ {
465
+ props: { edge: "start" },
466
+ style: { marginLeft: -8 }
467
+ },
468
+ {
469
+ props: { edge: "end" },
470
+ style: { marginRight: -8 }
471
+ },
472
+ {
473
+ props: { size: "small" },
474
+ style: {
475
+ width: 40,
476
+ height: 24,
477
+ padding: 7,
478
+ [`& .${Y.thumb}`]: {
479
+ width: 16,
480
+ height: 16
481
+ },
482
+ [`& .${Y.switchBase}`]: {
483
+ padding: 4,
484
+ [`&.${Y.checked}`]: { transform: "translateX(16px)" }
485
+ }
486
+ }
487
+ }
488
+ ]
489
+ }), He = T(M, {
490
+ name: "MuiSwitch",
491
+ slot: "SwitchBase",
492
+ overridesResolver: (e, t) => {
493
+ let { ownerState: n } = e;
494
+ return [
495
+ t.switchBase,
496
+ { [`& .${Y.input}`]: t.input },
497
+ n.color !== "default" && t[`color${d(n.color)}`]
498
+ ];
499
+ }
500
+ })(C(({ theme: e }) => ({
501
+ position: "absolute",
502
+ top: 0,
503
+ left: 0,
504
+ zIndex: 1,
505
+ color: e.vars ? e.vars.palette.Switch.defaultColor : `${e.palette.mode === "light" ? e.palette.common.white : e.palette.grey[300]}`,
506
+ transition: e.transitions.create(["left", "transform"], { duration: e.transitions.duration.shortest }),
507
+ [`&.${Y.checked}`]: { transform: "translateX(20px)" },
508
+ [`&.${Y.disabled}`]: { color: e.vars ? e.vars.palette.Switch.defaultDisabledColor : `${e.palette.mode === "light" ? e.palette.grey[100] : e.palette.grey[600]}` },
509
+ [`&.${Y.checked} + .${Y.track}`]: { opacity: .5 },
510
+ [`&.${Y.disabled} + .${Y.track}`]: { opacity: e.vars ? e.vars.opacity.switchTrackDisabled : `${e.palette.mode === "light" ? .12 : .2}` },
511
+ [`& .${Y.input}`]: {
512
+ left: "-100%",
513
+ width: "300%"
514
+ }
515
+ })), C(({ theme: e }) => ({
516
+ "&:hover": {
517
+ backgroundColor: e.alpha((e.vars || e).palette.action.active, (e.vars || e).palette.action.hoverOpacity),
518
+ "@media (hover: none)": { backgroundColor: "transparent" }
519
+ },
520
+ variants: [...Object.entries(e.palette).filter(s(["light"])).map(([t]) => ({
521
+ props: { color: t },
522
+ style: {
523
+ [`&.${Y.checked}`]: {
524
+ color: (e.vars || e).palette[t].main,
525
+ "&:hover": {
526
+ backgroundColor: e.alpha((e.vars || e).palette[t].main, (e.vars || e).palette.action.hoverOpacity),
527
+ "@media (hover: none)": { backgroundColor: "transparent" }
528
+ },
529
+ [`&.${Y.disabled}`]: { color: e.vars ? e.vars.palette.Switch[`${t}DisabledColor`] : `${e.palette.mode === "light" ? e.lighten(e.palette[t].main, .62) : e.darken(e.palette[t].main, .55)}` }
530
+ },
531
+ [`&.${Y.checked} + .${Y.track}`]: { backgroundColor: (e.vars || e).palette[t].main }
532
+ }
533
+ }))]
534
+ }))), Ue = T("span", {
535
+ name: "MuiSwitch",
536
+ slot: "Track"
537
+ })(C(({ theme: e }) => ({
538
+ height: "100%",
539
+ width: "100%",
540
+ borderRadius: 14 / 2,
541
+ boxSizing: "border-box",
542
+ border: "1px solid transparent",
543
+ zIndex: -1,
544
+ transition: e.transitions.create(["opacity", "background-color"], { duration: e.transitions.duration.shortest }),
545
+ backgroundColor: e.vars ? e.vars.palette.common.onBackground : `${e.palette.mode === "light" ? e.palette.common.black : e.palette.common.white}`,
546
+ opacity: e.vars ? e.vars.opacity.switchTrack : `${e.palette.mode === "light" ? .38 : .3}`
547
+ }))), We = T("span", {
548
+ name: "MuiSwitch",
549
+ slot: "Thumb"
550
+ })(C(({ theme: e }) => ({
551
+ boxShadow: (e.vars || e).shadows[1],
552
+ backgroundColor: "currentColor",
553
+ boxSizing: "border-box",
554
+ border: "1px solid transparent",
555
+ width: 20,
556
+ height: 20,
557
+ borderRadius: "50%"
558
+ }))), Ge = /*#__PURE__*/ U.forwardRef(function(e, t) {
559
+ let n = H({
560
+ props: e,
561
+ name: "MuiSwitch"
562
+ }), { className: r, color: i = "primary", edge: a = !1, size: o = "medium", sx: s, slots: c = {}, slotProps: l = {}, ...u } = n, d = {
563
+ ...n,
564
+ color: i,
565
+ edge: a,
566
+ size: o
567
+ }, f = Be(d), p = l.input, m = {
568
+ slots: c,
569
+ slotProps: l
570
+ }, [h, g] = _("root", {
571
+ className: O(f.root, r),
572
+ elementType: Ve,
573
+ externalForwardedProps: m,
574
+ ownerState: d,
575
+ additionalProps: { sx: s }
576
+ }), [v, b] = _("thumb", {
577
+ className: f.thumb,
578
+ elementType: We,
579
+ externalForwardedProps: m,
580
+ ownerState: d
581
+ }), x = /*#__PURE__*/ K(v, { ...b }), [S, C] = _("track", {
582
+ className: f.track,
583
+ elementType: Ue,
584
+ externalForwardedProps: m,
585
+ ownerState: d
586
+ });
587
+ return /*#__PURE__*/ q(h, {
588
+ ...g,
589
+ children: [/*#__PURE__*/ K(He, {
590
+ type: "checkbox",
591
+ icon: x,
592
+ checkedIcon: x,
593
+ ref: t,
594
+ ownerState: d,
595
+ ...u,
596
+ classes: {
597
+ ...f,
598
+ root: f.switchBase
599
+ },
600
+ slots: {
601
+ ...c.switchBase && { root: c.switchBase },
602
+ ...c.input && { input: c.input }
603
+ },
604
+ slotProps: {
605
+ ...l.switchBase && { root: typeof l.switchBase == "function" ? l.switchBase(d) : l.switchBase },
606
+ input: y(typeof p == "function" ? p(d) : p, { role: "switch" })
607
+ }
608
+ }), /*#__PURE__*/ K(S, { ...C })]
609
+ });
610
+ }), Ke = /* @__PURE__ */ e(o(), 1), X = /* @__PURE__ */ e(S(), 1), qe = T(he)(() => ({ "& .MuiFormControlLabel-label": {
611
+ left: "-5px",
612
+ position: "relative"
613
+ } })), Je = T(Re)(() => ({ color: `${E.tertiary()} !important` })), Ye = ({ label: e, value: t, checked: n, onChange: r }) => /* @__PURE__ */ K(qe, {
614
+ value: t,
615
+ control: /* @__PURE__ */ K(Je, {
616
+ checked: n,
617
+ onChange: r
618
+ }),
619
+ label: e
620
+ });
621
+ Ye.propTypes = {
622
+ label: X.default.string,
623
+ value: X.default.string,
624
+ checked: X.default.bool,
625
+ onChange: X.default.func
626
+ };
627
+ //#endregion
628
+ //#region ../../lib-react/config-ui/dist/tabs/index.js
629
+ var Xe = T(L)(() => ({})), Ze = class extends W.Component {
630
+ static propTypes = {
631
+ className: X.default.string,
632
+ contentClassName: X.default.string,
633
+ contentStyle: X.default.object,
634
+ children: X.default.oneOfType([X.default.arrayOf(X.default.node), X.default.node]).isRequired
635
+ };
636
+ constructor(e) {
637
+ super(e), this.state = { value: 0 };
638
+ }
639
+ handleChange = (e, t) => {
640
+ this.setState({ value: t });
641
+ };
642
+ render() {
643
+ let { value: e } = this.state, { children: t, className: n, contentClassName: r, contentStyle: i = {} } = this.props;
644
+ return /* @__PURE__ */ q("div", {
645
+ className: n,
646
+ children: [/* @__PURE__ */ K(re, {
647
+ indicatorColor: "primary",
648
+ value: e,
649
+ onChange: this.handleChange,
650
+ children: W.Children.map(t, (e, t) => e && e.props.title ? /* @__PURE__ */ K(Xe, { label: e.props.title }, t) : null)
651
+ }), /* @__PURE__ */ K("div", {
652
+ className: r,
653
+ style: i,
654
+ children: t[e]
655
+ })]
656
+ });
657
+ }
658
+ }, Qe = T(he)(({ theme: e, mini: t }) => ({
659
+ margin: 0,
660
+ marginLeft: 0,
661
+ padding: 0,
662
+ "& .MuiFormControlLabel-label": {
663
+ fontSize: e.typography.fontSize - 1,
664
+ transform: "translate(-4%, 2%)",
665
+ color: "rgba(0,0,0,1.0)",
666
+ ...t && {
667
+ marginLeft: e.spacing(1),
668
+ color: g[700],
669
+ fontSize: e.typography.fontSize - 3
670
+ }
671
+ }
672
+ })), $e = T(I)(({ theme: e, mini: t, error: n }) => ({
673
+ color: `${E.tertiary()} !important`,
674
+ ...t && {
675
+ margin: 0,
676
+ padding: 0,
677
+ width: e.spacing(3),
678
+ height: e.spacing(3)
679
+ },
680
+ ...n && { color: `${e.palette.error.main} !important` }
681
+ })), et = ({ mini: e, checked: t, onChange: n, value: r, label: i, error: a }) => /* @__PURE__ */ K(Qe, {
682
+ mini: e,
683
+ control: /* @__PURE__ */ K($e, {
684
+ checked: t,
685
+ onChange: n,
686
+ value: r,
687
+ mini: e,
688
+ error: a
689
+ }),
690
+ label: i
691
+ });
692
+ et.propTypes = {
693
+ mini: X.default.bool,
694
+ checked: X.default.bool.isRequired,
695
+ onChange: X.default.func.isRequired,
696
+ value: X.default.string,
697
+ label: X.default.string.isRequired,
698
+ error: X.default.bool
699
+ }, et.defaultProps = {
700
+ value: "",
701
+ mini: !1,
702
+ error: !1
703
+ };
704
+ //#endregion
705
+ //#region ../../lib-react/config-ui/dist/number-text-field.js
706
+ var tt = (0, Ke.default)("@pie-lib:config-ui:number-text-field"), nt = T(N)(({ theme: e }) => ({
707
+ marginRight: e.spacing(1),
708
+ "& .MuiInputLabel-root": {
709
+ width: "auto",
710
+ minWidth: "max-content",
711
+ maxWidth: "none",
712
+ whiteSpace: "nowrap",
713
+ overflow: "visible",
714
+ transform: "translate(0, 8px) scale(0.75)",
715
+ transformOrigin: "top left",
716
+ position: "relative"
717
+ },
718
+ "& .MuiInputBase-root, & .MuiInput-root, & .MuiFilledInput-root, & .MuiOutlinedInput-root": {
719
+ height: "auto",
720
+ minHeight: "auto",
721
+ marginTop: 0
722
+ },
723
+ "& .MuiInputBase-input": {
724
+ height: "auto",
725
+ minHeight: "auto",
726
+ padding: "6px 0 7px"
727
+ }
728
+ })), rt = (e, t) => {
729
+ if (!r(e) && !r(t)) return 0;
730
+ if (!r(e) && r(t)) return t;
731
+ if (r(e)) return e;
732
+ }, it = class extends W.Component {
733
+ static propTypes = {
734
+ disabled: X.default.bool,
735
+ className: X.default.string,
736
+ inputClassName: X.default.string,
737
+ onChange: X.default.func.isRequired,
738
+ value: X.default.number,
739
+ min: X.default.number,
740
+ max: X.default.number,
741
+ label: X.default.string,
742
+ suffix: X.default.string,
743
+ showErrorWhenOutsideRange: X.default.bool,
744
+ disableUnderline: X.default.bool,
745
+ variant: X.default.string
746
+ };
747
+ static defaultProps = { showErrorWhenOutsideRange: !1 };
748
+ constructor(e) {
749
+ super(e);
750
+ let t = this.clamp(e.value);
751
+ this.state = { value: t }, t !== e.value && this.props.onChange({}, t), this.onChange = this.onChange.bind(this);
752
+ }
753
+ UNSAFE_componentWillReceiveProps(e) {
754
+ let t = this.clamp(e.value, e.min, e.max);
755
+ this.setState({ value: t });
756
+ }
757
+ clamp(e, t = this.props.min, n = this.props.max) {
758
+ return r(e) ? (r(n) && (e = Math.min(e, n)), r(t) && (e = Math.max(e, t)), e) : rt(t, n);
759
+ }
760
+ onBlur = (e) => {
761
+ let t = e.target.value, n = parseFloat(t);
762
+ tt("rawNumber: ", n);
763
+ let r = this.clamp(n);
764
+ tt("number: ", r), r !== this.state.value && (tt("trigger update..."), this.setState({ value: r.toString() }, () => {
765
+ this.props.onChange(e, r);
766
+ }));
767
+ };
768
+ onChange(e) {
769
+ let t = e.target.value;
770
+ this.setState({ value: t });
771
+ }
772
+ errorMessage = () => {
773
+ let { min: e, max: t } = this.props;
774
+ if (e && t) return `The value must be between ${e} and ${t}`;
775
+ if (e) return `The value must be greater than ${e}`;
776
+ if (t) return `The value must be less than ${t}`;
777
+ };
778
+ getError = () => {
779
+ let { value: e } = this.state, t = parseFloat(e);
780
+ if (this.clamp(t) !== t) return this.errorMessage();
781
+ };
782
+ render() {
783
+ let { className: e, label: t, disabled: n, suffix: r, min: i, max: a, inputClassName: o, disableUnderline: s, showErrorWhenOutsideRange: c, variant: l } = this.props, u = c && this.getError();
784
+ return /* @__PURE__ */ K(nt, {
785
+ variant: s ? "filled" : l || "standard",
786
+ inputRef: (e) => {
787
+ this.inputRef = e;
788
+ },
789
+ disabled: n,
790
+ label: t,
791
+ InputLabelProps: { shrink: !0 },
792
+ value: this.state.value,
793
+ error: !!u,
794
+ helperText: u,
795
+ onChange: this.onChange,
796
+ onBlur: this.onBlur,
797
+ onKeyDown: (e) => {
798
+ e.key === "Enter" && this.inputRef && this.inputRef.blur();
799
+ },
800
+ type: "number",
801
+ className: e,
802
+ slotProps: { input: {
803
+ endAdornment: r && /* @__PURE__ */ K(Se, {
804
+ position: "end",
805
+ children: r
806
+ }),
807
+ className: o,
808
+ inputProps: {
809
+ min: i,
810
+ max: a
811
+ }
812
+ } },
813
+ margin: "normal"
814
+ });
815
+ }
816
+ }, at = (e) => typeof e == "object" && !!e && typeof e.n == "number" && typeof e.d == "number", ot = (e) => {
817
+ if (typeof e == "number") return e;
818
+ if (at(e)) return (e.s ?? 1) * e.n / e.d;
819
+ let t = String(e).trim(), n = t.match(/^([+-]?\d+)\s*\/\s*([+-]?\d+)$/);
820
+ return n ? Number.parseInt(n[1] ?? "0", 10) / Number.parseInt(n[2] ?? "1", 10) : Number(t);
821
+ }, st = x(/*#__PURE__*/ K("path", { d: "M19 13H5v-2h14z" }), "Remove"), ct = x(/*#__PURE__*/ K("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z" }), "Add"), lt = T(N)(() => ({
822
+ "& input[type=number]": { MozAppearance: "textfield" },
823
+ "& input[type=number]::-webkit-outer-spin-button": {
824
+ WebkitAppearance: "none",
825
+ margin: 0
826
+ },
827
+ "& input[type=number]::-webkit-inner-spin-button": {
828
+ WebkitAppearance: "none",
829
+ margin: 0
830
+ }
831
+ })), ut = T(j)(() => ({ padding: "2px" })), dt = (e, t) => {
832
+ if (!r(e) && !r(t)) return 0;
833
+ if (!r(e) && r(t)) return t;
834
+ if (r(e)) return e;
835
+ }, ft = class extends W.Component {
836
+ static propTypes = {
837
+ className: X.default.string,
838
+ customValues: X.default.array,
839
+ disabled: X.default.bool,
840
+ error: X.default.bool,
841
+ inputClassName: X.default.string,
842
+ helperText: X.default.string,
843
+ onChange: X.default.func.isRequired,
844
+ onlyIntegersAllowed: X.default.bool,
845
+ value: X.default.any,
846
+ min: X.default.number,
847
+ max: X.default.number,
848
+ step: X.default.number,
849
+ label: X.default.string,
850
+ disableUnderline: X.default.bool,
851
+ textAlign: X.default.string,
852
+ variant: X.default.string,
853
+ type: X.default.string
854
+ };
855
+ static defaultProps = {
856
+ step: 1,
857
+ customValues: [],
858
+ textAlign: "center",
859
+ variant: "standard",
860
+ onlyIntegersAllowed: !1
861
+ };
862
+ constructor(e) {
863
+ super(e);
864
+ let { value: t, currentIndex: n } = this.normalizeValueAndIndex(e.customValues, e.value);
865
+ this.state = {
866
+ value: t,
867
+ currentIndex: n
868
+ }, t !== e.value && this.props.onChange({}, t), this.onChange = this.onChange.bind(this);
869
+ }
870
+ UNSAFE_componentWillReceiveProps(e) {
871
+ let { value: t, currentIndex: n } = this.normalizeValueAndIndex(e.customValues, e.value, e.min, e.max);
872
+ this.setState({
873
+ value: t,
874
+ currentIndex: n
875
+ });
876
+ }
877
+ clamp(e, t = this.props.min, n = this.props.max) {
878
+ let { customValues: i } = this.props;
879
+ return (i || []).length > 0 ? e : r(e) ? (r(n) && (e = Math.min(e, n)), r(t) && (e = Math.max(e, t)), e) : dt(t, n);
880
+ }
881
+ normalizeValueAndIndex = (e, t, n, r) => {
882
+ let { type: i } = this.props, a = this.clamp(t, n, r), o = (e || []).findIndex((e) => e === a);
883
+ if ((e || []).length > 0 && o === -1) {
884
+ let t = i === "text" ? this.getClosestFractionValue(e, a) : this.getClosestValue(e, a);
885
+ return {
886
+ value: t.value,
887
+ currentIndex: t.index
888
+ };
889
+ }
890
+ return {
891
+ value: a,
892
+ currentIndex: o
893
+ };
894
+ };
895
+ getClosestValue = (e, t) => e.reduce((e, n, r) => Math.abs(n - t) < Math.abs(e.value - t) ? {
896
+ value: n,
897
+ index: r
898
+ } : e, {
899
+ value: e[0],
900
+ index: 0
901
+ });
902
+ getClosestFractionValue = (e, t) => e.reduce((e, n, r) => Math.abs(ot(n) - ot(t)) < Math.abs(ot(e.value) - ot(t)) ? {
903
+ value: n,
904
+ index: r
905
+ } : e, {
906
+ value: e[0],
907
+ index: 0
908
+ });
909
+ getValidFraction = (e) => {
910
+ if (this.isPositiveInteger(e.trim())) return e.trim();
911
+ if (e.trim() === "" || e.trim().split("/").length !== 2) return !1;
912
+ let [t, n] = e.trim().split("/");
913
+ return isNaN(t) || isNaN(n) || (t = parseFloat(t), n = parseFloat(n), !Number.isInteger(t) || !Number.isInteger(n)) || t < 0 || n < 1 ? !1 : t + "/" + n;
914
+ };
915
+ isPositiveInteger = (e) => e >>> 0 === parseFloat(e);
916
+ onBlur = (e) => {
917
+ let { customValues: t, onlyIntegersAllowed: n, type: r } = this.props, { value: i } = e.target;
918
+ r === "text" && (i = this.getValidFraction(i) || this.props.value);
919
+ let a = n ? Math.round(parseFloat(i)) : parseFloat(i);
920
+ r === "text" && (a = i.trim());
921
+ let { value: o, currentIndex: s } = this.normalizeValueAndIndex(t, a);
922
+ this.setState({
923
+ value: o.toString(),
924
+ currentIndex: s
925
+ }, () => this.props.onChange(e, o));
926
+ };
927
+ onChange(e) {
928
+ let { type: t } = this.props, { value: n } = e.target;
929
+ t !== "text" && typeof n == "string" && n.trim() === "" || this.setState({ value: n });
930
+ }
931
+ changeValue(e, t = 1, n = !1) {
932
+ e.preventDefault();
933
+ let { customValues: r, step: i, onlyIntegersAllowed: a, onChange: o } = this.props, { currentIndex: s, value: c } = this.state, l = s + t * 1, u;
934
+ if (r.length > 0) {
935
+ if (l < 0 || l >= r.length) return;
936
+ u = r[l];
937
+ } else {
938
+ let e = ((a ? parseInt(c) : parseFloat(c)) * 1e4 + i * t * 1e4) / 1e4;
939
+ u = this.clamp(e);
940
+ }
941
+ this.setState({
942
+ value: u.toString(),
943
+ currentIndex: l
944
+ }, () => {
945
+ n && o(e, u);
946
+ });
947
+ }
948
+ render() {
949
+ let { className: e, label: t, disabled: n, error: i, min: a, max: o, customValues: s, inputClassName: c, disableUnderline: l, helperText: u, variant: d, textAlign: f, type: p = "number" } = this.props, { value: m } = this.state, h = e, g = !1, _ = !1;
950
+ return s.length > 0 ? (g = m === s[0], _ = m === s[s.length - 1]) : r(a) && r(o) && (g = m === a, _ = m === o), /* @__PURE__ */ K(lt, {
951
+ variant: d,
952
+ inputRef: (e) => this.inputRef = e,
953
+ disabled: n,
954
+ label: t,
955
+ value: m,
956
+ error: i,
957
+ helperText: u,
958
+ onChange: this.onChange,
959
+ onBlur: this.onBlur,
960
+ onKeyPress: (e) => {
961
+ e.key === "Enter" && this.inputRef && this.inputRef.blur();
962
+ },
963
+ onKeyDown: (e) => {
964
+ e.key === "ArrowUp" && this.changeValue(e), e.key === "ArrowDown" && this.changeValue(e, -1);
965
+ },
966
+ title: "",
967
+ type: p,
968
+ className: h,
969
+ InputProps: {
970
+ className: c,
971
+ disableUnderline: l,
972
+ startAdornment: /* @__PURE__ */ K(Se, {
973
+ position: "start",
974
+ children: /* @__PURE__ */ K(ut, {
975
+ disabled: n || g,
976
+ onClick: (e) => this.changeValue(e, -1, !0),
977
+ size: "large",
978
+ children: /* @__PURE__ */ K(st, { fontSize: "small" })
979
+ })
980
+ }),
981
+ endAdornment: /* @__PURE__ */ K(Se, {
982
+ position: "end",
983
+ children: /* @__PURE__ */ K(ut, {
984
+ disabled: n || _,
985
+ onClick: (e) => this.changeValue(e, 1, !0),
986
+ size: "large",
987
+ children: /* @__PURE__ */ K(ct, { fontSize: "small" })
988
+ })
989
+ })
990
+ },
991
+ inputProps: {
992
+ style: { textAlign: f },
993
+ min: a,
994
+ max: o
995
+ }
996
+ });
997
+ }
998
+ };
999
+ //#endregion
1000
+ //#region ../../lib-react/config-ui/dist/two-choice.js
1001
+ function pt(e) {
1002
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
1003
+ }
1004
+ function mt(e, t) {
1005
+ return !e || pt(e) ? e : pt(e.default) ? e.default : t && pt(e[t]) ? e[t] : t && pt(e[t]?.default) ? e[t].default : e;
1006
+ }
1007
+ var ht = mt(c, "InputContainer") || mt(vt.InputContainer, "InputContainer"), gt = ie, _t = gt.default, vt = _t && typeof _t == "object" ? _t : gt, yt = T("div")(({ theme: e, direction: t }) => ({
1008
+ display: "flex",
1009
+ flexWrap: "wrap",
1010
+ paddingLeft: 0,
1011
+ marginTop: e.spacing(1),
1012
+ ...t === "vertical" && { flexDirection: "column" }
1013
+ })), bt = class extends W.Component {
1014
+ static propTypes = {
1015
+ header: X.default.string.isRequired,
1016
+ className: X.default.string,
1017
+ customLabel: X.default.func,
1018
+ opts: X.default.array.isRequired,
1019
+ value: X.default.string,
1020
+ onChange: X.default.func.isRequired,
1021
+ direction: X.default.oneOf(["horizontal", "vertical"])
1022
+ };
1023
+ handleChange = (e) => {
1024
+ this.props.onChange(e.currentTarget.value);
1025
+ };
1026
+ render() {
1027
+ let { header: e, className: t, customLabel: n, opts: r, value: i, direction: a } = this.props, o = r.map((e) => typeof e == "string" ? {
1028
+ label: e,
1029
+ value: e
1030
+ } : e), s = n || Ye;
1031
+ return /* @__PURE__ */ K(ht, {
1032
+ label: e,
1033
+ className: t,
1034
+ children: /* @__PURE__ */ K(yt, {
1035
+ direction: a,
1036
+ children: o.map((e, t) => /* @__PURE__ */ K(s, {
1037
+ value: e.value,
1038
+ checked: e.value === i,
1039
+ onChange: this.handleChange,
1040
+ label: e.label
1041
+ }, t))
1042
+ })
1043
+ });
1044
+ }
1045
+ }, xt = X.default.shape({
1046
+ label: X.default.string,
1047
+ value: X.default.string
1048
+ });
1049
+ (class extends W.Component {
1050
+ static propTypes = {
1051
+ header: X.default.string.isRequired,
1052
+ value: X.default.string.isRequired,
1053
+ onChange: X.default.func.isRequired,
1054
+ one: X.default.oneOfType([xt, X.default.string]),
1055
+ two: X.default.oneOfType([xt, X.default.string]),
1056
+ className: X.default.string,
1057
+ customLabel: X.default.func
1058
+ };
1059
+ render() {
1060
+ let { one: e, two: t, header: n, className: r, customLabel: i, value: a, onChange: o } = this.props;
1061
+ return /* @__PURE__ */ K(bt, {
1062
+ customLabel: i,
1063
+ header: n,
1064
+ className: r,
1065
+ opts: [e, t],
1066
+ value: a,
1067
+ onChange: o
1068
+ });
1069
+ }
1070
+ });
1071
+ //#endregion
1072
+ //#region ../../lib-react/config-ui/dist/_virtual/_rolldown/runtime.js
1073
+ var St = Object.defineProperty, Ct = (e, t) => {
1074
+ let n = {};
1075
+ for (var r in e) St(n, r, {
1076
+ get: e[r],
1077
+ enumerable: !0
1078
+ });
1079
+ return t || St(n, Symbol.toStringTag, { value: "Module" }), n;
1080
+ }, wt = T("div")(() => ({
1081
+ display: "flex",
1082
+ flexDirection: "column",
1083
+ position: "relative"
1084
+ })), Tt = T("div")(() => ({
1085
+ display: "flex",
1086
+ justifyContent: "space-between"
1087
+ })), Et = T("div")(({ theme: e }) => ({ padding: `${e.spacing(2)} 0` })), Dt = T("div")(() => ({ flex: "1" })), Ot = T("div")(({ theme: e }) => ({ marginLeft: e.spacing(2) })), kt = class extends W.Component {
1088
+ static propTypes = {
1089
+ mode: X.default.oneOf(["tabbed", "inline"]),
1090
+ secondary: X.default.oneOfType([X.default.arrayOf(X.default.node), X.default.node]),
1091
+ children: X.default.oneOfType([X.default.arrayOf(X.default.node), X.default.node]),
1092
+ dimensions: X.default.object
1093
+ };
1094
+ getConfiguration = () => {
1095
+ let { secondary: e } = this.props;
1096
+ return e?.props?.configuration || e?.props?.children?.props?.configuration || void 0;
1097
+ };
1098
+ render() {
1099
+ let { mode: e, secondary: t, children: n, dimensions: r } = this.props, { minHeight: i, minWidth: a, maxHeight: o, maxWidth: s } = r || {}, c = this.getConfiguration(), l = Object.entries(c || {}).some(([, e]) => !!e?.settings);
1100
+ if (!l) try {
1101
+ l = JSON.stringify(c)?.match(/settings":true/)?.length;
1102
+ } catch (e) {
1103
+ console.log(e.toString());
1104
+ }
1105
+ return /* @__PURE__ */ q(wt, {
1106
+ style: {
1107
+ minHeight: i,
1108
+ minWidth: a,
1109
+ maxHeight: o,
1110
+ maxWidth: s
1111
+ },
1112
+ children: [
1113
+ e === "inline" && /* @__PURE__ */ q(Tt, { children: [/* @__PURE__ */ K(Dt, {
1114
+ className: "design-container",
1115
+ children: n
1116
+ }), l && /* @__PURE__ */ K(Ot, {
1117
+ className: "settings-container",
1118
+ children: t
1119
+ })] }),
1120
+ e === "tabbed" && l && /* @__PURE__ */ q(Ze, {
1121
+ onChange: this.onTabsChange,
1122
+ contentClassName: "content-container",
1123
+ indicatorColor: "primary",
1124
+ children: [/* @__PURE__ */ K(Et, {
1125
+ title: "Design",
1126
+ className: "design-container",
1127
+ children: n
1128
+ }), /* @__PURE__ */ K(Et, {
1129
+ title: "Settings",
1130
+ className: "settings-container",
1131
+ children: t
1132
+ })]
1133
+ }),
1134
+ e === "tabbed" && !l && /* @__PURE__ */ K(Et, {
1135
+ className: "design-container",
1136
+ children: n
1137
+ })
1138
+ ]
1139
+ });
1140
+ }
1141
+ };
1142
+ //#endregion
1143
+ //#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js
1144
+ function At() {
1145
+ return At = Object.assign ? Object.assign.bind() : function(e) {
1146
+ for (var t = 1; t < arguments.length; t++) {
1147
+ var n = arguments[t];
1148
+ for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
1149
+ }
1150
+ return e;
1151
+ }, At.apply(null, arguments);
1152
+ }
1153
+ //#endregion
1154
+ //#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
1155
+ function jt(e, t) {
1156
+ if (e == null) return {};
1157
+ var n = {};
1158
+ for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
1159
+ if (t.indexOf(r) !== -1) continue;
1160
+ n[r] = e[r];
1161
+ }
1162
+ return n;
1163
+ }
1164
+ //#endregion
1165
+ //#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
1166
+ function Mt(e, t) {
1167
+ return Mt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
1168
+ return e.__proto__ = t, e;
1169
+ }, Mt(e, t);
1170
+ }
1171
+ //#endregion
1172
+ //#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
1173
+ function Nt(e, t) {
1174
+ e.prototype = Object.create(t.prototype), e.prototype.constructor = e, Mt(e, t);
1175
+ }
1176
+ //#endregion
1177
+ //#region ../../lib-react/config-ui/dist/node_modules/.bun/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
1178
+ var Pt = (function() {
1179
+ if (typeof Map < "u") return Map;
1180
+ function e(e, t) {
1181
+ var n = -1;
1182
+ return e.some(function(e, r) {
1183
+ return e[0] === t ? (n = r, !0) : !1;
1184
+ }), n;
1185
+ }
1186
+ return function() {
1187
+ function t() {
1188
+ this.__entries__ = [];
1189
+ }
1190
+ return Object.defineProperty(t.prototype, "size", {
1191
+ get: function() {
1192
+ return this.__entries__.length;
1193
+ },
1194
+ enumerable: !0,
1195
+ configurable: !0
1196
+ }), t.prototype.get = function(t) {
1197
+ var n = e(this.__entries__, t), r = this.__entries__[n];
1198
+ return r && r[1];
1199
+ }, t.prototype.set = function(t, n) {
1200
+ var r = e(this.__entries__, t);
1201
+ ~r ? this.__entries__[r][1] = n : this.__entries__.push([t, n]);
1202
+ }, t.prototype.delete = function(t) {
1203
+ var n = this.__entries__, r = e(n, t);
1204
+ ~r && n.splice(r, 1);
1205
+ }, t.prototype.has = function(t) {
1206
+ return !!~e(this.__entries__, t);
1207
+ }, t.prototype.clear = function() {
1208
+ this.__entries__.splice(0);
1209
+ }, t.prototype.forEach = function(e, t) {
1210
+ t === void 0 && (t = null);
1211
+ for (var n = 0, r = this.__entries__; n < r.length; n++) {
1212
+ var i = r[n];
1213
+ e.call(t, i[1], i[0]);
1214
+ }
1215
+ }, t;
1216
+ }();
1217
+ })(), Ft = typeof window < "u" && typeof document < "u" && window.document === document, It = (function() {
1218
+ return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")();
1219
+ })(), Lt = (function() {
1220
+ return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(It) : function(e) {
1221
+ return setTimeout(function() {
1222
+ return e(Date.now());
1223
+ }, 1e3 / 60);
1224
+ };
1225
+ })(), Rt = 2;
1226
+ function zt(e, t) {
1227
+ var n = !1, r = !1, i = 0;
1228
+ function a() {
1229
+ n && (n = !1, e()), r && s();
1230
+ }
1231
+ function o() {
1232
+ Lt(a);
1233
+ }
1234
+ function s() {
1235
+ var e = Date.now();
1236
+ if (n) {
1237
+ if (e - i < Rt) return;
1238
+ r = !0;
1239
+ } else n = !0, r = !1, setTimeout(o, t);
1240
+ i = e;
1241
+ }
1242
+ return s;
1243
+ }
1244
+ var Bt = 20, Vt = [
1245
+ "top",
1246
+ "right",
1247
+ "bottom",
1248
+ "left",
1249
+ "width",
1250
+ "height",
1251
+ "size",
1252
+ "weight"
1253
+ ], Ht = typeof MutationObserver < "u", Ut = function() {
1254
+ function e() {
1255
+ this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = zt(this.refresh.bind(this), Bt);
1256
+ }
1257
+ return e.prototype.addObserver = function(e) {
1258
+ ~this.observers_.indexOf(e) || this.observers_.push(e), this.connected_ || this.connect_();
1259
+ }, e.prototype.removeObserver = function(e) {
1260
+ var t = this.observers_, n = t.indexOf(e);
1261
+ ~n && t.splice(n, 1), !t.length && this.connected_ && this.disconnect_();
1262
+ }, e.prototype.refresh = function() {
1263
+ this.updateObservers_() && this.refresh();
1264
+ }, e.prototype.updateObservers_ = function() {
1265
+ var e = this.observers_.filter(function(e) {
1266
+ return e.gatherActive(), e.hasActive();
1267
+ });
1268
+ return e.forEach(function(e) {
1269
+ return e.broadcastActive();
1270
+ }), e.length > 0;
1271
+ }, e.prototype.connect_ = function() {
1272
+ !Ft || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), Ht ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
1273
+ attributes: !0,
1274
+ childList: !0,
1275
+ characterData: !0,
1276
+ subtree: !0
1277
+ })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
1278
+ }, e.prototype.disconnect_ = function() {
1279
+ !Ft || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
1280
+ }, e.prototype.onTransitionEnd_ = function(e) {
1281
+ var t = e.propertyName, n = t === void 0 ? "" : t;
1282
+ Vt.some(function(e) {
1283
+ return !!~n.indexOf(e);
1284
+ }) && this.refresh();
1285
+ }, e.getInstance = function() {
1286
+ return this.instance_ ||= new e(), this.instance_;
1287
+ }, e.instance_ = null, e;
1288
+ }(), Wt = (function(e, t) {
1289
+ for (var n = 0, r = Object.keys(t); n < r.length; n++) {
1290
+ var i = r[n];
1291
+ Object.defineProperty(e, i, {
1292
+ value: t[i],
1293
+ enumerable: !1,
1294
+ writable: !1,
1295
+ configurable: !0
1296
+ });
1297
+ }
1298
+ return e;
1299
+ }), Z = (function(e) {
1300
+ return e && e.ownerDocument && e.ownerDocument.defaultView || It;
1301
+ }), Gt = tn(0, 0, 0, 0);
1302
+ function Kt(e) {
1303
+ return parseFloat(e) || 0;
1304
+ }
1305
+ function qt(e) {
1306
+ return [...arguments].slice(1).reduce(function(t, n) {
1307
+ var r = e["border-" + n + "-width"];
1308
+ return t + Kt(r);
1309
+ }, 0);
1310
+ }
1311
+ function Jt(e) {
1312
+ for (var t = [
1313
+ "top",
1314
+ "right",
1315
+ "bottom",
1316
+ "left"
1317
+ ], n = {}, r = 0, i = t; r < i.length; r++) {
1318
+ var a = i[r], o = e["padding-" + a];
1319
+ n[a] = Kt(o);
1320
+ }
1321
+ return n;
1322
+ }
1323
+ function Yt(e) {
1324
+ var t = e.getBBox();
1325
+ return tn(0, 0, t.width, t.height);
1326
+ }
1327
+ function Xt(e) {
1328
+ var t = e.clientWidth, n = e.clientHeight;
1329
+ if (!t && !n) return Gt;
1330
+ var r = Z(e).getComputedStyle(e), i = Jt(r), a = i.left + i.right, o = i.top + i.bottom, s = Kt(r.width), c = Kt(r.height);
1331
+ if (r.boxSizing === "border-box" && (Math.round(s + a) !== t && (s -= qt(r, "left", "right") + a), Math.round(c + o) !== n && (c -= qt(r, "top", "bottom") + o)), !Qt(e)) {
1332
+ var l = Math.round(s + a) - t, u = Math.round(c + o) - n;
1333
+ Math.abs(l) !== 1 && (s -= l), Math.abs(u) !== 1 && (c -= u);
1334
+ }
1335
+ return tn(i.left, i.top, s, c);
1336
+ }
1337
+ var Zt = (function() {
1338
+ return typeof SVGGraphicsElement < "u" ? function(e) {
1339
+ return e instanceof Z(e).SVGGraphicsElement;
1340
+ } : function(e) {
1341
+ return e instanceof Z(e).SVGElement && typeof e.getBBox == "function";
1342
+ };
1343
+ })();
1344
+ function Qt(e) {
1345
+ return e === Z(e).document.documentElement;
1346
+ }
1347
+ function $t(e) {
1348
+ return Ft ? Zt(e) ? Yt(e) : Xt(e) : Gt;
1349
+ }
1350
+ function en(e) {
1351
+ var t = e.x, n = e.y, r = e.width, i = e.height, a = Object.create((typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object).prototype);
1352
+ return Wt(a, {
1353
+ x: t,
1354
+ y: n,
1355
+ width: r,
1356
+ height: i,
1357
+ top: n,
1358
+ right: t + r,
1359
+ bottom: i + n,
1360
+ left: t
1361
+ }), a;
1362
+ }
1363
+ function tn(e, t, n, r) {
1364
+ return {
1365
+ x: e,
1366
+ y: t,
1367
+ width: n,
1368
+ height: r
1369
+ };
1370
+ }
1371
+ var nn = function() {
1372
+ function e(e) {
1373
+ this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = tn(0, 0, 0, 0), this.target = e;
1374
+ }
1375
+ return e.prototype.isActive = function() {
1376
+ var e = $t(this.target);
1377
+ return this.contentRect_ = e, e.width !== this.broadcastWidth || e.height !== this.broadcastHeight;
1378
+ }, e.prototype.broadcastRect = function() {
1379
+ var e = this.contentRect_;
1380
+ return this.broadcastWidth = e.width, this.broadcastHeight = e.height, e;
1381
+ }, e;
1382
+ }(), rn = function() {
1383
+ function e(e, t) {
1384
+ var n = en(t);
1385
+ Wt(this, {
1386
+ target: e,
1387
+ contentRect: n
1388
+ });
1389
+ }
1390
+ return e;
1391
+ }(), an = function() {
1392
+ function e(e, t, n) {
1393
+ if (this.activeObservations_ = [], this.observations_ = new Pt(), typeof e != "function") throw TypeError("The callback provided as parameter 1 is not a function.");
1394
+ this.callback_ = e, this.controller_ = t, this.callbackCtx_ = n;
1395
+ }
1396
+ return e.prototype.observe = function(e) {
1397
+ if (!arguments.length) throw TypeError("1 argument required, but only 0 present.");
1398
+ if (!(typeof Element > "u" || !(Element instanceof Object))) {
1399
+ if (!(e instanceof Z(e).Element)) throw TypeError("parameter 1 is not of type \"Element\".");
1400
+ var t = this.observations_;
1401
+ t.has(e) || (t.set(e, new nn(e)), this.controller_.addObserver(this), this.controller_.refresh());
1402
+ }
1403
+ }, e.prototype.unobserve = function(e) {
1404
+ if (!arguments.length) throw TypeError("1 argument required, but only 0 present.");
1405
+ if (!(typeof Element > "u" || !(Element instanceof Object))) {
1406
+ if (!(e instanceof Z(e).Element)) throw TypeError("parameter 1 is not of type \"Element\".");
1407
+ var t = this.observations_;
1408
+ t.has(e) && (t.delete(e), t.size || this.controller_.removeObserver(this));
1409
+ }
1410
+ }, e.prototype.disconnect = function() {
1411
+ this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
1412
+ }, e.prototype.gatherActive = function() {
1413
+ var e = this;
1414
+ this.clearActive(), this.observations_.forEach(function(t) {
1415
+ t.isActive() && e.activeObservations_.push(t);
1416
+ });
1417
+ }, e.prototype.broadcastActive = function() {
1418
+ if (this.hasActive()) {
1419
+ var e = this.callbackCtx_, t = this.activeObservations_.map(function(e) {
1420
+ return new rn(e.target, e.broadcastRect());
1421
+ });
1422
+ this.callback_.call(e, t, e), this.clearActive();
1423
+ }
1424
+ }, e.prototype.clearActive = function() {
1425
+ this.activeObservations_.splice(0);
1426
+ }, e.prototype.hasActive = function() {
1427
+ return this.activeObservations_.length > 0;
1428
+ }, e;
1429
+ }(), on = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new Pt(), sn = function() {
1430
+ function e(t) {
1431
+ if (!(this instanceof e)) throw TypeError("Cannot call a class as a function.");
1432
+ if (!arguments.length) throw TypeError("1 argument required, but only 0 present.");
1433
+ var n = new an(t, Ut.getInstance(), this);
1434
+ on.set(this, n);
1435
+ }
1436
+ return e;
1437
+ }();
1438
+ [
1439
+ "observe",
1440
+ "unobserve",
1441
+ "disconnect"
1442
+ ].forEach(function(e) {
1443
+ sn.prototype[e] = function() {
1444
+ var t;
1445
+ return (t = on.get(this))[e].apply(t, arguments);
1446
+ };
1447
+ });
1448
+ var cn = (function() {
1449
+ return It.ResizeObserver === void 0 ? sn : It.ResizeObserver;
1450
+ })(), ln = [
1451
+ "client",
1452
+ "offset",
1453
+ "scroll",
1454
+ "bounds",
1455
+ "margin"
1456
+ ];
1457
+ function un(e) {
1458
+ var t = [];
1459
+ return ln.forEach(function(n) {
1460
+ e[n] && t.push(n);
1461
+ }), t;
1462
+ }
1463
+ function dn(e, t) {
1464
+ var n = {};
1465
+ if (t.indexOf("client") > -1 && (n.client = {
1466
+ top: e.clientTop,
1467
+ left: e.clientLeft,
1468
+ width: e.clientWidth,
1469
+ height: e.clientHeight
1470
+ }), t.indexOf("offset") > -1 && (n.offset = {
1471
+ top: e.offsetTop,
1472
+ left: e.offsetLeft,
1473
+ width: e.offsetWidth,
1474
+ height: e.offsetHeight
1475
+ }), t.indexOf("scroll") > -1 && (n.scroll = {
1476
+ top: e.scrollTop,
1477
+ left: e.scrollLeft,
1478
+ width: e.scrollWidth,
1479
+ height: e.scrollHeight
1480
+ }), t.indexOf("bounds") > -1) {
1481
+ var r = e.getBoundingClientRect();
1482
+ n.bounds = {
1483
+ top: r.top,
1484
+ right: r.right,
1485
+ bottom: r.bottom,
1486
+ left: r.left,
1487
+ width: r.width,
1488
+ height: r.height
1489
+ };
1490
+ }
1491
+ if (t.indexOf("margin") > -1) {
1492
+ var i = getComputedStyle(e);
1493
+ n.margin = {
1494
+ top: i ? parseInt(i.marginTop) : 0,
1495
+ right: i ? parseInt(i.marginRight) : 0,
1496
+ bottom: i ? parseInt(i.marginBottom) : 0,
1497
+ left: i ? parseInt(i.marginLeft) : 0
1498
+ };
1499
+ }
1500
+ return n;
1501
+ }
1502
+ function fn(e) {
1503
+ return e && e.ownerDocument && e.ownerDocument.defaultView || window;
1504
+ }
1505
+ function pn(e) {
1506
+ return function(t) {
1507
+ var n, r;
1508
+ return r = n = /*#__PURE__*/ function(n) {
1509
+ Nt(r, n);
1510
+ function r() {
1511
+ var t, r = [...arguments];
1512
+ return t = n.call.apply(n, [this].concat(r)) || this, t.state = { contentRect: {
1513
+ entry: {},
1514
+ client: {},
1515
+ offset: {},
1516
+ scroll: {},
1517
+ bounds: {},
1518
+ margin: {}
1519
+ } }, t._animationFrameID = null, t._resizeObserver = null, t._node = null, t._window = null, t.measure = function(n) {
1520
+ var r = dn(t._node, e || un(t.props));
1521
+ n && (r.entry = n[0].contentRect), t._animationFrameID = t._window.requestAnimationFrame(function() {
1522
+ t._resizeObserver !== null && (t.setState({ contentRect: r }), typeof t.props.onResize == "function" && t.props.onResize(r));
1523
+ });
1524
+ }, t._handleRef = function(e) {
1525
+ t._resizeObserver !== null && t._node !== null && t._resizeObserver.unobserve(t._node), t._node = e, t._window = fn(t._node);
1526
+ var n = t.props.innerRef;
1527
+ n && (typeof n == "function" ? n(t._node) : n.current = t._node), t._resizeObserver !== null && t._node !== null && t._resizeObserver.observe(t._node);
1528
+ }, t;
1529
+ }
1530
+ var i = r.prototype;
1531
+ return i.componentDidMount = function() {
1532
+ this._resizeObserver = this._window !== null && this._window.ResizeObserver ? new this._window.ResizeObserver(this.measure) : new cn(this.measure), this._node !== null && (this._resizeObserver.observe(this._node), typeof this.props.onResize == "function" && this.props.onResize(dn(this._node, e || un(this.props))));
1533
+ }, i.componentWillUnmount = function() {
1534
+ this._window !== null && this._window.cancelAnimationFrame(this._animationFrameID), this._resizeObserver !== null && (this._resizeObserver.disconnect(), this._resizeObserver = null);
1535
+ }, i.render = function() {
1536
+ var e = this.props;
1537
+ return e.innerRef, e.onResize, oe(t, At({}, jt(e, ["innerRef", "onResize"]), {
1538
+ measureRef: this._handleRef,
1539
+ measure: this.measure,
1540
+ contentRect: this.state.contentRect
1541
+ }));
1542
+ }, r;
1543
+ }(G), n.propTypes = {
1544
+ client: X.default.bool,
1545
+ offset: X.default.bool,
1546
+ scroll: X.default.bool,
1547
+ bounds: X.default.bool,
1548
+ margin: X.default.bool,
1549
+ innerRef: X.default.oneOfType([X.default.object, X.default.func]),
1550
+ onResize: X.default.func
1551
+ }, r;
1552
+ };
1553
+ }
1554
+ var mn = pn()(function(e) {
1555
+ var t = e.measure, n = e.measureRef, r = e.contentRect, i = e.children;
1556
+ return i({
1557
+ measure: t,
1558
+ measureRef: n,
1559
+ contentRect: r
1560
+ });
1561
+ });
1562
+ mn.displayName = "Measure", mn.propTypes.children = X.default.func;
1563
+ //#endregion
1564
+ //#region ../../lib-react/config-ui/dist/layout/settings-box.js
1565
+ var hn = T("div")(() => ({
1566
+ backgroundColor: E.white(),
1567
+ border: `2px solid ${E.border()}`,
1568
+ display: "flex",
1569
+ flexDirection: "column",
1570
+ justifyContent: "flex-start",
1571
+ minWidth: "275px",
1572
+ maxWidth: "300px",
1573
+ padding: "20px 4px 4px 20px",
1574
+ zIndex: 99
1575
+ })), gn = class extends W.Component {
1576
+ static propTypes = {
1577
+ className: X.default.string,
1578
+ children: X.default.oneOfType([X.default.arrayOf(X.default.node), X.default.node]).isRequired
1579
+ };
1580
+ static defaultProps = {};
1581
+ render() {
1582
+ let { className: e, children: t } = this.props;
1583
+ return /* @__PURE__ */ K(hn, {
1584
+ className: e,
1585
+ children: t
1586
+ });
1587
+ }
1588
+ }, _n = f({
1589
+ typography: { fontFamily: "inherit" },
1590
+ components: { MuiButton: { styleOverrides: { contained: {
1591
+ backgroundColor: "#e0e0e0",
1592
+ color: "#000000",
1593
+ "&:hover": { backgroundColor: "#bdbdbd" }
1594
+ } } } }
1595
+ }), vn = class extends W.Component {
1596
+ static propTypes = {
1597
+ children: X.default.oneOfType([
1598
+ X.default.string,
1599
+ X.default.arrayOf(X.default.element),
1600
+ X.default.element
1601
+ ]),
1602
+ className: X.default.string,
1603
+ dimensions: X.default.object,
1604
+ settings: X.default.element,
1605
+ sidePanelMinWidth: X.default.number,
1606
+ hideSettings: X.default.bool,
1607
+ extraCSSRules: X.default.shape({
1608
+ names: X.default.arrayOf(X.default.string),
1609
+ rules: X.default.string
1610
+ })
1611
+ };
1612
+ static defaultProps = {
1613
+ sidePanelMinWidth: 1135,
1614
+ hideSettings: !1,
1615
+ dimensions: {}
1616
+ };
1617
+ constructor(...e) {
1618
+ super(...e), this.state = { layoutMode: void 0 };
1619
+ }
1620
+ onResize = (e) => {
1621
+ let { bounds: t } = e, { sidePanelMinWidth: n, dimensions: r } = this.props, { maxWidth: i } = r || {}, a = t.width > n && (!i || i > n) ? "inline" : "tabbed";
1622
+ a !== this.state.layoutMode && this.setState({ layoutMode: a });
1623
+ };
1624
+ render() {
1625
+ return /* @__PURE__ */ K(A, {
1626
+ injectFirst: !0,
1627
+ children: /* @__PURE__ */ K(p, {
1628
+ theme: _n,
1629
+ children: /* @__PURE__ */ K(mn, {
1630
+ bounds: !0,
1631
+ onResize: this.onResize,
1632
+ children: ({ measureRef: e }) => {
1633
+ let { children: t, settings: n, hideSettings: r, dimensions: i, extraCSSRules: a } = this.props, { layoutMode: o } = this.state, s = r ? null : o === "inline" ? /* @__PURE__ */ K(gn, {
1634
+ className: "settings-box",
1635
+ children: n
1636
+ }) : n;
1637
+ return /* @__PURE__ */ q("div", {
1638
+ ref: e,
1639
+ className: "main-container extraCSSRules",
1640
+ children: [a?.rules ? /* @__PURE__ */ K("style", { dangerouslySetInnerHTML: { __html: `.extraCSSRules { ${a.rules} }` } }) : null, /* @__PURE__ */ K(kt, {
1641
+ mode: o,
1642
+ secondary: s,
1643
+ dimensions: i,
1644
+ children: t
1645
+ })]
1646
+ });
1647
+ }
1648
+ })
1649
+ })
1650
+ });
1651
+ }
1652
+ }, yn = pn("bounds")(vn), bn = /* @__PURE__ */ Ct({
1653
+ ConfigLayout: () => yn,
1654
+ LayoutContents: () => kt
1655
+ }), xn = T("div")(() => ({
1656
+ display: "flex",
1657
+ width: "100%",
1658
+ justifyContent: "space-between"
1659
+ })), Sn = T(w)(({ theme: e }) => ({
1660
+ color: "rgba(0, 0, 0, 0.89)",
1661
+ fontSize: e.typography.fontSize,
1662
+ paddingTop: e.spacing(2)
1663
+ })), Cn = T(Ge)(({ checked: e }) => ({
1664
+ "&.Mui-checked .MuiSwitch-thumb": { color: `${E.tertiary()} !important` },
1665
+ "&.Mui-checked .MuiSwitch-track": { backgroundColor: `${E.tertiaryLight()} !important` },
1666
+ "& .MuiSwitch-track": { backgroundColor: e ? `${E.tertiaryLight()} !important` : void 0 }
1667
+ })), wn = ({ checked: e, disabled: t, label: n, toggle: r }) => /* @__PURE__ */ q(xn, { children: [/* @__PURE__ */ K(Sn, { children: n }), /* @__PURE__ */ K(Cn, {
1668
+ checked: e,
1669
+ disabled: t,
1670
+ onChange: (e) => r(e.target.checked)
1671
+ })] });
1672
+ wn.propTypes = {
1673
+ checked: X.default.bool,
1674
+ disabled: X.default.bool,
1675
+ label: X.default.string.isRequired,
1676
+ toggle: X.default.func.isRequired
1677
+ };
1678
+ //#endregion
1679
+ //#region ../../lib-react/config-ui/dist/settings/settings-radio-label.js
1680
+ var Tn = T(he)(({ theme: e }) => ({ "& .MuiFormControlLabel-label": {
1681
+ color: "rgba(0, 0, 0, 0.89)",
1682
+ fontSize: e.typography.fontSize - 2,
1683
+ left: "-5px",
1684
+ position: "relative"
1685
+ } })), En = T(Re)(() => ({ color: `${E.tertiary()} !important` })), Dn = ({ label: e, value: t, checked: n, onChange: r }) => /* @__PURE__ */ K(Tn, {
1686
+ value: t,
1687
+ control: /* @__PURE__ */ K(En, {
1688
+ checked: n,
1689
+ onChange: r
1690
+ }),
1691
+ label: e
1692
+ });
1693
+ Dn.propTypes = {
1694
+ label: X.default.string,
1695
+ value: X.default.string,
1696
+ checked: X.default.bool,
1697
+ onChange: X.default.func
1698
+ };
1699
+ //#endregion
1700
+ //#region ../../lib-react/config-ui/dist/settings/panel.js
1701
+ var On = (0, Ke.default)("pie-lib:config-ui:settings:panel"), kn = {
1702
+ label: X.default.string,
1703
+ value: X.default.string
1704
+ }, Q = {
1705
+ label: X.default.string,
1706
+ value: X.default.string,
1707
+ onChange: X.default.func
1708
+ }, An = ({ label: e, value: t, onChange: n }) => /* @__PURE__ */ K(et, {
1709
+ checked: t,
1710
+ label: e,
1711
+ onChange: (e) => {
1712
+ n(e.target.checked);
1713
+ }
1714
+ });
1715
+ An.propTypes = {
1716
+ label: X.default.string,
1717
+ value: X.default.bool,
1718
+ onChange: X.default.func
1719
+ };
1720
+ var jn = T(bt)(({ theme: e }) => ({
1721
+ marginTop: e.spacing(.5),
1722
+ paddingBottom: e.spacing(.5),
1723
+ width: "100%",
1724
+ "& > label": {
1725
+ color: "rgba(0, 0, 0, 0.89)",
1726
+ transform: "translate(0, 10px) scale(1)",
1727
+ fontSize: "18px",
1728
+ marginTop: e.spacing(2.5)
1729
+ },
1730
+ "& > div": { marginTop: e.spacing(2.5) }
1731
+ })), Mn = ({ label: e, value: t, onChange: n, choices: r }) => /* @__PURE__ */ K(jn, {
1732
+ direction: "horizontal",
1733
+ customLabel: Dn,
1734
+ value: t,
1735
+ header: e,
1736
+ opts: r,
1737
+ onChange: n
1738
+ });
1739
+ Mn.propTypes = {
1740
+ ...Q,
1741
+ choices: X.default.arrayOf(X.default.shape(kn))
1742
+ };
1743
+ var Nn = Mn, Pn = T("p")(({ theme: e }) => ({
1744
+ margin: 0,
1745
+ fontSize: e.typography.fontSize
1746
+ })), Fn = T(z)(({ theme: e }) => ({
1747
+ marginTop: e.spacing(.5),
1748
+ border: "2px solid lightgrey",
1749
+ padding: `0 ${e.spacing(1)}`,
1750
+ borderRadius: "4px"
1751
+ })), In = ({ label: e, value: t, onChange: n, choices: r = [] }) => {
1752
+ let i = (e) => typeof e == "string" ? e : e.label, a = (e) => typeof e == "string" ? e : e.value;
1753
+ return /* @__PURE__ */ q("div", { children: [e && /* @__PURE__ */ K(Pn, { children: e }), /* @__PURE__ */ K(Fn, {
1754
+ value: t || r && r[0],
1755
+ onChange: ({ target: e }) => n(e.value),
1756
+ input: /* @__PURE__ */ K(te, { id: `dropdown-${e}` }),
1757
+ disableUnderline: !0,
1758
+ MenuProps: { transitionDuration: {
1759
+ enter: 225,
1760
+ exit: 195
1761
+ } },
1762
+ children: r.map((e, t) => /* @__PURE__ */ K(P, {
1763
+ value: a(e),
1764
+ children: i(e)
1765
+ }, t))
1766
+ })] });
1767
+ };
1768
+ In.propTypes = {
1769
+ ...Q,
1770
+ choices: X.default.arrayOf(X.default.string)
1771
+ };
1772
+ var Ln = T(F)(({ theme: e }) => ({
1773
+ marginRight: e.spacing(3),
1774
+ marginTop: e.spacing(1)
1775
+ })), Rn = ({ label: e }) => /* @__PURE__ */ K(Ln, { children: e }), zn = T(it)(({ theme: e }) => ({
1776
+ width: "35%",
1777
+ marginRight: e.spacing(3),
1778
+ marginTop: e.spacing(1),
1779
+ "& .MuiInputBase-root": {
1780
+ marginTop: e.spacing(.5),
1781
+ border: "2px solid lightgrey",
1782
+ borderRadius: "4px",
1783
+ padding: `0 ${e.spacing(1)}`,
1784
+ backgroundColor: "transparent"
1785
+ }
1786
+ })), Bn = ({ label: e, value: t, onChange: n = () => {}, suffix: r, min: i, max: a }) => /* @__PURE__ */ K(zn, {
1787
+ variant: "standard",
1788
+ label: e || "Label",
1789
+ value: t,
1790
+ max: a,
1791
+ min: i,
1792
+ onChange: (e, t) => n(t),
1793
+ suffix: r,
1794
+ showErrorWhenOutsideRange: !0,
1795
+ disableUnderline: !0
1796
+ });
1797
+ Bn.propTypes = {
1798
+ ...Q,
1799
+ suffix: X.default.string,
1800
+ min: X.default.number,
1801
+ max: X.default.number,
1802
+ value: X.default.number
1803
+ }, Rn.propTypes = { ...Q };
1804
+ var Vn = ({ disabled: e, label: t, value: n, onChange: r }) => /* @__PURE__ */ K(wn, {
1805
+ label: t,
1806
+ checked: !!n,
1807
+ disabled: !!e,
1808
+ toggle: r
1809
+ });
1810
+ Vn.propTypes = {
1811
+ ...Q,
1812
+ value: X.default.bool
1813
+ };
1814
+ var Hn = {
1815
+ toggle: Vn,
1816
+ radio: Nn,
1817
+ dropdown: In,
1818
+ numberField: Bn,
1819
+ checkbox: An,
1820
+ textField: Rn
1821
+ }, Un = T("div")(({ theme: e }) => ({ margin: `0 0 ${e.spacing(2)} 0` })), Wn = T("div")(({ theme: e }) => ({
1822
+ color: "#495B8F",
1823
+ fontSize: e.typography.fontSize + 2,
1824
+ fontWeight: 600,
1825
+ marginBottom: e.spacing(1)
1826
+ })), Gn = T("p")(({ theme: e }) => ({
1827
+ fontSize: e.typography.fontSize,
1828
+ marginBottom: 0
1829
+ })), Kn = (e) => {
1830
+ let { model: t, label: r, group: i, configuration: a, onChange: o } = e, s = (e, r, i) => {
1831
+ let { isConfigProperty: s, ...c } = n(e, i || r), l = n(s ? a : t, r), u = {
1832
+ ...c,
1833
+ key: r,
1834
+ value: l
1835
+ }, d = Hn[u.type];
1836
+ return /* @__PURE__ */ K(d, {
1837
+ ...u,
1838
+ onChange: (e) => o(r, e, s)
1839
+ }, r);
1840
+ }, c = (e, t) => {
1841
+ let n = e[t];
1842
+ if (!n) return null;
1843
+ let { type: r, label: i, fields: a, choices: o } = n;
1844
+ return r === "numberFields" ? /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(Gn, { children: i }), Object.keys(a).map((n) => s(e, `${t}.${n}`, `${t}.fields.${n}`))] }, `numberField-${i}`) : r === "checkboxes" ? /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("p", { children: i }), Object.keys(o).map((n) => s(e, `${t}.${n}`, `${t}.choices.${n}`))] }, `checkbox-${i}`) : s(e, t);
1845
+ };
1846
+ return /* @__PURE__ */ q(Un, { children: [/* @__PURE__ */ K(Wn, { children: r }), Object.keys(i).map((e) => c(i, e))] });
1847
+ };
1848
+ Kn.propTypes = {
1849
+ model: X.default.object,
1850
+ label: X.default.string,
1851
+ group: X.default.object,
1852
+ configuration: X.default.object,
1853
+ onChange: X.default.func
1854
+ };
1855
+ var qn = class extends W.Component {
1856
+ static propTypes = {
1857
+ model: X.default.object,
1858
+ configuration: X.default.object,
1859
+ groups: X.default.object,
1860
+ onChangeModel: X.default.func,
1861
+ onChangeConfiguration: X.default.func,
1862
+ modal: X.default.object
1863
+ };
1864
+ static defaultProps = {
1865
+ onChangeModel: () => {},
1866
+ onChangeConfiguration: () => {}
1867
+ };
1868
+ change = (e, t, n = !1) => {
1869
+ On("[changeModel]", e, t);
1870
+ let { onChangeModel: r, onChangeConfiguration: a } = this.props, o = { ...this.props.model }, s = { ...this.props.configuration };
1871
+ n ? (i(s, e, t), a(s, e)) : (i(o, e, t), r(o, e));
1872
+ };
1873
+ render() {
1874
+ let { groups: e, model: t, configuration: n, modal: r } = this.props;
1875
+ return On("render:", t), /* @__PURE__ */ q("div", { children: [Object.keys(e || {}).map((r) => Object.entries(e[r]).some(([, e]) => !!e) ? /* @__PURE__ */ K(Kn, {
1876
+ label: r,
1877
+ model: t,
1878
+ configuration: n,
1879
+ group: e[r],
1880
+ onChange: this.change
1881
+ }, r) : null), r] });
1882
+ }
1883
+ }, Jn = /* @__PURE__ */ Ct({
1884
+ Panel: () => qn,
1885
+ checkbox: () => nr,
1886
+ checkboxes: () => rr,
1887
+ dropdown: () => $n,
1888
+ numberField: () => er,
1889
+ numberFields: () => tr,
1890
+ radio: () => Qn,
1891
+ textField: () => Yn,
1892
+ toggle: () => Xn
1893
+ }), Yn = (e, t = !0) => ({
1894
+ label: e,
1895
+ type: "textField",
1896
+ isConfigProperty: t
1897
+ }), Xn = (e, t = !1, n = !1) => ({
1898
+ type: "toggle",
1899
+ label: e,
1900
+ isConfigProperty: t,
1901
+ disabled: n
1902
+ }), Zn = (e) => typeof e == "string" ? {
1903
+ label: e,
1904
+ value: e
1905
+ } : e, Qn = function() {
1906
+ let [e, t, n = !1] = Array.prototype.slice.call(arguments);
1907
+ return {
1908
+ type: "radio",
1909
+ label: e,
1910
+ choices: t && t.map((e) => Zn(e)),
1911
+ isConfigProperty: n
1912
+ };
1913
+ }, $n = (e, t, n = !1) => ({
1914
+ type: "dropdown",
1915
+ label: e,
1916
+ choices: t,
1917
+ isConfigProperty: n
1918
+ }), er = (e, t, n = !1) => ({
1919
+ ...t,
1920
+ label: e,
1921
+ type: "numberField",
1922
+ isConfigProperty: n
1923
+ }), tr = (e, t, n = !1) => (Object.keys(t).map((e) => {
1924
+ t[e] = er(t[e].label, t[e], n);
1925
+ }), {
1926
+ type: "numberFields",
1927
+ label: e,
1928
+ fields: t
1929
+ }), nr = (e, t, n = !1) => ({
1930
+ ...t,
1931
+ label: e,
1932
+ type: "checkbox",
1933
+ isConfigProperty: n
1934
+ }), rr = (e, t, n = !1) => (Object.keys(t).map((e) => {
1935
+ t[e] = nr(t[e].label, t[e], n);
1936
+ }), {
1937
+ type: "checkboxes",
1938
+ label: e,
1939
+ choices: t
1940
+ });
1941
+ //#endregion
1942
+ //#region ../../lib-react/config-ui/dist/index.js
1943
+ function ir(e) {
1944
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
1945
+ }
1946
+ function ar(e, t) {
1947
+ return !e || ir(e) ? e : ir(e.default) ? e.default : t && ir(e[t]) ? e[t] : t && ir(e[t]?.default) ? e[t].default : e;
1948
+ }
1949
+ var or = ar(c, "InputContainer") || ar(lr.InputContainer, "InputContainer"), sr = ie, cr = sr.default, lr = cr && typeof cr == "object" ? cr : sr, ur = T("div")(() => ({ width: "160px" })), dr = T(ae)(() => ({ width: "160px" })), fr = T(w)(() => ({ backgroundColor: "transparent" })), pr = ({ onChange: e, value: t, availableChartTypes: n, chartTypeLabel: r }) => /* @__PURE__ */ K(ur, { children: /* @__PURE__ */ q(dr, {
1950
+ variant: "outlined",
1951
+ children: [/* @__PURE__ */ K(fr, {
1952
+ id: "type-helper-label",
1953
+ children: r
1954
+ }), /* @__PURE__ */ q(z, {
1955
+ labelId: "type-helper-label",
1956
+ id: "type-helper-label-select",
1957
+ name: "chartType",
1958
+ value: t,
1959
+ onChange: e,
1960
+ label: r,
1961
+ MenuProps: { transitionDuration: {
1962
+ enter: 225,
1963
+ exit: 195
1964
+ } },
1965
+ children: [
1966
+ n?.histogram && /* @__PURE__ */ K(P, {
1967
+ value: "histogram",
1968
+ children: n.histogram
1969
+ }),
1970
+ n?.bar && /* @__PURE__ */ K(P, {
1971
+ value: "bar",
1972
+ children: n.bar
1973
+ }),
1974
+ n?.lineDot && /* @__PURE__ */ K(P, {
1975
+ value: "lineDot",
1976
+ children: n.lineDot
1977
+ }),
1978
+ n?.lineCross && /* @__PURE__ */ K(P, {
1979
+ value: "lineCross",
1980
+ children: n.lineCross
1981
+ }),
1982
+ n?.dotPlot && /* @__PURE__ */ K(P, {
1983
+ value: "dotPlot",
1984
+ children: n.dotPlot
1985
+ }),
1986
+ n?.linePlot && /* @__PURE__ */ K(P, {
1987
+ value: "linePlot",
1988
+ children: n.linePlot
1989
+ })
1990
+ ]
1991
+ })]
1992
+ }) });
1993
+ pr.propTypes = {
1994
+ onChange: X.default.func.isRequired,
1995
+ value: X.default.string.isRequired,
1996
+ availableChartTypes: X.default.shape({
1997
+ histogram: X.default.string,
1998
+ bar: X.default.string,
1999
+ lineDot: X.default.string,
2000
+ lineCross: X.default.string,
2001
+ dotPlot: X.default.string,
2002
+ linePlot: X.default.string
2003
+ }),
2004
+ chartTypeLabel: X.default.string
2005
+ };
2006
+ //#endregion
2007
+ //#region ../../lib-react/charting/dist/chart-setup.js
2008
+ var mr = (e, t, n, r, i) => {
2009
+ (e || []).forEach((e) => {
2010
+ let t = Math.round(e.value * 10) % Math.round(n.step * 10) / 10;
2011
+ (e.value > n.max || t !== 0) && (e.value = 0);
2012
+ }), t && r({
2013
+ ...i,
2014
+ data: e
2015
+ });
2016
+ }, hr = T("div")(() => ({ width: "450px" })), gr = T("div")(({ theme: e }) => ({
2017
+ display: "flex",
2018
+ flexDirection: "column",
2019
+ width: "100%",
2020
+ marginTop: e.spacing(3)
2021
+ })), _r = T("div")(() => ({
2022
+ display: "flex",
2023
+ flexDirection: "column",
2024
+ alignItems: "center"
2025
+ })), vr = T("div")(() => ({
2026
+ display: "flex",
2027
+ justifyContent: "space-around",
2028
+ alignItems: "center"
2029
+ })), yr = T(ft)(({ theme: e }) => ({
2030
+ width: "130px",
2031
+ margin: `${e.spacing(1)} ${e.spacing(.5)}`
2032
+ })), br = T(ft)(({ theme: e }) => ({
2033
+ width: "160px",
2034
+ margin: `${e.spacing(1)} ${e.spacing(.5)}`
2035
+ })), xr = T("div")(({ theme: e }) => ({
2036
+ display: "flex",
2037
+ justifyContent: "space-between",
2038
+ alignItems: "center",
2039
+ margin: `${e.spacing(3)} 0`
2040
+ })), Sr = T(F)(() => ({ color: E.disabled() })), Cr = (e) => {
2041
+ let { model: t, onChange: n, chartDimensions: r, gridValues: i = {}, labelValues: a = {}, studentNewCategoryDefaultLabel: o = {}, availableChartTypes: s = {}, chartTypeLabel: c } = e, [l, u] = ce({
2042
+ open: !1,
2043
+ title: "",
2044
+ text: "",
2045
+ onClose: null,
2046
+ onConfirm: null
2047
+ }), [d, f] = ce(!1), [p, m] = ce(""), [h, g] = ce(0), { range: _ = {}, correctAnswer: v, changeInteractiveEnabled: y, changeEditableEnabled: b } = t, x = t.graph, { showInConfigPanel: S, width: C, height: w } = r || {}, T = {
2048
+ min: C?.min ? Math.max(50, C.min) : 50,
2049
+ max: C?.max ? Math.min(700, C.max) : 700,
2050
+ step: C?.step >= 1 ? Math.min(200, C.step) : 20
2051
+ }, E = {
2052
+ min: w?.min ? Math.max(400, w.min) : 400,
2053
+ max: w?.max ? Math.min(700, w.max) : 700,
2054
+ step: w?.step >= 1 ? Math.min(200, w.step) : 20
2055
+ }, D = i && i.range ? { customValues: i.range } : {
2056
+ min: 0,
2057
+ max: 1e4
2058
+ }, O = a && a.range ? { customValues: a.range } : {
2059
+ min: 0,
2060
+ max: 1e4
2061
+ }, k = /* @__PURE__ */ q(vr, { children: [/* @__PURE__ */ K(br, {
2062
+ label: "Grid Interval",
2063
+ value: _.step,
2064
+ variant: "outlined",
2065
+ onChange: (e, t) => L("step", t, e),
2066
+ ...D
2067
+ }), /* @__PURE__ */ K(br, {
2068
+ label: "Label Interval",
2069
+ value: _.labelStep,
2070
+ variant: "outlined",
2071
+ onChange: (e, t) => L("labelStep", t, e),
2072
+ ...O
2073
+ })] }), A = (e) => {
2074
+ u((t) => ({
2075
+ ...t,
2076
+ open: e
2077
+ })), f(e);
2078
+ }, j = (e, t) => e.map((e) => (Object.prototype.hasOwnProperty.call(e, t) && (e[t] = t == "interactive"), e)), M = (e) => {
2079
+ let { correctAnswer: r, data: i } = t;
2080
+ y === !1 && j(i, "interactive"), b === !1 && j(i, "editable"), mr(i, e, _, n, t), mr(r.data, !1, _, n, t);
2081
+ }, ee = () => {
2082
+ let e = o?.label;
2083
+ n({
2084
+ ...t,
2085
+ studentCategoryDefaultLabel: e
2086
+ });
2087
+ }, N = (e) => e.includes("Plot") ? {
2088
+ min: 3,
2089
+ max: 10
2090
+ } : {
2091
+ min: .05,
2092
+ max: 1e4
2093
+ }, P = (e, r) => {
2094
+ let i = {
2095
+ ...x,
2096
+ [e]: r
2097
+ };
2098
+ n({
2099
+ ...t,
2100
+ graph: i
2101
+ });
2102
+ }, I = (e, t) => (e || []).find((e) => e.value > t.max || e.value - t.step * Math.floor(e.value / t.step) !== 0), L = (e, r, i) => {
2103
+ g(_[e]), m(e), _[e] = r, (e === "max" || e === "step") && (I(t.data, _) || I(t.correctAnswer.data, _)) && i?.target ? f(!0) : n({
2104
+ ...t,
2105
+ range: _
2106
+ });
2107
+ };
2108
+ se(() => {
2109
+ M(!0), ee();
2110
+ }, []), se(() => {
2111
+ d && u({
2112
+ open: !0,
2113
+ title: "Warning",
2114
+ text: "This change will remove values defined for one or more categories",
2115
+ onConfirm: () => {
2116
+ M(), A(!1), n({
2117
+ ...t,
2118
+ range: _,
2119
+ correctAnswer: v
2120
+ });
2121
+ },
2122
+ onClose: () => {
2123
+ _[p] = h, A(!1);
2124
+ }
2125
+ });
2126
+ }, [d]);
2127
+ let te = _.step === 1 && _.labelStep === 1 && 3 <= _.max && _.max <= 10, R = () => {
2128
+ N.min = 3, N.max = 10, _.max = 10, _.step = 1, _.labelStep = 1, n({
2129
+ ...t,
2130
+ range: _
2131
+ });
2132
+ }, z = (e) => {
2133
+ if (e.includes("Plot")) {
2134
+ if (!te) {
2135
+ u({
2136
+ open: !0,
2137
+ title: "Warning",
2138
+ text: "The selected chart type does not support the current chart configuration. Reset chart configuration?",
2139
+ onConfirm: () => {
2140
+ R(), M(), A(!1), n({
2141
+ ...t,
2142
+ range: _,
2143
+ chartType: e
2144
+ });
2145
+ },
2146
+ onClose: () => {
2147
+ A(!1);
2148
+ }
2149
+ });
2150
+ return;
2151
+ }
2152
+ N.min = 3, N.max = 10, n({
2153
+ ...t,
2154
+ chartType: e
2155
+ });
2156
+ return;
2157
+ }
2158
+ n({
2159
+ ...t,
2160
+ chartType: e
2161
+ });
2162
+ };
2163
+ return /* @__PURE__ */ q(hr, { children: [
2164
+ /* @__PURE__ */ K(F, {
2165
+ variant: "subtitle1",
2166
+ children: "Configure Chart"
2167
+ }),
2168
+ /* @__PURE__ */ q(gr, { children: [
2169
+ /* @__PURE__ */ q(vr, { children: [/* @__PURE__ */ K(pr, {
2170
+ value: t.chartType,
2171
+ onChange: (e) => z(e.target.value),
2172
+ availableChartTypes: s,
2173
+ chartTypeLabel: c
2174
+ }), /* @__PURE__ */ K(br, {
2175
+ label: "Max Value",
2176
+ value: _.max,
2177
+ min: N(t.chartType).min,
2178
+ max: N(t.chartType).max,
2179
+ variant: "outlined",
2180
+ onChange: (e, t) => L("max", t, e)
2181
+ })] }),
2182
+ !t.chartType.includes("Plot") && k,
2183
+ S && /* @__PURE__ */ q(xr, { children: [
2184
+ /* @__PURE__ */ K("div", { children: /* @__PURE__ */ K(F, { children: "Dimensions(px)" }) }),
2185
+ /* @__PURE__ */ q(_r, { children: [/* @__PURE__ */ K(yr, {
2186
+ label: "Width",
2187
+ value: x.width,
2188
+ min: T.min,
2189
+ max: T.max,
2190
+ step: T.step,
2191
+ variant: "outlined",
2192
+ onChange: (e, t) => P("width", t)
2193
+ }), /* @__PURE__ */ K(Sr, { children: "Min 50, Max 700" })] }),
2194
+ /* @__PURE__ */ q(_r, { children: [/* @__PURE__ */ K(yr, {
2195
+ label: "Height",
2196
+ value: x.height,
2197
+ min: E.min,
2198
+ max: E.max,
2199
+ step: E.step,
2200
+ variant: "outlined",
2201
+ onChange: (e, t) => P("height", t)
2202
+ }), /* @__PURE__ */ K(Sr, { children: "Min 400, Max 700" })] })
2203
+ ] })
2204
+ ] }),
2205
+ /* @__PURE__ */ K(V, {
2206
+ open: l.open,
2207
+ title: l.title,
2208
+ text: l.text,
2209
+ onClose: l.onClose,
2210
+ onConfirm: l.onConfirm
2211
+ })
2212
+ ] });
2213
+ };
2214
+ Cr.propTypes = {
2215
+ chartDimensions: X.default.object,
2216
+ domain: X.default.object,
2217
+ gridValues: X.default.object,
2218
+ labelValues: X.default.object,
2219
+ model: X.default.object,
2220
+ onChange: X.default.func,
2221
+ range: X.default.object,
2222
+ chartDimension: X.default.object,
2223
+ size: X.default.object,
2224
+ studentNewCategoryDefaultLabel: X.default.object,
2225
+ availableChartTypes: X.default.object,
2226
+ chartTypeLabel: X.default.string
2227
+ };
2228
+ //#endregion
2229
+ //#region ../../shared/configure-events/dist/index.js
2230
+ var wr = class e extends CustomEvent {
2231
+ static {
2232
+ this.TYPE = "model.updated";
2233
+ }
2234
+ constructor(t, n = !1) {
2235
+ super(e.TYPE, {
2236
+ bubbles: !0,
2237
+ detail: {
2238
+ update: t,
2239
+ reset: n
2240
+ }
2241
+ }), this.update = t, this.reset = n;
2242
+ }
2243
+ }, Tr = class e extends CustomEvent {
2244
+ static {
2245
+ this.TYPE = "delete.image";
2246
+ }
2247
+ constructor(t, n) {
2248
+ super(e.TYPE, {
2249
+ bubbles: !0,
2250
+ detail: {
2251
+ src: t,
2252
+ done: n
2253
+ }
2254
+ }), this.src = t, this.done = n;
2255
+ }
2256
+ }, Er = class e extends CustomEvent {
2257
+ static {
2258
+ this.TYPE = "insert.image";
2259
+ }
2260
+ constructor(t) {
2261
+ super(e.TYPE, {
2262
+ bubbles: !0,
2263
+ detail: t
2264
+ }), this.handler = t;
2265
+ }
2266
+ }, Dr = class e extends CustomEvent {
2267
+ static {
2268
+ this.TYPE = "delete.sound";
2269
+ }
2270
+ constructor(t, n) {
2271
+ super(e.TYPE, {
2272
+ bubbles: !0,
2273
+ detail: {
2274
+ src: t,
2275
+ done: n
2276
+ }
2277
+ }), this.src = t, this.done = n;
2278
+ }
2279
+ }, Or = class e extends CustomEvent {
2280
+ static {
2281
+ this.TYPE = "insert.sound";
2282
+ }
2283
+ constructor(t) {
2284
+ super(e.TYPE, {
2285
+ bubbles: !0,
2286
+ detail: t
2287
+ }), this.handler = t;
2288
+ }
2289
+ }, kr = T("div")(({ theme: e }) => ({
2290
+ marginBottom: e.spacing(2.5),
2291
+ display: "flex",
2292
+ flex: 1
2293
+ })), Ar = T("div")(({ theme: e }) => ({ marginBottom: e.spacing(1) })), jr = T("div")({ flex: 1 }), Mr = T(I)({ color: `${E.tertiary()} !important` }), Nr = (e, t) => {
2294
+ if (!e) return t;
2295
+ let n = [];
2296
+ return (t || []).forEach((t, r) => {
2297
+ let { editable: i, interactive: a } = t, o = i && e[r]?.label ? e[r].label : t.label, s = a && e[r]?.value ? e[r].value : t.value;
2298
+ n[r] = {
2299
+ label: o,
2300
+ value: s,
2301
+ editable: t.editable,
2302
+ interactive: t.interactive
2303
+ };
2304
+ }), n;
2305
+ }, Pr = class extends U.Component {
2306
+ static propTypes = {
2307
+ model: X.default.object.isRequired,
2308
+ onChange: X.default.func.isRequired,
2309
+ charts: X.default.array,
2310
+ labelsPlaceholders: X.default.object,
2311
+ titlePlaceholder: X.default.object,
2312
+ showPixelGuides: X.default.bool,
2313
+ authorNewCategoryDefaults: X.default.object,
2314
+ chartingOptions: X.default.object
2315
+ };
2316
+ constructor(e) {
2317
+ super(e), this.state = { dialog: { open: !1 } };
2318
+ }
2319
+ handleAlertDialog = (e, t) => this.setState({ dialog: { open: e } }, t);
2320
+ changeData = (e) => this.props.onChange({
2321
+ ...this.props.model,
2322
+ data: e
2323
+ });
2324
+ changeAddRemoveEnabled = (e) => {
2325
+ let { model: t } = this.props, n = Nr(t.correctAnswer.data, t.data);
2326
+ e ? this.props.onChange({
2327
+ ...this.props.model,
2328
+ addCategoryEnabled: e
2329
+ }) : this.setState({ dialog: {
2330
+ open: !0,
2331
+ title: "Warning",
2332
+ text: "This change will remove any correct answer categories that are not part of the initial item configuration.",
2333
+ onConfirm: () => this.handleAlertDialog(!1, this.props.onChange({
2334
+ ...this.props.model,
2335
+ addCategoryEnabled: e,
2336
+ correctAnswer: { data: n }
2337
+ })),
2338
+ onClose: () => this.handleAlertDialog(!1)
2339
+ } });
2340
+ };
2341
+ changeTitle = (e) => this.props.onChange({
2342
+ ...this.props.model,
2343
+ title: e
2344
+ });
2345
+ changeLabel = (e, t) => this.props.onChange({
2346
+ ...this.props.model,
2347
+ [e]: {
2348
+ ...this.props.model[e],
2349
+ label: t
2350
+ }
2351
+ });
2352
+ render() {
2353
+ let { model: e, charts: t, labelsPlaceholders: n, titlePlaceholder: r, showPixelGuides: i, authorNewCategoryDefaults: a, chartingOptions: o, mathMlOptions: s = {}, labelsCharactersLimit: c } = this.props, { dialog: l } = this.state, { domain: u = {}, range: d = {} } = e || {};
2354
+ return /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(Ar, { children: "Define Initial Chart Attributes" }), /* @__PURE__ */ K(kr, { children: /* @__PURE__ */ q(jr, { children: [
2355
+ /* @__PURE__ */ K(F, {
2356
+ component: "div",
2357
+ type: "body1",
2358
+ children: /* @__PURE__ */ K("span", { children: "Use the tools below to set up the chart as it will initially appear to students." })
2359
+ }),
2360
+ /* @__PURE__ */ K(ne, {
2361
+ defineChart: !0,
2362
+ chartingOptions: o,
2363
+ showPixelGuides: i,
2364
+ chartType: e.chartType,
2365
+ size: e.graph,
2366
+ domain: u,
2367
+ range: d,
2368
+ charts: t,
2369
+ data: e.data.map((e, t) => ({
2370
+ ...e,
2371
+ index: t
2372
+ })),
2373
+ title: e.title,
2374
+ onDataChange: this.changeData,
2375
+ onChangeTitle: this.changeTitle,
2376
+ onChangeLabels: this.changeLabel,
2377
+ addCategoryEnabled: !0,
2378
+ changeInteractiveEnabled: e.changeInteractiveEnabled,
2379
+ changeEditableEnabled: e.changeEditableEnabled,
2380
+ categoryDefaultLabel: a?.label,
2381
+ categoryDefaults: a,
2382
+ labelsPlaceholders: n,
2383
+ titlePlaceholder: r?.label,
2384
+ mathMlOptions: s,
2385
+ labelsCharactersLimit: c
2386
+ }),
2387
+ e.changeAddCategoryEnabled && /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(Mr, {
2388
+ checked: e.addCategoryEnabled,
2389
+ onChange: (e) => {
2390
+ this.changeAddRemoveEnabled(e.target.checked);
2391
+ }
2392
+ }), o?.addCategory?.authoringLabel] }),
2393
+ /* @__PURE__ */ K(V, {
2394
+ open: l.open,
2395
+ title: l.title,
2396
+ text: l.text,
2397
+ onClose: l.onClose,
2398
+ onConfirm: l.onConfirm
2399
+ })
2400
+ ] }, "graph") })] });
2401
+ }
2402
+ }, Fr = T("div")(({ theme: e }) => ({
2403
+ marginBottom: e.spacing(2.5),
2404
+ display: "flex",
2405
+ flex: 1
2406
+ })), Ir = T("div")({ flex: 1 }), Lr = T("div")(({ theme: e }) => ({ border: `2px solid ${e.palette.error.main}` })), Rr = T(F)(({ theme: e }) => ({
2407
+ fontSize: e.typography.fontSize - 2,
2408
+ color: e.palette.error.main,
2409
+ paddingTop: e.spacing(1)
2410
+ })), zr = T("div")(({ theme: e }) => ({ marginBottom: e.spacing(1) })), Br = (e, t) => e.map((e, n) => ({
2411
+ ...e,
2412
+ editable: n < t.length ? t[n].editable : !0,
2413
+ interactive: n < t.length ? t[n].interactive : !0,
2414
+ deletable: n >= t.length
2415
+ })), Vr = (e, t) => {
2416
+ if (!e) return t;
2417
+ let n = [...e], r = [];
2418
+ if ((t || []).forEach((t, n) => {
2419
+ let i = t.editable, a = t.interactive, o = i && e[n]?.label ? e[n].label : t.label, s = a && e[n]?.value || a && e[n]?.value == 0 ? e[n].value : t.value;
2420
+ r[n] = {
2421
+ label: o,
2422
+ value: s,
2423
+ editable: t.editable,
2424
+ interactive: t.interactive
2425
+ };
2426
+ }), r.length < e.length) {
2427
+ let i = (n || []).slice(r.length, e.length);
2428
+ return Br((r || []).concat(i), t);
2429
+ }
2430
+ return r;
2431
+ }, Hr = (e, t) => {
2432
+ let n = t.length - 1, { editable: r, interactive: i, deletable: a, ...o } = t[t.length - 1];
2433
+ return (e || []).splice(n, 0, o), Br([...e], t);
2434
+ }, Ur = (e, t, n) => ((e || []).splice(n, 1), Br([...e], t)), Wr = (e, n, r) => {
2435
+ let i = e && e.model && e.model.data || [], a = n && n.model && n.model.data || [], o = t(e && e.model && e.model.correctAnswer && e.model.correctAnswer.data || []), s = t(r ? r.categories : []), c = [];
2436
+ if (i.length > a.length) return c = Hr(o, i), c;
2437
+ if (i.length < a.length) {
2438
+ let e = i.length;
2439
+ for (let t = 0; t < i.length; t++) if (i[t].index !== t) {
2440
+ e = t;
2441
+ break;
2442
+ }
2443
+ return c = Ur(s, i, e), c;
2444
+ }
2445
+ return c = Vr(o, i), c;
2446
+ }, Gr = class extends U.Component {
2447
+ static propTypes = {
2448
+ correctAnswerErrors: X.default.object,
2449
+ studentNewCategoryDefaultLabel: X.default.string,
2450
+ model: X.default.object.isRequired,
2451
+ onChange: X.default.func.isRequired,
2452
+ charts: X.default.array,
2453
+ error: X.default.string
2454
+ };
2455
+ constructor(e) {
2456
+ super(e), this.state = { categories: [] };
2457
+ }
2458
+ changeData = (e) => {
2459
+ let { model: t, onChange: n } = this.props, { correctAnswer: r } = t || {};
2460
+ n({
2461
+ ...t,
2462
+ correctAnswer: {
2463
+ ...r,
2464
+ data: e.map(({ interactive: e, editable: t, index: n, ...r }) => r)
2465
+ }
2466
+ });
2467
+ };
2468
+ componentDidMount() {
2469
+ let e = Wr(this.props, this.props, null);
2470
+ this.setState({ categories: e || Vr(this.props.model.correctAnswer.data, this.props.model.data) });
2471
+ }
2472
+ componentDidUpdate(e, t) {
2473
+ let n = Wr(this.props, e, t);
2474
+ n && !a(n, this.state.categories) && (this.changeData(n), this.setState({ categories: n }));
2475
+ }
2476
+ render() {
2477
+ let { model: e, charts: t, error: n, studentNewCategoryDefaultLabel: r, correctAnswerErrors: i, mathMlOptions: a = {}, labelsPlaceholders: o = {} } = this.props, { categories: s } = this.state, { domain: c = {}, range: l = {} } = e || {}, { identicalError: u, categoriesError: d } = i || {};
2478
+ return /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(zr, { children: "Define Correct Response" }), /* @__PURE__ */ K(Fr, { children: /* @__PURE__ */ q(Ir, { children: [
2479
+ /* @__PURE__ */ K(F, {
2480
+ component: "div",
2481
+ type: "body1",
2482
+ children: /* @__PURE__ */ K("span", { children: "Use the tools below to define the correct answer." })
2483
+ }),
2484
+ K(u || d ? Lr : "div", { children: /* @__PURE__ */ K(ne, {
2485
+ chartType: e.chartType,
2486
+ size: e.graph,
2487
+ domain: c,
2488
+ range: l,
2489
+ charts: t,
2490
+ data: s,
2491
+ title: e.title,
2492
+ onDataChange: this.changeData,
2493
+ addCategoryEnabled: e.addCategoryEnabled,
2494
+ categoryDefaultLabel: r,
2495
+ error: n,
2496
+ mathMlOptions: a,
2497
+ labelsPlaceholders: o
2498
+ }) }, `correct-response-graph-${e.correctAnswer.name}`),
2499
+ (u || d) && /* @__PURE__ */ K(Rr, {
2500
+ component: "div",
2501
+ type: "body1",
2502
+ children: /* @__PURE__ */ K("span", { children: u || d })
2503
+ })
2504
+ ] }, "graph") })] });
2505
+ }
2506
+ }, Kr = [
2507
+ .01,
2508
+ .02,
2509
+ .04,
2510
+ .05,
2511
+ .0625,
2512
+ .1,
2513
+ .125,
2514
+ .2,
2515
+ .25,
2516
+ .5,
2517
+ 1,
2518
+ 2,
2519
+ 3,
2520
+ 4,
2521
+ 5,
2522
+ 8,
2523
+ 10,
2524
+ 12,
2525
+ 15,
2526
+ 20,
2527
+ 40,
2528
+ 50,
2529
+ 64,
2530
+ 100,
2531
+ 500,
2532
+ 1e3
2533
+ ], qr = [
2534
+ .01,
2535
+ .02,
2536
+ .05,
2537
+ .1,
2538
+ .2,
2539
+ .25,
2540
+ .5,
2541
+ 1,
2542
+ 2,
2543
+ 5,
2544
+ 10,
2545
+ 20,
2546
+ 50,
2547
+ 100,
2548
+ 500,
2549
+ 1e3
2550
+ ], Jr = {
2551
+ .01: [
2552
+ 0,
2553
+ .01,
2554
+ .02,
2555
+ .04,
2556
+ .05,
2557
+ .1
2558
+ ],
2559
+ .02: [
2560
+ 0,
2561
+ .02,
2562
+ .04,
2563
+ .1
2564
+ ],
2565
+ .04: [
2566
+ 0,
2567
+ .04,
2568
+ .08,
2569
+ .16,
2570
+ .2
2571
+ ],
2572
+ .05: [
2573
+ 0,
2574
+ .05,
2575
+ .1,
2576
+ .2,
2577
+ .25
2578
+ ],
2579
+ .0625: [
2580
+ 0,
2581
+ .0625,
2582
+ .125,
2583
+ .25,
2584
+ .5
2585
+ ],
2586
+ .1: [
2587
+ 0,
2588
+ .1,
2589
+ .2,
2590
+ .4,
2591
+ .5,
2592
+ 1
2593
+ ],
2594
+ .125: [
2595
+ 0,
2596
+ .125,
2597
+ .25,
2598
+ .5,
2599
+ 1
2600
+ ],
2601
+ .2: [
2602
+ 0,
2603
+ .2,
2604
+ .5,
2605
+ .1
2606
+ ],
2607
+ .25: [
2608
+ 0,
2609
+ .25,
2610
+ .5,
2611
+ 1,
2612
+ 2
2613
+ ],
2614
+ .5: [
2615
+ 0,
2616
+ .5,
2617
+ 1,
2618
+ 2
2619
+ ],
2620
+ 1: [
2621
+ 0,
2622
+ 1,
2623
+ 2,
2624
+ 4,
2625
+ 5,
2626
+ 10
2627
+ ],
2628
+ 2: [
2629
+ 0,
2630
+ 2,
2631
+ 4,
2632
+ 8,
2633
+ 10
2634
+ ],
2635
+ 3: [
2636
+ 0,
2637
+ 3,
2638
+ 6,
2639
+ 12,
2640
+ 15
2641
+ ],
2642
+ 4: [
2643
+ 0,
2644
+ 4,
2645
+ 8,
2646
+ 16,
2647
+ 20
2648
+ ],
2649
+ 5: [
2650
+ 0,
2651
+ 5,
2652
+ 10,
2653
+ 20,
2654
+ 25
2655
+ ],
2656
+ 8: [
2657
+ 0,
2658
+ 8,
2659
+ 16,
2660
+ 32,
2661
+ 40,
2662
+ 64
2663
+ ],
2664
+ 10: [
2665
+ 0,
2666
+ 10,
2667
+ 20,
2668
+ 40,
2669
+ 50,
2670
+ 100
2671
+ ],
2672
+ 12: [
2673
+ 0,
2674
+ 12,
2675
+ 24
2676
+ ],
2677
+ 15: [
2678
+ 0,
2679
+ 15,
2680
+ 30,
2681
+ 60
2682
+ ],
2683
+ 20: [
2684
+ 0,
2685
+ 20,
2686
+ 40,
2687
+ 80,
2688
+ 100
2689
+ ],
2690
+ 40: [
2691
+ 0,
2692
+ 40,
2693
+ 80,
2694
+ 160,
2695
+ 200
2696
+ ],
2697
+ 50: [
2698
+ 0,
2699
+ 50,
2700
+ 100,
2701
+ 200,
2702
+ 250
2703
+ ],
2704
+ 64: [
2705
+ 0,
2706
+ 64,
2707
+ 128
2708
+ ],
2709
+ 100: [
2710
+ 0,
2711
+ 100,
2712
+ 200,
2713
+ 400,
2714
+ 500
2715
+ ],
2716
+ 500: [
2717
+ 0,
2718
+ 500,
2719
+ 1e3,
2720
+ 2500
2721
+ ],
2722
+ 1e3: [
2723
+ 0,
2724
+ 1e3,
2725
+ 2e3,
2726
+ 4e3,
2727
+ 5e3
2728
+ ]
2729
+ }, Yr = (e, t, n = !1) => {
2730
+ let r = 10 * (e.max - e.min) / t, i = r * 10, a = n && !qr.includes(e.step) && Kr.includes(e.step);
2731
+ return (!n || a ? Kr : qr).filter((e) => e >= r && e <= i);
2732
+ }, Xr = (e) => Jr[e] || [], Zr = (e, t, n, r) => {
2733
+ let i = Yr(e, t), o = Xr(e.step || 1);
2734
+ if (!a(n, i) && !i.includes(e.step)) {
2735
+ let n = Yr(e, t, !0)[0] || 1;
2736
+ return e.step = n, o = Xr(n), o.includes(e.labelStep) || (e.labelStep = n), {
2737
+ gridValues: i,
2738
+ labelValues: o
2739
+ };
2740
+ }
2741
+ return !a(r, o) && !o.includes(e.labelStep) && (e.labelStep = e.step), {
2742
+ gridValues: i,
2743
+ labelValues: o
2744
+ };
2745
+ }, Qr = (0, Ke.default)("@pie-element:graphing:configure"), { Panel: $r, toggle: $, radio: ei, dropdown: ti, textField: ni } = Jn, ri = T(or)(({ theme: e }) => ({
2746
+ width: "100%",
2747
+ paddingTop: e.spacing(2),
2748
+ marginBottom: e.spacing(2)
2749
+ })), ii = T(F)(({ theme: e }) => ({ marginBottom: e.spacing(2.5) })), ai = T("div")(({ theme: e }) => ({
2750
+ fontSize: e.typography.fontSize - 2,
2751
+ color: e.palette.error.main,
2752
+ paddingTop: e.spacing(1)
2753
+ })), oi = [
2754
+ R.Bar(),
2755
+ R.Histogram(),
2756
+ R.LineDot(),
2757
+ R.LineCross(),
2758
+ R.DotPlot(),
2759
+ R.LinePlot()
2760
+ ], si = class extends W.Component {
2761
+ static propTypes = {
2762
+ onModelChanged: X.default.func,
2763
+ onConfigurationChanged: X.default.func,
2764
+ imageSupport: X.default.object,
2765
+ uploadSoundSupport: X.default.object,
2766
+ model: X.default.object.isRequired,
2767
+ configuration: X.default.object.isRequired,
2768
+ chartingOptions: X.default.object
2769
+ };
2770
+ constructor(e) {
2771
+ super(e);
2772
+ let { range: t = {}, graph: n } = e.model || {}, r = { range: Yr(t, n.height, !0) }, i = { range: Xr(t.step || 1) };
2773
+ this.state = {
2774
+ gridValues: r,
2775
+ labelValues: i
2776
+ };
2777
+ }
2778
+ onRationaleChange = (e) => this.props.onModelChanged({
2779
+ ...this.props.model,
2780
+ rationale: e
2781
+ });
2782
+ onPromptChange = (e) => this.props.onModelChanged({
2783
+ ...this.props.model,
2784
+ prompt: e
2785
+ });
2786
+ onTeacherInstructionsChange = (e) => this.props.onModelChanged({
2787
+ ...this.props.model,
2788
+ teacherInstructions: e
2789
+ });
2790
+ onChartTypeChange = (e) => this.props.onModelChanged({
2791
+ ...this.props.model,
2792
+ chartType: e
2793
+ });
2794
+ onConfigChange = (e) => {
2795
+ let { model: t, onModelChanged: n } = this.props, { gridValues: r, labelValues: i } = this.state, a = {
2796
+ ...t,
2797
+ ...e
2798
+ }, { graph: o, range: s } = a, c = {}, l = {}, u = Zr(s, o.height, r.range, i.range);
2799
+ c.range = u.gridValues, l.range = u.labelValues, this.setState({
2800
+ gridValues: c,
2801
+ labelValues: l
2802
+ }), n(a);
2803
+ };
2804
+ render() {
2805
+ let { configuration: e, imageSupport: t, model: n, onConfigurationChanged: r, onModelChanged: i, uploadSoundSupport: a } = this.props;
2806
+ Qr("[render] model", n);
2807
+ let { graph: o } = n, { baseInputConfiguration: s = {}, contentDimensions: c = {}, chartDimensions: l = {}, authorNewCategoryDefaults: u = {}, labelsPlaceholders: d = {}, instruction: f = {}, maxImageWidth: p = {}, maxImageHeight: m = {}, prompt: h = {}, rationale: g = {}, scoringType: _ = {}, settingsPanelDisabled: v, spellCheck: y = {}, studentInstructions: b = {}, teacherInstructions: x = {}, titlePlaceholder: S = {}, withRubric: C = {}, chartingOptions: w = {}, availableChartTypes: T = {}, mathMlOptions: E = {}, chartTypeLabel: D, language: O = {}, languageChoices: k = {}, labelsCharactersLimit: A } = e || {}, { errors: j, extraCSSRules: M, promptEnabled: N, rationaleEnabled: P, spellCheckEnabled: F, teacherInstructionsEnabled: I, studentNewCategoryDefaultLabel: L } = n || {}, { categoryErrors: te, correctAnswerErrors: R, prompt: z, rationale: B, teacherInstructions: V } = j || {}, { gridValues: ne, labelValues: re } = this.state, ie = l.showInConfigPanel || !0, ae = p && p.prompt, H = m && m.prompt, U = {
2808
+ changeInteractiveEnabled: w.changeInteractive?.settings && $(w.changeInteractive.settingsLabel),
2809
+ changeEditableEnabled: w.changeEditable?.settings && $(w.changeEditable.settingsLabel),
2810
+ changeAddCategoryEnabled: w.addCategory?.settings && $(w.addCategory.settingsLabel)
2811
+ }, W = {
2812
+ teacherInstructionsEnabled: x.settings && $(x.label),
2813
+ studentInstructionsEnabled: b.settings && $(b.label),
2814
+ rationaleEnabled: g.settings && $(g.label),
2815
+ spellCheckEnabled: y.settings && $(y.label),
2816
+ promptEnabled: h.settings && $(h.label),
2817
+ scoringType: _.settings && ei(_.label, ["all or nothing", "partial scoring"]),
2818
+ rubricEnabled: C?.settings && $(C?.label),
2819
+ "language.enabled": O.settings && $(O.label, !0),
2820
+ language: O.settings && O.enabled && ti(k.label, k.options),
2821
+ instruction: f.settings && ni(f.label)
2822
+ }, G = (e = {}) => ({
2823
+ ...s,
2824
+ ...e
2825
+ });
2826
+ return /* @__PURE__ */ q(bn.ConfigLayout, {
2827
+ extraCSSRules: M,
2828
+ dimensions: c,
2829
+ hideSettings: v,
2830
+ settings: /* @__PURE__ */ K($r, {
2831
+ model: n,
2832
+ configuration: e,
2833
+ onChangeModel: i,
2834
+ onChangeConfiguration: r,
2835
+ groups: {
2836
+ Settings: U,
2837
+ Properties: W
2838
+ }
2839
+ }),
2840
+ children: [
2841
+ /* @__PURE__ */ K(ii, {
2842
+ component: "div",
2843
+ type: "body1",
2844
+ children: f?.label || ""
2845
+ }),
2846
+ I && /* @__PURE__ */ q(ri, {
2847
+ label: x.label,
2848
+ children: [/* @__PURE__ */ K(ee, {
2849
+ markup: n.teacherInstructions || "",
2850
+ onChange: this.onTeacherInstructionsChange,
2851
+ imageSupport: t,
2852
+ nonEmpty: !1,
2853
+ error: V,
2854
+ spellCheck: F,
2855
+ pluginProps: G(x?.inputConfiguration),
2856
+ maxImageWidth: p && p.teacherInstructions || ae,
2857
+ maxImageHeight: m && m.teacherInstructions || H,
2858
+ uploadSoundSupport: a,
2859
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
2860
+ mathMlOptions: E
2861
+ }), V && /* @__PURE__ */ K(ai, { children: V })]
2862
+ }),
2863
+ N && /* @__PURE__ */ q(ri, {
2864
+ label: h.label,
2865
+ children: [/* @__PURE__ */ K(ee, {
2866
+ markup: n.prompt,
2867
+ onChange: this.onPromptChange,
2868
+ imageSupport: t,
2869
+ nonEmpty: !1,
2870
+ error: z,
2871
+ spellCheck: F,
2872
+ disableUnderline: !0,
2873
+ pluginProps: G(h?.inputConfiguration),
2874
+ maxImageWidth: ae,
2875
+ maxImageHeight: H,
2876
+ uploadSoundSupport: a,
2877
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
2878
+ mathMlOptions: E
2879
+ }), z && /* @__PURE__ */ K(ai, { children: z })]
2880
+ }),
2881
+ /* @__PURE__ */ K(Cr, {
2882
+ model: n,
2883
+ onChange: this.onConfigChange,
2884
+ gridValues: ne,
2885
+ labelValues: re,
2886
+ chartDimensions: l,
2887
+ charts: oi,
2888
+ studentNewCategoryDefaultLabel: L,
2889
+ availableChartTypes: T,
2890
+ chartTypeLabel: D
2891
+ }),
2892
+ /* @__PURE__ */ K(Pr, {
2893
+ model: n,
2894
+ onChange: i,
2895
+ charts: oi,
2896
+ labelsPlaceholders: d,
2897
+ titlePlaceholder: S,
2898
+ showPixelGuides: ie,
2899
+ authorNewCategoryDefaults: u,
2900
+ chartingOptions: w,
2901
+ mathMlOptions: E,
2902
+ labelsCharactersLimit: A
2903
+ }),
2904
+ /* @__PURE__ */ K(Gr, {
2905
+ config: o,
2906
+ model: n,
2907
+ onChange: i,
2908
+ charts: oi,
2909
+ error: te,
2910
+ correctAnswerErrors: R,
2911
+ studentNewCategoryDefaultLabel: L,
2912
+ mathMlOptions: E,
2913
+ labelsPlaceholders: d
2914
+ }),
2915
+ P && /* @__PURE__ */ q(ri, {
2916
+ label: g.label || "Rationale",
2917
+ children: [/* @__PURE__ */ K(ee, {
2918
+ markup: n.rationale || "",
2919
+ onChange: this.onRationaleChange,
2920
+ imageSupport: t,
2921
+ error: B,
2922
+ spellCheck: F,
2923
+ pluginProps: G(g?.inputConfiguration),
2924
+ maxImageWidth: p && p.rationale || ae,
2925
+ maxImageHeight: m && m.rationale || H,
2926
+ uploadSoundSupport: a,
2927
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
2928
+ mathMlOptions: E
2929
+ }), B && /* @__PURE__ */ K(ai, { children: B })]
2930
+ })
2931
+ ]
2932
+ });
2933
+ }
2934
+ }, ci = {
2935
+ model: {
2936
+ addCategoryEnabled: !0,
2937
+ changeAddCategoryEnabled: !1,
2938
+ changeEditableEnabled: !1,
2939
+ changeInteractiveEnabled: !1,
2940
+ chartType: "lineCross",
2941
+ correctAnswer: {},
2942
+ data: [],
2943
+ domain: {},
2944
+ graph: {
2945
+ width: 480,
2946
+ height: 480
2947
+ },
2948
+ prompt: "",
2949
+ promptEnabled: !0,
2950
+ range: {
2951
+ label: "",
2952
+ max: 1,
2953
+ min: 0,
2954
+ labelStep: 1
2955
+ },
2956
+ rationale: "",
2957
+ rationaleEnabled: !0,
2958
+ scoringType: "all or nothing",
2959
+ studentInstructionsEnabled: !0,
2960
+ studentNewCategoryDefaultLabel: "New Category",
2961
+ teacherInstructions: "",
2962
+ teacherInstructionsEnabled: !0,
2963
+ title: ""
2964
+ },
2965
+ configuration: {
2966
+ baseInputConfiguration: {
2967
+ h3: { disabled: !0 },
2968
+ audio: { disabled: !1 },
2969
+ video: { disabled: !1 },
2970
+ image: { disabled: !1 },
2971
+ textAlign: { disabled: !0 },
2972
+ showParagraphs: { disabled: !1 },
2973
+ separateParagraphs: { disabled: !0 }
2974
+ },
2975
+ spellCheck: {
2976
+ label: "Spellcheck",
2977
+ settings: !1,
2978
+ enabled: !0
2979
+ },
2980
+ chartDimensions: {
2981
+ settings: !1,
2982
+ label: "Chart Dimensions",
2983
+ showInConfigPanel: !0,
2984
+ width: {
2985
+ min: 50,
2986
+ max: 700,
2987
+ step: 20
2988
+ },
2989
+ height: {
2990
+ min: 400,
2991
+ max: 700,
2992
+ step: 20
2993
+ }
2994
+ },
2995
+ authorNewCategoryDefaults: {
2996
+ settings: !1,
2997
+ label: "Category",
2998
+ interactive: !0,
2999
+ editable: !1
3000
+ },
3001
+ availableChartTypes: {
3002
+ bar: "Bar Chart",
3003
+ histogram: "Histogram",
3004
+ lineDot: "Line Chart ●",
3005
+ lineCross: "Line Chart x",
3006
+ dotPlot: "Dot/Line Plot ⬤",
3007
+ linePlot: "Dot/Line Plot X"
3008
+ },
3009
+ chartTypeLabel: "ChartType",
3010
+ studentNewCategoryDefaultLabel: {
3011
+ settings: !1,
3012
+ label: "Category"
3013
+ },
3014
+ prompt: {
3015
+ settings: !0,
3016
+ label: "Item Stem",
3017
+ required: !1,
3018
+ inputConfiguration: {
3019
+ audio: { disabled: !1 },
3020
+ video: { disabled: !1 },
3021
+ image: { disabled: !1 }
3022
+ }
3023
+ },
3024
+ rationale: {
3025
+ settings: !0,
3026
+ label: "Rationale",
3027
+ required: !1,
3028
+ inputConfiguration: {
3029
+ audio: { disabled: !1 },
3030
+ video: { disabled: !1 },
3031
+ image: { disabled: !1 }
3032
+ }
3033
+ },
3034
+ scoringType: {
3035
+ settings: !1,
3036
+ label: "Scoring Type"
3037
+ },
3038
+ settingsPanelDisabled: !1,
3039
+ studentInstructions: {
3040
+ settings: !1,
3041
+ label: "Student Instructions"
3042
+ },
3043
+ teacherInstructions: {
3044
+ settings: !0,
3045
+ label: "Teacher Instructions",
3046
+ required: !1,
3047
+ inputConfiguration: {
3048
+ audio: { disabled: !1 },
3049
+ video: { disabled: !1 },
3050
+ image: { disabled: !1 }
3051
+ }
3052
+ },
3053
+ title: {
3054
+ settings: !1,
3055
+ label: "Chart Title"
3056
+ },
3057
+ instruction: {
3058
+ settings: !1,
3059
+ label: "This item type provides various types of interactive charts. Depending upon how an item is configured,\n students can change the heights of bars (or other similar chart elements) created by the author; relabel bars\n created by the author; and/or add new bars, label them, and set their heights."
3060
+ },
3061
+ titlePlaceholder: {
3062
+ settings: !1,
3063
+ label: "Click here to add a title"
3064
+ },
3065
+ labelsPlaceholders: {
3066
+ left: "Click here to add a label for this axis",
3067
+ right: "",
3068
+ top: "",
3069
+ bottom: "Click here to add a label for this axis"
3070
+ },
3071
+ maxImageWidth: {
3072
+ teacherInstructions: 300,
3073
+ prompt: 300,
3074
+ rationale: 300
3075
+ },
3076
+ maxImageHeight: {
3077
+ teacherInstructions: 300,
3078
+ prompt: 300,
3079
+ rationale: 300
3080
+ },
3081
+ withRubric: {
3082
+ settings: !1,
3083
+ label: "Add Rubric"
3084
+ },
3085
+ language: {
3086
+ settings: !1,
3087
+ label: "Specify Language",
3088
+ enabled: !1
3089
+ },
3090
+ languageChoices: {
3091
+ label: "Language Choices",
3092
+ options: []
3093
+ },
3094
+ chartingOptions: {
3095
+ changeInteractive: {
3096
+ settings: !1,
3097
+ authoringLabel: "Student can set value",
3098
+ settingsLabel: "Allow non-interactive categories"
3099
+ },
3100
+ changeEditable: {
3101
+ settings: !1,
3102
+ authoringLabel: "Student can edit name",
3103
+ settingsLabel: "Allow editable category names"
3104
+ },
3105
+ addCategory: {
3106
+ settings: !1,
3107
+ authoringLabel: "Student can add categories",
3108
+ settingsLabel: "Allow changes to whether students can add categories"
3109
+ },
3110
+ mathMlOptions: {
3111
+ mmlOutput: !1,
3112
+ mmlEditing: !1
3113
+ }
3114
+ }
3115
+ }
3116
+ }, li = (0, Ke.default)("pie-elements:graphing:configure"), ui = class e extends HTMLElement {
3117
+ static createDefaultModel = (e = {}) => ({
3118
+ ...ci.model,
3119
+ ...e
3120
+ });
3121
+ constructor() {
3122
+ super(), this._root = null, this._model = e.createDefaultModel(), this._configuration = ci.configuration;
3123
+ }
3124
+ set model(t) {
3125
+ this._model = e.createDefaultModel(t), this._render();
3126
+ }
3127
+ set configuration(e) {
3128
+ let t = {
3129
+ ...ci.configuration,
3130
+ ...e
3131
+ };
3132
+ this._configuration = t, t?.language?.enabled ? t?.languageChoices?.options?.length && (this._model.language = t?.languageChoices.options[0].value) : t.language.settings && this._model.language ? (this._configuration.language.enabled = !0, (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) && (this._configuration.languageChoices.options = []), this._configuration.languageChoices.options.find((e) => e.value === this._model.language) || this._configuration.languageChoices.options.push({
3133
+ value: this._model.language,
3134
+ label: this._model.language
3135
+ })) : delete this._model.language, this._render();
3136
+ }
3137
+ onModelChanged(e) {
3138
+ this._model = e, this._render(), li("[onModelChanged]: ", this._model), this.dispatchEvent(new wr(this._model));
3139
+ }
3140
+ onConfigurationChanged(e) {
3141
+ this._configuration = e, this._render();
3142
+ }
3143
+ insertImage(e) {
3144
+ this.dispatchEvent(new Er(e));
3145
+ }
3146
+ onDeleteImage(e, t) {
3147
+ this.dispatchEvent(new Tr(e, t));
3148
+ }
3149
+ insertSound(e) {
3150
+ this.dispatchEvent(new Or(e));
3151
+ }
3152
+ onDeleteSound(e, t) {
3153
+ this.dispatchEvent(new Dr(e, t));
3154
+ }
3155
+ _render() {
3156
+ if (this._model) {
3157
+ let e = W.createElement(si, {
3158
+ onModelChanged: this.onModelChanged.bind(this),
3159
+ onConfigurationChanged: this.onConfigurationChanged.bind(this),
3160
+ model: this._model,
3161
+ configuration: this._configuration,
3162
+ imageSupport: {
3163
+ add: this.insertImage.bind(this),
3164
+ delete: this.onDeleteImage.bind(this)
3165
+ },
3166
+ uploadSoundSupport: {
3167
+ add: this.insertSound.bind(this),
3168
+ delete: this.onDeleteSound.bind(this)
3169
+ }
3170
+ });
3171
+ this._root ||= le(this), this._root.render(e), queueMicrotask(() => {
3172
+ v(this);
3173
+ });
3174
+ }
3175
+ }
3176
+ connectedCallback() {
3177
+ this._render();
3178
+ }
3179
+ disconnectedCallback() {
3180
+ this._root &&= (this._root.unmount(), null);
3181
+ }
3182
+ };
3183
+ //#endregion
3184
+ export { ui as default };
3185
+
3186
+ //# sourceMappingURL=index.js.map