@pie-element/placement-ordering 15.0.6 → 15.0.7-next.20261019062545

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.
@@ -1,12 +1,12 @@
1
1
  import { i as e } from "../rolldown-runtime-CWhphoD1.js";
2
2
  import { S as t, g as n, i as r, l as i, n as a, r as o, t as s, w as c, x as l } from "../dist-CwKUcf7l.js";
3
- import { Ht as u, N as d, P as f, Vt as p, a as m, c as h, g, gt as _, h as v, ht as y, i as b, j as x, m as S, mt as C, n as w, o as ee, p as T, pt as E, r as D, s as te, t as O, vt as k, w as A } from "../drag-provider-D4hwNRhY.js";
4
- import j, { createElement as M, useRef as ne } from "react";
5
- import { createRoot as N } from "react-dom/client";
6
- import re from "react-dom";
7
- import { jsx as P, jsxs as F } from "react/jsx-runtime";
3
+ import { F as u, Ht as d, N as f, P as p, Ut as m, _t as h, a as g, c as _, g as v, gt as y, h as b, ht as x, i as S, j as C, m as w, mt as T, n as E, o as ee, p as D, r as O, s as te, t as ne, w as k, yt as A } from "../drag-provider-Dv4_CO-k.js";
4
+ import j, { createElement as M, useRef as N } from "react";
5
+ import { createRoot as re } from "react-dom/client";
6
+ import P from "react-dom";
7
+ import { jsx as F, jsxs as I } from "react/jsx-runtime";
8
8
  //#region ../../shared/player-events/dist/index.js
9
- var I = /* @__PURE__ */ e(a(), 1);
9
+ var L = /* @__PURE__ */ e(a(), 1);
10
10
  (class e extends CustomEvent {
11
11
  static {
12
12
  this.TYPE = "model-set";
@@ -37,7 +37,7 @@ var ie = class e extends CustomEvent {
37
37
  }
38
38
  }), this.component = t, this.complete = n;
39
39
  }
40
- }, L = /* @__PURE__ */ e(p(), 1);
40
+ }, R = /* @__PURE__ */ e(d(), 1);
41
41
  function ae(e, t, n) {
42
42
  let r = { ...e };
43
43
  return t.top + e.y <= n.top ? r.y = n.top - t.top : t.bottom + e.y >= n.top + n.height && (r.y = n.top + n.height - t.bottom), t.left + e.x <= n.left ? r.x = n.left - t.left : t.right + e.x >= n.left + n.width && (r.x = n.left + n.width - t.right), r;
@@ -45,7 +45,7 @@ function ae(e, t, n) {
45
45
  var oe = (e) => {
46
46
  let { containerNodeRect: t, draggingNodeRect: n, transform: r } = e;
47
47
  return !n || !t ? r : ae(r, n, t);
48
- }, se = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ F("svg", {
48
+ }, se = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ I("svg", {
49
49
  "aria-hidden": "true",
50
50
  focusable: "false",
51
51
  preserveAspectRatio: "xMinYMin meet",
@@ -53,27 +53,27 @@ var oe = (e) => {
53
53
  viewBox: "-283 359 34 35",
54
54
  style: { enableBackground: "new -283 359 34 35" },
55
55
  children: [
56
- /* @__PURE__ */ P("circle", {
56
+ /* @__PURE__ */ F("circle", {
57
57
  cx: "-266",
58
58
  cy: "375.9",
59
59
  r: "14",
60
60
  fill: e
61
61
  }),
62
- /* @__PURE__ */ P("path", {
62
+ /* @__PURE__ */ F("path", {
63
63
  d: "M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z\n M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z",
64
64
  fill: e
65
65
  }),
66
- /* @__PURE__ */ P("polygon", {
66
+ /* @__PURE__ */ F("polygon", {
67
67
  points: "-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6",
68
68
  fill: t
69
69
  })
70
70
  ]
71
71
  });
72
72
  se.propTypes = {
73
- bgFill: L.default.string.isRequired,
74
- fgFill: L.default.string.isRequired
73
+ bgFill: R.default.string.isRequired,
74
+ fgFill: R.default.string.isRequired
75
75
  };
76
- var ce = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ F("svg", {
76
+ var ce = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ I("svg", {
77
77
  "aria-hidden": "true",
78
78
  focusable: "false",
79
79
  preserveAspectRatio: "xMinYMin meet",
@@ -81,7 +81,7 @@ var ce = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ F("svg", {
81
81
  viewBox: "-129.5 127 34 35",
82
82
  style: { enableBackground: "new -129.5 127 34 35" },
83
83
  children: [
84
- /* @__PURE__ */ P("path", {
84
+ /* @__PURE__ */ F("path", {
85
85
  style: {
86
86
  fill: "#D0CAC5",
87
87
  stroke: "#E6E3E0",
@@ -90,7 +90,7 @@ var ce = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ F("svg", {
90
90
  },
91
91
  d: "M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5\n C-97.4,153.5-104.3,160.4-112.9,160.4z"
92
92
  }),
93
- /* @__PURE__ */ P("path", {
93
+ /* @__PURE__ */ F("path", {
94
94
  style: {
95
95
  fill: "#B3ABA4",
96
96
  stroke: "#CDC7C2",
@@ -99,48 +99,48 @@ var ce = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ F("svg", {
99
99
  },
100
100
  d: "M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z"
101
101
  }),
102
- /* @__PURE__ */ P("circle", {
102
+ /* @__PURE__ */ F("circle", {
103
103
  cx: "-114.2",
104
104
  cy: "143.5",
105
105
  r: "14",
106
106
  fill: e
107
107
  }),
108
- /* @__PURE__ */ P("path", {
108
+ /* @__PURE__ */ F("path", {
109
109
  d: "M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z\n M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z",
110
110
  fill: n
111
111
  }),
112
- /* @__PURE__ */ P("polygon", {
112
+ /* @__PURE__ */ F("polygon", {
113
113
  points: "-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2",
114
114
  fill: t
115
115
  })
116
116
  ]
117
117
  });
118
118
  ce.propTypes = {
119
- bgFill: L.default.string.isRequired,
120
- fgFill: L.default.string.isRequired,
121
- borderFill: L.default.string.isRequired
119
+ bgFill: R.default.string.isRequired,
120
+ fgFill: R.default.string.isRequired,
121
+ borderFill: R.default.string.isRequired
122
122
  };
123
- var le = k("div")(({ size: e }) => ({
123
+ var le = A("div")(({ size: e }) => ({
124
124
  width: e || "25px",
125
125
  height: e || "25px"
126
- })), R = ({ open: e, size: t }) => /* @__PURE__ */ P(le, {
126
+ })), z = ({ open: e, size: t }) => /* @__PURE__ */ F(le, {
127
127
  size: t,
128
- children: e ? /* @__PURE__ */ P(se, {
128
+ children: e ? /* @__PURE__ */ F(se, {
129
129
  bgFill: "#bce2ff",
130
130
  fgFill: "#1a9cff"
131
- }) : /* @__PURE__ */ P(ce, {
131
+ }) : /* @__PURE__ */ F(ce, {
132
132
  bgFill: "white",
133
133
  fgFill: "#1a9cff",
134
134
  borderFill: "#bce2ff"
135
135
  })
136
136
  });
137
- R.propTypes = {
138
- open: L.default.bool,
139
- size: L.default.string
140
- }, R.defaultProps = { open: !1 };
137
+ z.propTypes = {
138
+ open: R.default.bool,
139
+ size: R.default.string
140
+ }, z.defaultProps = { open: !1 };
141
141
  //#endregion
142
142
  //#region ../../lib-react/correct-answer-toggle/dist/expander.js
143
- var ue = "height ease-in 300ms, opacity ease-in 300ms", de = k("div")(() => ({
143
+ var ue = "height ease-in 300ms, opacity ease-in 300ms", de = A("div")(() => ({
144
144
  position: "relative",
145
145
  height: 0,
146
146
  overflow: "hidden",
@@ -175,8 +175,8 @@ var ue = "height ease-in 300ms, opacity ease-in 300ms", de = k("div")(() => ({
175
175
  width: 0
176
176
  }
177
177
  })), fe = (e) => {
178
- let { show: t, children: n, className: r } = e, i = ne(null);
179
- return /* @__PURE__ */ P(y, {
178
+ let { show: t, children: n, className: r } = e, i = N(null);
179
+ return /* @__PURE__ */ F(y, {
180
180
  nodeRef: i,
181
181
  in: t,
182
182
  appear: !0,
@@ -188,7 +188,7 @@ var ue = "height ease-in 300ms, opacity ease-in 300ms", de = k("div")(() => ({
188
188
  exit: "exit",
189
189
  exitDone: "exit-done"
190
190
  },
191
- children: /* @__PURE__ */ P(de, {
191
+ children: /* @__PURE__ */ F(de, {
192
192
  ref: i,
193
193
  className: r,
194
194
  children: n
@@ -196,13 +196,13 @@ var ue = "height ease-in 300ms, opacity ease-in 300ms", de = k("div")(() => ({
196
196
  });
197
197
  };
198
198
  fe.propTypes = {
199
- show: L.default.bool.isRequired,
200
- className: L.default.string,
201
- children: L.default.oneOfType([L.default.arrayOf(L.default.node), L.default.node]).isRequired
199
+ show: R.default.bool.isRequired,
200
+ className: R.default.string,
201
+ children: R.default.oneOfType([R.default.arrayOf(R.default.node), R.default.node]).isRequired
202
202
  };
203
203
  //#endregion
204
204
  //#region ../../lib-react/correct-answer-toggle/dist/i18n/index.js
205
- var pe = d({
205
+ var pe = p({
206
206
  packageName: "@pie-lib/correct-answer-toggle",
207
207
  source: {
208
208
  showCorrectAnswer: "Show correct answer",
@@ -261,23 +261,23 @@ var pe = d({
261
261
  });
262
262
  //#endregion
263
263
  //#region ../../lib-react/correct-answer-toggle/dist/index.js
264
- function z(e) {
264
+ function B(e) {
265
265
  return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
266
266
  }
267
267
  function me(e, t) {
268
- return !e || z(e) ? e : z(e.default) ? e.default : t && z(e[t]) ? e[t] : t && z(e[t]?.default) ? e[t].default : e;
268
+ return !e || B(e) ? e : B(e.default) ? e.default : t && B(e[t]) ? e[t] : t && B(e[t]?.default) ? e[t].default : e;
269
269
  }
270
- var he = h, B = he.default, ge = B && typeof B == "object" ? B : he, _e = me(v, "Readable") || me(ge.Readable, "Readable"), ve = {
270
+ var he = _, V = he.default, ge = V && typeof V == "object" ? V : he, _e = me(b, "Readable") || me(ge.Readable, "Readable"), ve = {
271
271
  WebkitTouchCallout: "none",
272
272
  WebkitUserSelect: "none",
273
273
  KhtmlUserSelect: "none",
274
274
  MozUserSelect: "none",
275
275
  msUserSelect: "none",
276
276
  userSelect: "none"
277
- }, ye = k("div")(() => ({
277
+ }, ye = A("div")(() => ({
278
278
  width: "100%",
279
279
  cursor: "pointer"
280
- })), be = k("button")(() => ({
280
+ })), be = A("button")(() => ({
281
281
  margin: "0 auto",
282
282
  textAlign: "center",
283
283
  display: "flex",
@@ -290,18 +290,18 @@ var he = h, B = he.default, ge = B && typeof B == "object" ? B : he, _e = me(v,
290
290
  font: "inherit",
291
291
  cursor: "pointer",
292
292
  "&:focus-visible": {
293
- outline: `2px solid ${_.buttonFocusOutline()}`,
293
+ outline: `2px solid ${h.buttonFocusOutline()}`,
294
294
  outlineOffset: "-2px"
295
295
  }
296
- })), xe = k("div")(() => ({
296
+ })), xe = A("div")(() => ({
297
297
  width: "fit-content",
298
298
  minWidth: "140px",
299
299
  alignSelf: "center",
300
300
  verticalAlign: "middle",
301
- color: `var(--correct-answer-toggle-label-color, ${_.text()})`,
301
+ color: `var(--correct-answer-toggle-label-color, ${h.text()})`,
302
302
  fontWeight: "normal",
303
303
  ...ve
304
- })), Se = k("div")(() => ({
304
+ })), Se = A("div")(() => ({
305
305
  position: "absolute",
306
306
  width: "25px",
307
307
  "&.enter": { opacity: "0" },
@@ -314,20 +314,20 @@ var he = h, B = he.default, ge = B && typeof B == "object" ? B : he, _e = me(v,
314
314
  opacity: "0",
315
315
  transition: "opacity 0.3s ease-in"
316
316
  }
317
- })), Ce = k("div")(() => ({
317
+ })), Ce = A("div")(() => ({
318
318
  width: "25px",
319
319
  marginRight: "5px",
320
320
  display: "flex",
321
321
  alignItems: "center"
322
322
  })), we = class extends j.Component {
323
323
  static propTypes = {
324
- onToggle: L.default.func,
325
- toggled: L.default.bool,
326
- show: L.default.bool,
327
- hideMessage: L.default.string,
328
- showMessage: L.default.string,
329
- className: L.default.string,
330
- language: L.default.string
324
+ onToggle: R.default.func,
325
+ toggled: R.default.bool,
326
+ show: R.default.bool,
327
+ hideMessage: R.default.string,
328
+ showMessage: R.default.string,
329
+ className: R.default.string,
330
+ language: R.default.string
331
331
  };
332
332
  static defaultProps = {
333
333
  show: !1,
@@ -348,16 +348,17 @@ var he = h, B = he.default, ge = B && typeof B == "object" ? B : he, _e = me(v,
348
348
  }
349
349
  render() {
350
350
  let { className: e, toggled: t, language: n } = this.props, r = pe.forLocale(n, this.relabel), i = this.props.hideMessage ?? r.t("hideCorrectAnswer"), a = this.props.showMessage ?? r.t("showCorrectAnswer");
351
- return /* @__PURE__ */ P(ye, {
351
+ return /* @__PURE__ */ F(ye, {
352
352
  className: e,
353
- children: /* @__PURE__ */ P(fe, {
353
+ ...f(n),
354
+ children: /* @__PURE__ */ F(fe, {
354
355
  show: this.state.show,
355
- children: /* @__PURE__ */ F(be, {
356
+ children: /* @__PURE__ */ I(be, {
356
357
  type: "button",
357
358
  "aria-pressed": !!t,
358
359
  onClick: this.onClick.bind(this),
359
360
  onTouchEnd: this.onTouch.bind(this),
360
- children: [/* @__PURE__ */ F(Ce, { children: [/* @__PURE__ */ P(y, {
361
+ children: [/* @__PURE__ */ I(Ce, { children: [/* @__PURE__ */ F(y, {
361
362
  nodeRef: this.openIconRef,
362
363
  timeout: 400,
363
364
  in: t,
@@ -368,11 +369,11 @@ var he = h, B = he.default, ge = B && typeof B == "object" ? B : he, _e = me(v,
368
369
  exit: "exit",
369
370
  exitActive: "exit-active"
370
371
  },
371
- children: /* @__PURE__ */ P(Se, {
372
+ children: /* @__PURE__ */ F(Se, {
372
373
  ref: this.openIconRef,
373
- children: /* @__PURE__ */ P(R, { open: t }, "correct-open")
374
+ children: /* @__PURE__ */ F(z, { open: t }, "correct-open")
374
375
  })
375
- }), /* @__PURE__ */ P(y, {
376
+ }), /* @__PURE__ */ F(y, {
376
377
  nodeRef: this.closedIconRef,
377
378
  timeout: 5e3,
378
379
  in: !t,
@@ -383,13 +384,13 @@ var he = h, B = he.default, ge = B && typeof B == "object" ? B : he, _e = me(v,
383
384
  exit: "exit",
384
385
  exitActive: "exit-active"
385
386
  },
386
- children: /* @__PURE__ */ P(Se, {
387
+ children: /* @__PURE__ */ F(Se, {
387
388
  ref: this.closedIconRef,
388
- children: /* @__PURE__ */ P(R, { open: t }, "correct-closed")
389
+ children: /* @__PURE__ */ F(z, { open: t }, "correct-closed")
389
390
  })
390
- })] }), /* @__PURE__ */ P(_e, {
391
+ })] }), /* @__PURE__ */ F(_e, {
391
392
  false: !0,
392
- children: /* @__PURE__ */ P(xe, {
393
+ children: /* @__PURE__ */ F(xe, {
393
394
  "aria-hidden": !this.state.show,
394
395
  children: t ? i : a
395
396
  })
@@ -401,22 +402,22 @@ var he = h, B = he.default, ge = B && typeof B == "object" ? B : he, _e = me(v,
401
402
  };
402
403
  //#endregion
403
404
  //#region ../../lib-react/drag/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js
404
- function V(e) {
405
+ function H(e) {
405
406
  var t, n, r = "";
406
407
  if (typeof e == "string" || typeof e == "number") r += e;
407
408
  else if (typeof e == "object") if (Array.isArray(e)) {
408
409
  var i = e.length;
409
- for (t = 0; t < i; t++) e[t] && (n = V(e[t])) && (r && (r += " "), r += n);
410
+ for (t = 0; t < i; t++) e[t] && (n = H(e[t])) && (r && (r += " "), r += n);
410
411
  } else for (n in e) e[n] && (r && (r += " "), r += n);
411
412
  return r;
412
413
  }
413
- function H() {
414
- for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = V(e)) && (r && (r += " "), r += t);
414
+ function U() {
415
+ for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = H(e)) && (r && (r += " "), r += t);
415
416
  return r;
416
417
  }
417
418
  //#endregion
418
419
  //#region ../../lib-react/drag/dist/placeholder.js
419
- var U = _.v("pie")("background", _.defaults.WHITE), Te = k("div")(({ theme: e }) => ({
420
+ var Te = h.v("pie")("background", h.defaults.WHITE), Ee = A("div")(({ theme: e }) => ({
420
421
  "&.placeholder": {
421
422
  WebkitTouchCallout: "none",
422
423
  WebkitUserSelect: "none",
@@ -426,22 +427,22 @@ var U = _.v("pie")("background", _.defaults.WHITE), Te = k("div")(({ theme: e })
426
427
  userSelect: "none",
427
428
  width: "100%",
428
429
  height: "100%",
429
- background: U,
430
+ background: Te,
430
431
  transition: "background-color 200ms linear, border-color 200ms linear",
431
432
  boxSizing: "border-box",
432
433
  display: "grid",
433
434
  gridRowGap: e.spacing(1),
434
435
  gridColumnGap: e.spacing(1),
435
436
  padding: e.spacing(1),
436
- border: `2px dashed ${_.borderDark()}`
437
+ border: `2px dashed ${h.borderDark()}`
437
438
  },
438
439
  "&.placeholderDisabled": {
439
440
  boxShadow: "none",
440
- background: U
441
+ background: Te
441
442
  },
442
443
  "&.over": {
443
- border: `1px solid ${_.border()}`,
444
- backgroundColor: _.backgroundDark()
444
+ border: `1px solid ${h.border()}`,
445
+ backgroundColor: h.backgroundDark()
445
446
  },
446
447
  "&.board": {
447
448
  padding: e.spacing(1),
@@ -452,7 +453,7 @@ var U = _.v("pie")("background", _.defaults.WHITE), Te = k("div")(({ theme: e })
452
453
  justifyContent: "center",
453
454
  overflow: "hidden",
454
455
  touchAction: "none",
455
- backgroundColor: _.surface()
456
+ backgroundColor: h.surface()
456
457
  },
457
458
  "&.categorizeBoard": {
458
459
  padding: e.spacing(.5),
@@ -463,56 +464,56 @@ var U = _.v("pie")("background", _.defaults.WHITE), Te = k("div")(({ theme: e })
463
464
  justifyContent: "center",
464
465
  overflow: "hidden",
465
466
  touchAction: "none",
466
- backgroundColor: _.surface()
467
+ backgroundColor: h.surface()
467
468
  },
468
469
  "&.verticalPool": {
469
470
  display: "flex",
470
471
  flexFlow: "column wrap"
471
472
  }
472
- })), W = (e) => {
473
- let { children: t, className: n, isOver: r, type: i, grid: a, disabled: o, choiceBoard: s, isCategorize: c, isVerticalPool: l, minHeight: u, extraStyles: d } = e, f = H("placeholder", o && "placeholderDisabled", r && "over", i, n), p = {};
473
+ })), De = (e) => {
474
+ let { children: t, className: n, isOver: r, type: i, grid: a, disabled: o, choiceBoard: s, isCategorize: c, isVerticalPool: l, minHeight: u, extraStyles: d } = e, f = U("placeholder", o && "placeholderDisabled", r && "over", i, n), p = {};
474
475
  if (a && a.columns && (p.gridTemplateColumns = `repeat(${a.columns}, 1fr)`), a && a.rows) {
475
476
  let e = a.rowsRepeatValue || "1fr";
476
477
  p.gridTemplateRows = `repeat(${a.rows}, ${e})`;
477
478
  }
478
- i === "choice" && (p.border = `1px solid ${_.borderDark()}`, p.background = _.surface());
479
+ i === "choice" && (p.border = `1px solid ${h.borderDark()}`, p.background = h.surface());
479
480
  let m = c ? "categorizeBoard" : "board";
480
- return /* @__PURE__ */ P(Te, {
481
+ return /* @__PURE__ */ F(Ee, {
481
482
  style: {
482
483
  ...p,
483
484
  minHeight: u,
484
485
  ...d
485
486
  },
486
- className: H(s ? m : f, l && "verticalPool"),
487
+ className: U(s ? m : f, l && "verticalPool"),
487
488
  children: t
488
489
  });
489
490
  };
490
- W.propTypes = {
491
- choiceBoard: L.default.bool,
492
- grid: L.default.shape({
493
- columns: L.default.number,
494
- rows: L.default.number,
495
- rowsRepeatValue: L.default.string
491
+ De.propTypes = {
492
+ choiceBoard: R.default.bool,
493
+ grid: R.default.shape({
494
+ columns: R.default.number,
495
+ rows: R.default.number,
496
+ rowsRepeatValue: R.default.string
496
497
  }),
497
- children: L.default.oneOfType([L.default.arrayOf(L.default.node), L.default.node]).isRequired,
498
- className: L.default.string,
499
- isOver: L.default.bool,
500
- index: L.default.number,
501
- type: L.default.string,
502
- disabled: L.default.bool,
503
- isCategorize: L.default.bool,
504
- isVerticalPool: L.default.bool,
505
- minHeight: L.default.number
498
+ children: R.default.oneOfType([R.default.arrayOf(R.default.node), R.default.node]).isRequired,
499
+ className: R.default.string,
500
+ isOver: R.default.bool,
501
+ index: R.default.number,
502
+ type: R.default.string,
503
+ disabled: R.default.bool,
504
+ isCategorize: R.default.bool,
505
+ isVerticalPool: R.default.bool,
506
+ minHeight: R.default.number
506
507
  };
507
508
  //#endregion
508
509
  //#region ../../lib-react/drag/dist/collision.js
509
- var Ee = (e, t, n) => ({
510
+ var Oe = (e, t, n) => ({
510
511
  ...e,
511
512
  left: e.left + t,
512
513
  right: e.right + t,
513
514
  top: e.top + n,
514
515
  bottom: e.bottom + n
515
- }), De = (e, t) => {
516
+ }), ke = (e, t) => {
516
517
  let n = /* @__PURE__ */ new Map();
517
518
  return e.forEach((e, r) => {
518
519
  let i = Math.max(e.left, t.left), a = Math.max(e.top, t.top), o = Math.min(e.right, t.right), s = Math.min(e.bottom, t.bottom);
@@ -526,7 +527,7 @@ var Ee = (e, t, n) => ({
526
527
  });
527
528
  }), n;
528
529
  };
529
- function Oe({ detect: e = m, modifiers: t } = {}) {
530
+ function Ae({ detect: e = g, modifiers: t } = {}) {
530
531
  let n = null, r = {
531
532
  x: 0,
532
533
  y: 0
@@ -534,11 +535,11 @@ function Oe({ detect: e = m, modifiers: t } = {}) {
534
535
  return {
535
536
  collisionDetection: (a) => (n = a.pointerCoordinates, e(!t || !n ? a : {
536
537
  ...a,
537
- collisionRect: Ee(a.collisionRect, -r.x, -r.y),
538
- droppableRects: i ? De(a.droppableRects, i) : a.droppableRects
538
+ collisionRect: Oe(a.collisionRect, -r.x, -r.y),
539
+ droppableRects: i ? ke(a.droppableRects, i) : a.droppableRects
539
540
  })),
540
541
  ...t && { modifiers: [(e) => {
541
- let n = D(t, e);
542
+ let n = O(t, e);
542
543
  return r = {
543
544
  x: n.x - e.transform.x,
544
545
  y: n.y - e.transform.y
@@ -552,50 +553,50 @@ function Oe({ detect: e = m, modifiers: t } = {}) {
552
553
  }
553
554
  //#endregion
554
555
  //#region src/delivery/tile.tsx
555
- var ke = (0, I.default)("pie-elements:placement-ordering:tile"), Ae = k("div")(({ theme: e }) => ({
556
+ var je = (0, L.default)("pie-elements:placement-ordering:tile"), Me = A("div")(({ theme: e }) => ({
556
557
  width: "100%",
557
558
  fontSize: e.typography.fontSize + 4,
558
559
  textAlign: "center",
559
560
  color: "inherit"
560
- })), je = ({ type: e, index: t, isOver: n, disabled: r }) => /* @__PURE__ */ P(W, {
561
+ })), Ne = ({ type: e, index: t, isOver: n, disabled: r }) => /* @__PURE__ */ F(De, {
561
562
  type: e,
562
563
  isOver: n,
563
564
  disabled: r,
564
- children: e === "target" && t !== void 0 && /* @__PURE__ */ P(Ae, { children: t })
565
+ children: e === "target" && t !== void 0 && /* @__PURE__ */ F(Me, { children: t })
565
566
  });
566
- je.propTypes = {
567
- type: L.default.string,
568
- index: L.default.number,
569
- isOver: L.default.bool,
570
- disabled: L.default.bool
567
+ Ne.propTypes = {
568
+ type: R.default.string,
569
+ index: R.default.number,
570
+ isOver: R.default.bool,
571
+ disabled: R.default.bool
571
572
  };
572
- var Me = k("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled: i, outcome: a, label: o, type: s }) => ({
573
+ var Pe = A("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled: i, outcome: a, label: o, type: s }) => ({
573
574
  cursor: i ? "not-allowed" : "grab",
574
575
  width: "100%",
575
576
  height: "100%",
576
577
  padding: "10px",
577
578
  boxSizing: "border-box",
578
579
  overflow: "hidden",
579
- border: s === "choice" || s === "target" ? `1px solid ${_.borderDark()}` : "1px solid transparent",
580
- backgroundColor: s === "choice" || s === "target" ? _.background() : "transparent",
580
+ border: s === "choice" || s === "target" ? `1px solid ${h.borderDark()}` : "1px solid transparent",
581
+ backgroundColor: s === "choice" || s === "target" ? h.background() : "transparent",
581
582
  transition: s === "choice" || s === "target" ? "background-color 150ms ease, border-color 150ms ease, opacity 150ms ease" : "none",
582
583
  pointerEvents: "none",
583
584
  userSelect: "none",
584
585
  ...(s === "choice" || s === "target") && { "&:hover": {
585
- backgroundColor: i ? _.background() : _.secondary(),
586
- borderColor: i ? _.disabled() : e.palette.primary.main,
586
+ backgroundColor: i ? h.background() : h.secondary(),
587
+ borderColor: i ? h.disabled() : e.palette.primary.main,
587
588
  transform: i ? "none" : "scale(1.02)"
588
589
  } },
589
590
  ...(s === "choice" || s === "target") && r && !i && {
590
591
  opacity: .4,
591
- backgroundColor: _.primaryLight(),
592
+ backgroundColor: h.primaryLight(),
592
593
  borderColor: e.palette.primary.main,
593
594
  borderStyle: "dashed",
594
595
  transform: "scale(1.05)"
595
596
  },
596
597
  ...(s === "choice" || s === "target") && (t || n) && !i && {
597
598
  opacity: .6,
598
- backgroundColor: _.secondaryLight(),
599
+ backgroundColor: h.secondaryLight(),
599
600
  transform: "scale(1.05) rotate(2deg)",
600
601
  boxShadow: "0 8px 16px rgba(0,0,0,0.2)",
601
602
  cursor: "grabbing"
@@ -603,24 +604,24 @@ var Me = k("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled
603
604
  ...(s === "choice" || s === "target") && i && {
604
605
  cursor: "not-allowed",
605
606
  "&:hover": {
606
- backgroundColor: _.background(),
607
+ backgroundColor: h.background(),
607
608
  transform: "none"
608
609
  }
609
610
  },
610
- ...(s === "choice" || s === "target") && a === "incorrect" && { border: `1px solid ${_.incorrect()}` },
611
- ...(s === "choice" || s === "target") && a === "correct" && { border: `1px solid ${_.correct()}` },
611
+ ...(s === "choice" || s === "target") && a === "incorrect" && { border: `1px solid ${h.incorrect()}` },
612
+ ...(s === "choice" || s === "target") && a === "correct" && { border: `1px solid ${h.correct()}` },
612
613
  ...!o && {
613
614
  border: "none",
614
615
  "&:hover": { backgroundColor: "unset" }
615
616
  }
616
- })), Ne = (e) => {
617
+ })), Fe = (e) => {
617
618
  let { type: t, isDragging: n, isSelected: r, empty: i, isOver: a, label: o, disabled: s, outcome: c, guideIndex: l } = e;
618
- return i ? /* @__PURE__ */ P(je, {
619
+ return i ? /* @__PURE__ */ F(Ne, {
619
620
  type: t,
620
621
  index: l,
621
622
  isOver: a,
622
623
  disabled: s
623
- }) : /* @__PURE__ */ P(Me, {
624
+ }) : /* @__PURE__ */ F(Pe, {
624
625
  type: t,
625
626
  isDragging: n,
626
627
  isSelected: r,
@@ -628,9 +629,9 @@ var Me = k("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled
628
629
  disabled: s,
629
630
  outcome: c,
630
631
  label: o,
631
- dangerouslySetInnerHTML: { __html: C(o) }
632
+ dangerouslySetInnerHTML: { __html: x(o) }
632
633
  });
633
- }, G = (e) => {
634
+ }, W = (e) => {
634
635
  let { label: t, type: n, id: r, empty: i, disabled: a, outcome: o, index: s, guideIndex: c, instanceId: l, draggable: u, tileIndex: d, selectedChoice: f, onChoiceClick: p, onPlacementClick: m } = e, h = `tile-${n}-${r ?? "empty"}-${d}-${l}`, g = `drop-${n}-${r ?? "empty"}-${d}-${l}`, _ = {
635
636
  id: r,
636
637
  type: n,
@@ -645,10 +646,10 @@ var Me = k("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled
645
646
  id: g,
646
647
  data: _,
647
648
  disabled: S
648
- }), T = !!f && f.type === _.type && f.id === _.id && f.index === _.index, [E, D] = j.useState(!1), O = !!f && !a, k = w || n === "target" && O && E, A = () => {
649
+ }), T = !!f && f.type === _.type && f.id === _.id && f.index === _.index, [E, D] = j.useState(!1), O = !!f && !a, ne = w || n === "target" && O && E, k = () => {
649
650
  a || (n === "choice" ? f?.type === "target" ? m?.(_) : u && p?.(_) : n === "target" && (T ? p?.(_) : f ? m?.(_) : u && p?.(_)));
650
- }, M = !(u && !a) && !a && O, ne = (e) => {
651
- (e.code === "Space" || e.code === "Enter") && (e.preventDefault(), A());
651
+ }, A = !(u && !a) && !a && O, M = (e) => {
652
+ (e.code === "Space" || e.code === "Enter") && (e.preventDefault(), k());
652
653
  }, N = j.useRef(null);
653
654
  j.useEffect(() => {
654
655
  let e = N.current, t = (e) => {
@@ -661,9 +662,9 @@ var Me = k("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled
661
662
  let re = (e) => {
662
663
  N.current = e, b(e), C(e);
663
664
  };
664
- ke("[render], props: ", e);
665
- let F = n === "target" ? `target-${s}` : n === "choice" ? `choice-${r}` : null, I = F ? `${l}:${F}` : void 0;
666
- return /* @__PURE__ */ P("div", {
665
+ je("[render], props: ", e);
666
+ let P = n === "target" ? `target-${s}` : n === "choice" ? `choice-${r}` : null, I = P ? `${l}:${P}` : void 0;
667
+ return /* @__PURE__ */ F("div", {
667
668
  ref: re,
668
669
  style: {
669
670
  transform: x ? `translate3d(${x.x}px, ${x.y}px, 0)` : void 0,
@@ -677,10 +678,10 @@ var Me = k("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled
677
678
  zIndex: S ? 1e3 : "auto",
678
679
  willChange: S ? "transform" : "auto"
679
680
  },
680
- role: M ? "button" : void 0,
681
- tabIndex: M ? 0 : void 0,
682
- onKeyDown: M ? ne : void 0,
683
- onClick: A,
681
+ role: A ? "button" : void 0,
682
+ tabIndex: A ? 0 : void 0,
683
+ onKeyDown: A ? M : void 0,
684
+ onClick: k,
684
685
  onMouseEnter: () => D(!0),
685
686
  onMouseLeave: () => D(!1),
686
687
  "data-tile-id": I,
@@ -688,13 +689,13 @@ var Me = k("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled
688
689
  ...y,
689
690
  ...v
690
691
  } : {},
691
- children: /* @__PURE__ */ P(Ne, {
692
+ children: /* @__PURE__ */ F(Fe, {
692
693
  label: t,
693
694
  id: r,
694
695
  empty: i,
695
696
  index: s,
696
697
  guideIndex: c,
697
- isOver: k,
698
+ isOver: ne,
698
699
  isDragging: S,
699
700
  isSelected: T,
700
701
  disabled: a,
@@ -703,109 +704,109 @@ var Me = k("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled
703
704
  })
704
705
  });
705
706
  };
706
- G.propTypes = {
707
- id: L.default.any,
708
- label: L.default.string,
709
- isOver: L.default.bool,
710
- type: L.default.string,
711
- empty: L.default.bool,
712
- disabled: L.default.bool,
713
- outcome: L.default.string,
714
- index: L.default.number,
715
- guideIndex: L.default.number,
716
- instanceId: L.default.any,
717
- draggable: L.default.bool,
718
- tileIndex: L.default.number,
719
- selectedChoice: L.default.object,
720
- onChoiceClick: L.default.func,
721
- onPlacementClick: L.default.func
707
+ W.propTypes = {
708
+ id: R.default.any,
709
+ label: R.default.string,
710
+ isOver: R.default.bool,
711
+ type: R.default.string,
712
+ empty: R.default.bool,
713
+ disabled: R.default.bool,
714
+ outcome: R.default.string,
715
+ index: R.default.number,
716
+ guideIndex: R.default.number,
717
+ instanceId: R.default.any,
718
+ draggable: R.default.bool,
719
+ tileIndex: R.default.number,
720
+ selectedChoice: R.default.object,
721
+ onChoiceClick: R.default.func,
722
+ onPlacementClick: R.default.func
722
723
  };
723
724
  //#endregion
724
725
  //#region src/delivery/tiler.tsx
725
- var K = {
726
- choiceLabel: L.default.string,
727
- targetLabel: L.default.string,
728
- disabled: L.default.bool,
729
- tiles: L.default.array.isRequired,
730
- tileSize: L.default.string,
731
- addGuide: L.default.bool,
732
- selectedChoice: L.default.object,
733
- onChoiceClick: L.default.func,
734
- onPlacementClick: L.default.func
735
- }, Pe = {
726
+ var G = {
727
+ choiceLabel: R.default.string,
728
+ targetLabel: R.default.string,
729
+ disabled: R.default.bool,
730
+ tiles: R.default.array.isRequired,
731
+ tileSize: R.default.string,
732
+ addGuide: R.default.bool,
733
+ selectedChoice: R.default.object,
734
+ onChoiceClick: R.default.func,
735
+ onPlacementClick: R.default.func
736
+ }, Ie = {
736
737
  tileSize: "1fr",
737
738
  disabled: !1,
738
739
  addGuide: !1
739
- }, Fe = (e) => {
740
- let t = (t, n) => (t.instanceId = e.instanceId, t.disabled = e.disabled, t.guideIndex = e.addGuide ? t.index + 1 : void 0, t.tileIndex = n, t.selectedChoice = e.selectedChoice, t.onChoiceClick = e.onChoiceClick, t.onPlacementClick = e.onPlacementClick, e.includeTargets || t.type === "choice" ? /* @__PURE__ */ M(G, {
740
+ }, Le = (e) => {
741
+ let t = (t, n) => (t.instanceId = e.instanceId, t.disabled = e.disabled, t.guideIndex = e.addGuide ? t.index + 1 : void 0, t.tileIndex = n, t.selectedChoice = e.selectedChoice, t.onChoiceClick = e.onChoiceClick, t.onPlacementClick = e.onPlacementClick, e.includeTargets || t.type === "choice" ? /* @__PURE__ */ M(W, {
741
742
  ...t,
742
743
  key: n
743
- }) : /* @__PURE__ */ M(G, {
744
+ }) : /* @__PURE__ */ M(W, {
744
745
  ...t,
745
746
  label: "",
746
747
  key: n
747
748
  }));
748
- return t.propTypes = { ...K }, t;
749
- }, Ie = k("div")(({ theme: e, includeTargets: t }) => ({
749
+ return t.propTypes = { ...G }, t;
750
+ }, Re = A("div")(({ theme: e, includeTargets: t }) => ({
750
751
  display: "grid",
751
752
  paddingBottom: e.spacing(2),
752
753
  ...t && { gridGap: "10px" }
753
- })), Le = k("div")({ textAlign: "center" }), Re = k("div")({
754
+ })), ze = A("div")({ textAlign: "center" }), Be = A("div")({
754
755
  textAlign: "center",
755
756
  gridRow: "3/4"
756
- }), ze = k("div")(({ includeTargets: e }) => ({
757
+ }), Ve = A("div")(({ includeTargets: e }) => ({
757
758
  gridAutoFlow: "column",
758
759
  display: "grid",
759
760
  ...e && { gridGap: "10px" }
760
- })), Be = k("div")({
761
+ })), He = A("div")({
761
762
  gridColumn: "1/2",
762
763
  textAlign: "center"
763
- }), Ve = k("div")({
764
+ }), Ue = A("div")({
764
765
  gridColumn: "2/3",
765
766
  textAlign: "center"
766
- }), He = class extends j.Component {
767
- static propTypes = { ...K };
768
- static defaultProps = { ...Pe };
767
+ }), We = class extends j.Component {
768
+ static propTypes = { ...G };
769
+ static defaultProps = { ...Ie };
769
770
  render() {
770
771
  let { includeTargets: e, choiceLabelEnabled: t, choiceLabel: n, targetLabel: r, tiles: i, tileSize: a } = this.props, o = e ? `auto ${a} auto ${a}` : `auto ${a} auto`, s = e ? i.length / 2 : i.length, c = {
771
772
  gridTemplateColumns: e ? `repeat(${s}, ${a})` : `auto repeat(${Math.floor(s / 2) - 1}, ${a} 10px) ${a} auto`,
772
773
  gridTemplateRows: o
773
774
  }, l = { gridColumn: `1/${s + 1}` };
774
- return /* @__PURE__ */ F(Ie, {
775
+ return /* @__PURE__ */ I(Re, {
775
776
  includeTargets: e,
776
777
  style: c,
777
778
  children: [
778
- /* @__PURE__ */ P(Le, {
779
+ /* @__PURE__ */ F(ze, {
779
780
  style: l,
780
- dangerouslySetInnerHTML: { __html: C(t ? n : "") }
781
+ dangerouslySetInnerHTML: { __html: x(t ? n : "") }
781
782
  }),
782
- e && /* @__PURE__ */ P(Re, {
783
+ e && /* @__PURE__ */ F(Be, {
783
784
  style: l,
784
- dangerouslySetInnerHTML: { __html: C(r) }
785
+ dangerouslySetInnerHTML: { __html: x(r) }
785
786
  }),
786
- i.map(Fe(this.props))
787
+ i.map(Le(this.props))
787
788
  ]
788
789
  });
789
790
  }
790
- }, Ue = class extends j.Component {
791
- static propTypes = { ...K };
792
- static defaultProps = { ...Pe };
791
+ }, Ge = class extends j.Component {
792
+ static propTypes = { ...G };
793
+ static defaultProps = { ...Ie };
793
794
  render() {
794
795
  let { includeTargets: e, choiceLabelEnabled: t, choiceLabel: n, targetLabel: r, tiles: i, tileSize: a } = this.props, o = e ? 2 : 1, s = e ? i.length / 2 : i.length;
795
- return /* @__PURE__ */ F(ze, {
796
+ return /* @__PURE__ */ I(Ve, {
796
797
  includeTargets: e,
797
798
  style: {
798
799
  gridTemplateColumns: `repeat(${o}, ${a})`,
799
800
  gridTemplateRows: e ? `auto repeat(${s}, ${a})` : `auto auto repeat(${Math.floor(s / 2) - 1}, ${a} 10px) ${a} auto`
800
801
  },
801
802
  children: [
802
- /* @__PURE__ */ P(Be, { dangerouslySetInnerHTML: { __html: C(t ? n : "") } }),
803
- e && /* @__PURE__ */ P(Ve, { dangerouslySetInnerHTML: { __html: C(r) } }),
804
- i.map(Fe(this.props))
803
+ /* @__PURE__ */ F(He, { dangerouslySetInnerHTML: { __html: x(t ? n : "") } }),
804
+ e && /* @__PURE__ */ F(Ue, { dangerouslySetInnerHTML: { __html: x(r) } }),
805
+ i.map(Le(this.props))
805
806
  ]
806
807
  });
807
808
  }
808
- }, We = (0, I.default)("pie-elements:placement-ordering:ordering"), Ge = (e, t, n) => {
809
+ }, Ke = (0, L.default)("pie-elements:placement-ordering:ordering"), qe = (e, t, n) => {
809
810
  let r = e.find((e, n) => n === t), i = e.filter((e, n) => n !== t);
810
811
  return [
811
812
  ...i.slice(0, n),
@@ -813,19 +814,19 @@ var K = {
813
814
  ...i.slice(n)
814
815
  ];
815
816
  };
816
- function Ke(e, n) {
817
+ function Je(e, n) {
817
818
  let r = t(e.response);
818
819
  if (r[n.index] === n.id) r[n.index] = void 0;
819
820
  else throw Error(`Tried to remove from index: ${n.index}, but the id doesn't match: array: ${r}, target: ${n.id}`);
820
821
  return r;
821
822
  }
822
- function qe(e, n, r) {
823
+ function Ye(e, n, r) {
823
824
  let { response: i, opts: a } = e, o = t(i);
824
- if (a.includeTargets) return n.type === "choice" && r.type === "target" ? (o[r.index] = n.id, o) : n.type === "target" && r.type === "choice" ? (o[n.index] = void 0, o) : n.type === "target" && r.type === "target" ? (o[r.index] = n.id, o[n.index] = void 0, o) : (We("do nothing to the response"), i);
825
+ if (a.includeTargets) return n.type === "choice" && r.type === "target" ? (o[r.index] = n.id, o) : n.type === "target" && r.type === "choice" ? (o[n.index] = void 0, o) : n.type === "target" && r.type === "target" ? (o[r.index] = n.id, o[n.index] = void 0, o) : (Ke("do nothing to the response"), i);
825
826
  let s = e.response.findIndex((e) => e !== void 0 && e === n.id), c = e.response.findIndex((e) => e !== void 0 && e === r.id);
826
- return We("fromIndex: ", s, "toIndex:", c), Ge(e.response, s, c);
827
+ return Ke("fromIndex: ", s, "toIndex:", c), qe(e.response, s, c);
827
828
  }
828
- function q(e, t, n, r) {
829
+ function K(e, t, n, r) {
829
830
  if (r.includeTargets) {
830
831
  let i = [];
831
832
  for (let r = 0; r < t.length; r++) {
@@ -860,26 +861,26 @@ function q(e, t, n, r) {
860
861
  return i === 0 && t.push(a), t.push(o, a), t;
861
862
  }, []);
862
863
  }
863
- function Je(e, t, n, a) {
864
+ function Xe(e, t, n, a) {
864
865
  return a = i({ includeTargets: !0 }, a), n ||= [], t = !t || r(t) ? a.includeTargets ? Array(e.length) : o(e, (e) => e.id) : t, {
865
866
  choices: e,
866
867
  response: t,
867
868
  opts: a,
868
869
  outcomes: n,
869
- tiles: q(e, t, n, a)
870
+ tiles: K(e, t, n, a)
870
871
  };
871
872
  }
872
- function Ye(e, t) {
873
+ function Ze(e, t) {
873
874
  switch (e.type) {
874
875
  case "move": {
875
- let { from: n, to: r } = e, i = qe(t, n, r), a = q(t.choices, i, t.outcomes, t.opts);
876
+ let { from: n, to: r } = e, i = Ye(t, n, r), a = K(t.choices, i, t.outcomes, t.opts);
876
877
  return Object.assign({}, t, {
877
878
  response: i,
878
879
  tiles: a
879
880
  });
880
881
  }
881
882
  case "remove": {
882
- let { target: n } = e, r = Ke(t, n), i = q(t.choices, r, t.outcomes, t.opts);
883
+ let { target: n } = e, r = Je(t, n), i = K(t.choices, r, t.outcomes, t.opts);
883
884
  return Object.assign({}, t, {
884
885
  response: r,
885
886
  tiles: i
@@ -890,14 +891,14 @@ function Ye(e, t) {
890
891
  }
891
892
  //#endregion
892
893
  //#region src/delivery/utils.ts
893
- var Xe = (e, t) => {
894
+ var Qe = (e, t) => {
894
895
  if (!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) return !1;
895
896
  let n = (e) => e.map((e) => JSON.stringify(e)).sort(), r = n(e), i = n(t), a = r.every((e, t) => e === i[t]), o = e.every((e, n) => JSON.stringify(e) === JSON.stringify(t[n]));
896
897
  return a && !o;
897
- }, Ze = (e, { active: t, context: n, currentCoordinates: r }) => {
898
- let { code: i } = e, a = i === "Tab", o = i === w.Down || i === w.Up || i === w.Left || i === w.Right;
898
+ }, $e = (e, { active: t, context: n, currentCoordinates: r }) => {
899
+ let { code: i } = e, a = i === "Tab", o = i === E.Down || i === E.Up || i === E.Left || i === E.Right;
899
900
  if (!a && !o) return;
900
- if (o) return b(e, {
901
+ if (o) return S(e, {
901
902
  context: n,
902
903
  currentCoordinates: r
903
904
  });
@@ -934,26 +935,26 @@ var Xe = (e, t) => {
934
935
  if (_.length === 0 && !v) return r;
935
936
  let y = e.shiftKey;
936
937
  _.sort((e, t) => Math.abs(e.center.y - t.center.y) > 10 ? e.center.y - t.center.y : e.center.x - t.center.x), v && _.push(v);
937
- let x = 0, S = Infinity;
938
+ let b = 0, x = Infinity;
938
939
  for (let e = 0; e < _.length; e++) {
939
- let t = Qe(p, _[e].center);
940
- t < S && (S = t, x = e);
940
+ let t = et(p, _[e].center);
941
+ t < x && (x = t, b = e);
941
942
  }
942
- return _[y ? (x - 1 + _.length) % _.length : (x + 1) % _.length].dropPosition;
943
- }, Qe = (e, t) => Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
943
+ return _[y ? (b - 1 + _.length) % _.length : (b + 1) % _.length].dropPosition;
944
+ }, et = (e, t) => Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
944
945
  //#endregion
945
946
  //#region src/delivery/placement-ordering.tsx
946
- function J(e) {
947
+ function q(e) {
947
948
  return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
948
949
  }
949
- function Y(e, t) {
950
- return !e || J(e) ? e : J(e.default) ? e.default : t && J(e[t]) ? e[t] : t && J(e[t]?.default) ? e[t].default : e;
950
+ function J(e, t) {
951
+ return !e || q(e) ? e : q(e.default) ? e.default : t && q(e[t]) ? e[t] : t && q(e[t]?.default) ? e[t].default : e;
951
952
  }
952
- var $e = h, X = $e.default, Z = X && typeof X == "object" ? X : $e, et = Y(A, "UiLayout") || Y(Z.UiLayout, "UiLayout"), Q = Y(g, "PreviewPrompt") || Y(Z.PreviewPrompt, "PreviewPrompt"), tt = Y(E, "Feedback") || Y(Z.Feedback, "Feedback"), nt = Y(x, "Collapsible") || Y(Z.Collapsible, "Collapsible"), rt = 250, it = (e, t) => {
953
+ var Y = _, X = Y.default, Z = X && typeof X == "object" ? X : Y, tt = J(k, "UiLayout") || J(Z.UiLayout, "UiLayout"), Q = J(v, "PreviewPrompt") || J(Z.PreviewPrompt, "PreviewPrompt"), nt = J(T, "Feedback") || J(Z.Feedback, "Feedback"), rt = J(C, "Collapsible") || J(Z.Collapsible, "Collapsible"), it = 250, at = (e, t) => {
953
954
  if (!e || !t) return !1;
954
955
  let n = t.left + t.width / 2, r = t.top + t.height / 2;
955
956
  return n >= e.left && n <= e.right && r >= e.top && r <= e.bottom;
956
- }, at = (e, t, n) => {
957
+ }, ot = (e, t, n) => {
957
958
  let { initial: r, translated: i } = e || {};
958
959
  if (!r || !t || typeof n?.clientX != "number") return i;
959
960
  let a = t.x - n.clientX, o = t.y - n.clientY;
@@ -964,61 +965,61 @@ var $e = h, X = $e.default, Z = X && typeof X == "object" ? X : $e, et = Y(A, "U
964
965
  top: r.top + o,
965
966
  bottom: r.bottom + o
966
967
  };
967
- }, ot = (e) => e ? {
968
- keyboardCoordinateGetter: Ze,
968
+ }, st = (e) => e ? {
969
+ keyboardCoordinateGetter: $e,
969
970
  keyboardCodes: {
970
971
  start: ["Space", "Enter"],
971
972
  cancel: ["Escape"],
972
973
  end: ["Space", "Enter"]
973
974
  },
974
975
  accessibility: { screenReaderInstructions: { draggable: "Press Space or Enter to pick up this answer choice. Once picked up, use Tab or Shift+Tab to cycle through response areas, or use arrow keys to move it freely. Press Space or Enter to drop, or Escape to cancel." } }
975
- } : {}, { translator: $ } = s, st = (0, I.default)("pie-elements:placement-ordering"), ct = k("div")({
976
- color: _.text(),
977
- backgroundColor: _.background(),
976
+ } : {}, { translator: $ } = s, ct = (0, L.default)("pie-elements:placement-ordering"), lt = A("div")({
977
+ color: h.text(),
978
+ backgroundColor: h.background(),
978
979
  display: "flex",
979
980
  flexDirection: "column",
980
981
  alignItems: "center",
981
982
  boxSizing: "border-box"
982
- }), lt = k("div")({
983
+ }), ut = A("div")({
983
984
  alignSelf: "stretch",
984
985
  maxWidth: "100%",
985
986
  overflowX: "auto",
986
987
  overflowY: "hidden"
987
- }), ut = k("div")({
988
+ }), dt = A("div")({
988
989
  display: "flex",
989
990
  justifyContent: "center",
990
991
  minWidth: "min-content"
991
- }), dt = k("div")(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), ft = k("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), pt = k(we)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), mt = k(nt)(({ theme: e }) => ({
992
+ }), ft = A("div")(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), pt = A("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), mt = A(we)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), ht = A(rt)(({ theme: e }) => ({
992
993
  marginBottom: e.spacing(2),
993
994
  alignSelf: "flex-start"
994
- })), ht = (e) => {
995
+ })), gt = (e) => {
995
996
  let { tiler: t, ordering: n, onDropChoice: r, onRemoveChoice: i, ...a } = e;
996
- return /* @__PURE__ */ P(t, {
997
+ return /* @__PURE__ */ F(t, {
997
998
  ...a,
998
999
  tiles: n.tiles,
999
1000
  onDropChoice: (e, t) => r(e, t, n),
1000
1001
  onRemoveChoice: (e) => i(e, n)
1001
1002
  });
1002
1003
  };
1003
- ht.propTypes = {
1004
- tiler: L.default.func,
1005
- ordering: L.default.any,
1006
- onDropChoice: L.default.func,
1007
- onRemoveChoice: L.default.func
1004
+ gt.propTypes = {
1005
+ tiler: R.default.func,
1006
+ ordering: R.default.any,
1007
+ onDropChoice: R.default.func,
1008
+ onRemoveChoice: R.default.func
1008
1009
  };
1009
- var gt = class extends j.Component {
1010
+ var _t = class extends j.Component {
1010
1011
  static propTypes = {
1011
- onSessionChange: L.default.func.isRequired,
1012
- model: L.default.object.isRequired,
1013
- session: L.default.oneOfType([L.default.array.isRequired, L.default.object.isRequired])
1012
+ onSessionChange: R.default.func.isRequired,
1013
+ model: R.default.object.isRequired,
1014
+ session: R.default.oneOfType([R.default.array.isRequired, R.default.object.isRequired])
1014
1015
  };
1015
1016
  constructor(e) {
1016
- super(e), this.instanceId = f("placement-ordering");
1017
+ super(e), this.instanceId = u("placement-ordering");
1017
1018
  let { value: t, needsReset: n } = this.validateSession(e);
1018
1019
  this.state = {
1019
1020
  showingCorrect: !1,
1020
1021
  selectedChoice: null
1021
- }, this.lastDragEndAt = 0, this.dragCollision = Oe();
1022
+ }, this.lastDragEndAt = 0, this.dragCollision = Ae();
1022
1023
  let { model: r } = e || {}, { env: i } = r || {}, { mode: a } = i || {};
1023
1024
  n && a === "gather" && this.props.onSessionChange({
1024
1025
  ...e.session,
@@ -1027,7 +1028,7 @@ var gt = class extends j.Component {
1027
1028
  }
1028
1029
  toggleCorrect = (e) => this.setState({ showingCorrect: e });
1029
1030
  componentDidUpdate() {
1030
- u(re.findDOMNode(this));
1031
+ m(P.findDOMNode(this));
1031
1032
  }
1032
1033
  validateSession = ({ model: e, session: t }, n = !1) => {
1033
1034
  let { config: r, choices: i } = e || {}, { includeTargets: a } = r || {}, o = i.map((e) => e.id), { value: s } = t || {}, u;
@@ -1048,7 +1049,7 @@ var gt = class extends j.Component {
1048
1049
  UNSAFE_componentWillReceiveProps(e) {
1049
1050
  let { model: t = {} } = e || {}, { model: n = {} } = this.props || {}, { correctResponse: r, config: i, choices: a = [], env: o } = t, { includeTargets: s } = i || {}, c = {}, l = n.language && n.language !== t.language, u = n.note && n.note === $.t("common:commonCorrectAnswerWithAlternates", { lng: n.language });
1050
1051
  l && u && (n.note = $.t("common:commonCorrectAnswerWithAlternates", { lng: t.language })), r || (c.showingCorrect = !1);
1051
- let d = Xe(a, n.choices), { value: f, needsReset: p } = this.validateSession(e, d), m = {
1052
+ let d = Qe(a, n.choices), { value: f, needsReset: p } = this.validateSession(e, d), m = {
1052
1053
  ...e.session,
1053
1054
  value: f
1054
1055
  }, h = n.config?.includeTargets !== s;
@@ -1059,8 +1060,8 @@ var gt = class extends j.Component {
1059
1060
  }
1060
1061
  onDropChoice = (e, t, n) => {
1061
1062
  let { onSessionChange: r, session: i } = this.props, a = n.tiles.find((e) => e.id === t.id && e.type === t.type && e.index === t.index), o = e;
1062
- st("[onDropChoice] ", a, o);
1063
- let s = Ye({
1063
+ ct("[onDropChoice] ", a, o);
1064
+ let s = Ze({
1064
1065
  type: "move",
1065
1066
  from: a,
1066
1067
  to: o
@@ -1069,8 +1070,8 @@ var gt = class extends j.Component {
1069
1070
  };
1070
1071
  onRemoveChoice = (e, t) => {
1071
1072
  let { onSessionChange: n, session: r } = this.props;
1072
- st("[onRemoveChoice]", e);
1073
- let i = Ye({
1073
+ ct("[onRemoveChoice]", e);
1074
+ let i = Ze({
1074
1075
  type: "remove",
1075
1076
  target: e
1076
1077
  }, t);
@@ -1081,13 +1082,13 @@ var gt = class extends j.Component {
1081
1082
  orientation: "vertical",
1082
1083
  includeTargets: !0
1083
1084
  };
1084
- return n ? Je(e.choices, e.correctResponse, e.correctResponse.map((e) => ({
1085
+ return n ? Xe(e.choices, e.correctResponse, e.correctResponse.map((e) => ({
1085
1086
  id: e,
1086
1087
  outcome: "correct"
1087
1088
  })), {
1088
1089
  includeTargets: r,
1089
1090
  allowSameChoiceInTargets: e.config.allowSameChoiceInTargets
1090
- }) : Je(e.choices, t.value, e.outcomes, {
1091
+ }) : Xe(e.choices, t.value, e.outcomes, {
1091
1092
  includeTargets: r,
1092
1093
  allowSameChoiceInTargets: e.config.allowSameChoiceInTargets
1093
1094
  });
@@ -1102,7 +1103,7 @@ var gt = class extends j.Component {
1102
1103
  }
1103
1104
  e && r && (this.onDropChoice(r, e, i), this.focusTile(this.getDestinationSlotId(r)));
1104
1105
  } else if (!t && n) {
1105
- let e = n.data.current, t = n.rect?.current, a = at(t, this.dragCollision.lastPointer(), r), o = it(t?.initial, a);
1106
+ let e = n.data.current, t = n.rect?.current, a = ot(t, this.dragCollision.lastPointer(), r), o = at(t?.initial, a);
1106
1107
  e && e.type === "target" && !o && (this.onRemoveChoice(e, i), this.focusTile(this.getDestinationSlotId({
1107
1108
  type: "choice",
1108
1109
  id: e.id
@@ -1149,7 +1150,7 @@ var gt = class extends j.Component {
1149
1150
  });
1150
1151
  });
1151
1152
  };
1152
- isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt < rt;
1153
+ isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt < it;
1153
1154
  onChoiceClick = (e) => {
1154
1155
  this.isClickSoonAfterDragEnd() || this.toggleChoiceSelection(e);
1155
1156
  };
@@ -1157,71 +1158,71 @@ var gt = class extends j.Component {
1157
1158
  this.isClickSoonAfterDragEnd() || this.placeSelectedChoice(e);
1158
1159
  };
1159
1160
  render() {
1160
- let { model: e } = this.props, { correctResponse: t, correctness: n, extraCSSRules: r, prompt: i, rationale: a, feedback: o, config: s, note: c, showNote: l, env: u, disabled: d, teacherInstructions: f, language: p } = e, m = t && t.length > 0, { showingCorrect: h } = this.state, g = s || {
1161
+ let { model: e } = this.props, { correctResponse: t, correctness: n, extraCSSRules: r, prompt: i, rationale: a, feedback: o, config: s, note: c, showNote: l, env: u, disabled: d, teacherInstructions: f, language: p } = e, m = t && t.length > 0, { showingCorrect: g } = this.state, _ = s || {
1161
1162
  orientation: "vertical",
1162
1163
  includeTargets: !0
1163
- }, { orientation: v, includeTargets: y } = g, b = v === "vertical", x = this.createOrdering(), { mode: w, role: ee } = u || {}, E = b ? Ue : He, D = (h || w === "view" && ee === "instructor") && l && c, te = a && (S(a) || T(a)), k = f && (S(f) || T(f)), A = {
1164
- color: _.text(),
1165
- backgroundColor: _.background(),
1164
+ }, { orientation: v, includeTargets: y } = _, b = v === "vertical", S = this.createOrdering(), { mode: C, role: T } = u || {}, E = b ? Ge : We, ee = (g || C === "view" && T === "instructor") && l && c, O = a && (w(a) || D(a)), te = f && (w(f) || D(f)), k = {
1165
+ color: h.text(),
1166
+ backgroundColor: h.background(),
1166
1167
  display: "flex",
1167
1168
  flexDirection: "column",
1168
1169
  alignItems: "center",
1169
1170
  boxSizing: "border-box",
1170
1171
  width: "100%"
1171
- }, j = y ? {
1172
+ }, A = y ? {
1172
1173
  selectedChoice: this.state.selectedChoice,
1173
1174
  onChoiceClick: this.onChoiceClick,
1174
1175
  onPlacementClick: this.onPlacementClick
1175
1176
  } : {};
1176
- return /* @__PURE__ */ P(O, {
1177
+ return /* @__PURE__ */ F(ne, {
1177
1178
  onDragStart: this.onDragStart,
1178
1179
  onDragEnd: this.onDragEnd,
1179
1180
  onDragCancel: this.onDragCancel,
1180
1181
  collisionDetection: this.dragCollision.collisionDetection,
1181
1182
  modifiers: [oe],
1182
- ...ot(y),
1183
- children: /* @__PURE__ */ P(ct, { children: /* @__PURE__ */ F(et, {
1183
+ ...st(y),
1184
+ children: /* @__PURE__ */ F(lt, { children: /* @__PURE__ */ I(tt, {
1184
1185
  extraCSSRules: r,
1185
- style: A,
1186
+ style: k,
1186
1187
  children: [
1187
- k && /* @__PURE__ */ P(mt, {
1188
+ te && /* @__PURE__ */ F(ht, {
1188
1189
  labels: {
1189
1190
  hidden: $.t("common:showTeacherInstructions", { lng: p }),
1190
1191
  visible: $.t("common:hideTeacherInstructions", { lng: p })
1191
1192
  },
1192
1193
  className: "collapsible",
1193
- children: /* @__PURE__ */ P(Q, { prompt: f })
1194
+ children: /* @__PURE__ */ F(Q, { prompt: f })
1194
1195
  }),
1195
- /* @__PURE__ */ P(dt, { children: /* @__PURE__ */ P(Q, { prompt: i }) }),
1196
- /* @__PURE__ */ P(pt, {
1196
+ /* @__PURE__ */ F(ft, { children: /* @__PURE__ */ F(Q, { prompt: i }) }),
1197
+ /* @__PURE__ */ F(mt, {
1197
1198
  show: m,
1198
- toggled: h,
1199
+ toggled: g,
1199
1200
  onToggle: this.toggleCorrect,
1200
1201
  language: p
1201
1202
  }),
1202
- /* @__PURE__ */ P(lt, { children: /* @__PURE__ */ P(ut, { children: /* @__PURE__ */ P(ht, {
1203
+ /* @__PURE__ */ F(ut, { children: /* @__PURE__ */ F(dt, { children: /* @__PURE__ */ F(gt, {
1203
1204
  instanceId: this.instanceId,
1204
- choiceLabel: g.choiceLabel,
1205
- targetLabel: g.targetLabel,
1206
- ordering: x,
1205
+ choiceLabel: _.choiceLabel,
1206
+ targetLabel: _.targetLabel,
1207
+ ordering: S,
1207
1208
  tiler: E,
1208
1209
  disabled: d,
1209
- addGuide: g.showOrdering,
1210
- tileSize: g.tileSize,
1210
+ addGuide: _.showOrdering,
1211
+ tileSize: _.tileSize,
1211
1212
  includeTargets: y,
1212
1213
  choiceLabelEnabled: e.config && e.config.choiceLabelEnabled,
1213
- ...j
1214
+ ...A
1214
1215
  }) }) }),
1215
- D && /* @__PURE__ */ P(ft, { dangerouslySetInnerHTML: { __html: C(c) } }),
1216
- te && /* @__PURE__ */ P(mt, {
1216
+ ee && /* @__PURE__ */ F(pt, { dangerouslySetInnerHTML: { __html: x(c) } }),
1217
+ O && /* @__PURE__ */ F(ht, {
1217
1218
  labels: {
1218
1219
  hidden: $.t("common:showRationale", { lng: p }),
1219
1220
  visible: $.t("common:hideRationale", { lng: p })
1220
1221
  },
1221
1222
  className: "collapsible",
1222
- children: /* @__PURE__ */ P(Q, { prompt: a })
1223
+ children: /* @__PURE__ */ F(Q, { prompt: a })
1223
1224
  }),
1224
- !h && /* @__PURE__ */ P(tt, {
1225
+ !g && /* @__PURE__ */ F(nt, {
1225
1226
  correctness: n,
1226
1227
  feedback: o
1227
1228
  })
@@ -1229,30 +1230,30 @@ var gt = class extends j.Component {
1229
1230
  }) })
1230
1231
  });
1231
1232
  }
1232
- }, _t = class extends j.Component {
1233
+ }, vt = class extends j.Component {
1233
1234
  static propTypes = {
1234
- model: L.default.object.isRequired,
1235
- session: L.default.oneOfType([L.default.array.isRequired, L.default.object.isRequired]),
1236
- onSessionChange: L.default.func.isRequired
1235
+ model: R.default.object.isRequired,
1236
+ session: R.default.oneOfType([R.default.array.isRequired, R.default.object.isRequired]),
1237
+ onSessionChange: R.default.func.isRequired
1237
1238
  };
1238
1239
  render() {
1239
1240
  let { model: e, session: t, onSessionChange: n } = this.props;
1240
- return /* @__PURE__ */ P(gt, {
1241
+ return /* @__PURE__ */ F(_t, {
1241
1242
  model: e,
1242
1243
  session: t,
1243
1244
  onSessionChange: n
1244
1245
  });
1245
1246
  }
1246
- }, vt = (0, I.default)("pie-elements:placement-ordering"), yt = ({ model: e, session: t }) => {
1247
+ }, yt = (0, L.default)("pie-elements:placement-ordering"), bt = ({ model: e, session: t }) => {
1247
1248
  let { config: r } = e, i = (t && n(t.value) || []).length === e.choices.length;
1248
1249
  return r.includeTargets || i;
1249
- }, bt = class extends HTMLElement {
1250
+ }, xt = class extends HTMLElement {
1250
1251
  constructor() {
1251
1252
  super(), this._root = null, this._mathObserver = null, this._mathRenderPending = !1;
1252
1253
  }
1253
1254
  _scheduleMathRender = () => {
1254
1255
  this._mathRenderPending || (this._mathRenderPending = !0, requestAnimationFrame(() => {
1255
- this._mathObserver && this._mathObserver.disconnect(), u(this), this._mathRenderPending = !1, setTimeout(() => {
1256
+ this._mathObserver && this._mathObserver.disconnect(), m(this), this._mathRenderPending = !1, setTimeout(() => {
1256
1257
  this._mathObserver && this._mathObserver.observe(this, {
1257
1258
  childList: !0,
1258
1259
  subtree: !0
@@ -1287,13 +1288,13 @@ var gt = class extends j.Component {
1287
1288
  }
1288
1289
  render() {
1289
1290
  if (this._model && this._session) {
1290
- vt("[render] session: ", this._session.value), vt("[render] model: ", this._model), this._initMathObserver();
1291
- let e = j.createElement(_t, {
1291
+ yt("[render] session: ", this._session.value), yt("[render] model: ", this._model), this._initMathObserver();
1292
+ let e = j.createElement(vt, {
1292
1293
  model: this._model,
1293
1294
  session: this._session,
1294
1295
  onSessionChange: this.sessionChange
1295
1296
  });
1296
- this._root ||= N(this), this._root.render(e);
1297
+ this._root ||= re(this), this._root.render(e);
1297
1298
  }
1298
1299
  }
1299
1300
  connectedCallback() {
@@ -1302,11 +1303,11 @@ var gt = class extends j.Component {
1302
1303
  disconnectedCallback() {
1303
1304
  this._disconnectMathObserver(), this._root &&= (this._root.unmount(), null);
1304
1305
  }
1305
- }, xt = Object.freeze({
1306
+ }, St = Object.freeze({
1306
1307
  name: "@pie-element/placement-ordering",
1307
- version: "15.0.6"
1308
+ version: "15.0.7-next.20261019062545"
1308
1309
  });
1309
1310
  //#endregion
1310
- export { bt as default, yt as isValidSession, xt as piePackage };
1311
+ export { xt as default, bt as isValidSession, St as piePackage };
1311
1312
 
1312
1313
  //# sourceMappingURL=index.js.map