@citolab/qti-components 10.0.0-next.1 → 10.0.0-next.11

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 (65) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +3701 -765
  3. package/dist/base.d.ts +10 -10
  4. package/dist/base.js +7 -1
  5. package/dist/{chunk-FWR6HZQS.js → chunk-454ZDSKX.js} +16 -13
  6. package/dist/chunk-454ZDSKX.js.map +1 -0
  7. package/dist/{chunk-35WWWFS6.js → chunk-AJ5U5KXR.js} +2 -2
  8. package/dist/{chunk-FD4AB6TM.js → chunk-AVZRY5SQ.js} +2 -2
  9. package/dist/{chunk-CKJ7M7JQ.js → chunk-KYNLY2ET.js} +2340 -2032
  10. package/dist/chunk-KYNLY2ET.js.map +1 -0
  11. package/dist/{chunk-6K3QWJHH.js → chunk-LCGPLQLE.js} +40 -4
  12. package/dist/chunk-LCGPLQLE.js.map +1 -0
  13. package/dist/{chunk-MI7774NV.js → chunk-M7X6TWSX.js} +2 -2
  14. package/dist/{chunk-YYIS6FDP.js → chunk-N2CTFOIK.js} +2 -2
  15. package/dist/{chunk-RSMYGGQK.js → chunk-O76BOKAP.js} +496 -271
  16. package/dist/chunk-O76BOKAP.js.map +1 -0
  17. package/dist/{chunk-GBZNFSFY.js → chunk-RWMY7KRT.js} +2 -2
  18. package/dist/{chunk-TDWJ6WZA.js → chunk-T7YSBBAA.js} +37 -1
  19. package/dist/chunk-T7YSBBAA.js.map +1 -0
  20. package/dist/{chunk-RU6332MD.js → chunk-XXJAE6AP.js} +3 -3
  21. package/dist/chunk-YKXVAXSI.js +7 -0
  22. package/dist/chunk-YKXVAXSI.js.map +1 -0
  23. package/dist/{chunk-6U3YPHXU.js → chunk-YOCOLMGB.js} +40 -5
  24. package/dist/{chunk-6U3YPHXU.js.map → chunk-YOCOLMGB.js.map} +1 -1
  25. package/dist/{computed.types.d-gJrBeUMG.d.ts → computed.types.d-IXACuBr7.d.ts} +10 -1
  26. package/dist/corrections.d.ts +9 -9
  27. package/dist/corrections.js +8 -8
  28. package/dist/elements.d.ts +2 -2
  29. package/dist/elements.js +3 -3
  30. package/dist/index.d.ts +11 -11
  31. package/dist/index.js +37 -19
  32. package/dist/interactions.d.ts +4 -4
  33. package/dist/interactions.js +7 -3
  34. package/dist/item.css +1581 -387
  35. package/dist/item.d.ts +4 -4
  36. package/dist/item.js +4 -4
  37. package/dist/{item.types.d-B55QkJ92.d.ts → item.types.d-DuVR0ZVK.d.ts} +7 -1
  38. package/dist/loader.d.ts +2 -2
  39. package/dist/processing.d.ts +10 -3
  40. package/dist/processing.js +3 -3
  41. package/dist/qti-components-jsx.d.ts +934 -761
  42. package/dist/{qti-condition-expression.d-VJH6cWxf.d.ts → qti-condition-expression.d-B-T1NNl0.d.ts} +1 -1
  43. package/dist/{qti-expression.d-BPxEp8HU.d.ts → qti-expression.d-B-Cfbqlb.d.ts} +1 -1
  44. package/dist/{qti-feedback.d-wMYNVkkj.d.ts → qti-feedback.d-DbzPSJuK.d.ts} +1 -1
  45. package/dist/{qti-item.d-DgC1AQbY.d.ts → qti-item.d-B1gffYCL.d.ts} +1 -1
  46. package/dist/{qti-test.d-DkpBNcsv.d.ts → qti-test.d-D5C7W8Lg.d.ts} +185 -101
  47. package/dist/{qti-text-entry-interaction.d-q8u5BiVK.d.ts → qti-text-entry-interaction.d-CU-fAAD1.d.ts} +28 -19
  48. package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-wB9uYs-j.d.ts} +34 -2
  49. package/dist/{session.context.d-D5080LVx.d.ts → session.context.d-DW09Lrie.d.ts} +7 -1
  50. package/dist/test.d.ts +117 -9
  51. package/dist/test.js +19 -11
  52. package/package.json +9 -9
  53. package/dist/chunk-6K3QWJHH.js.map +0 -1
  54. package/dist/chunk-CKJ7M7JQ.js.map +0 -1
  55. package/dist/chunk-FWR6HZQS.js.map +0 -1
  56. package/dist/chunk-RSMYGGQK.js.map +0 -1
  57. package/dist/chunk-TDWJ6WZA.js.map +0 -1
  58. package/dist/chunk-ZP6QQYSU.js +0 -7
  59. package/dist/chunk-ZP6QQYSU.js.map +0 -1
  60. /package/dist/{chunk-35WWWFS6.js.map → chunk-AJ5U5KXR.js.map} +0 -0
  61. /package/dist/{chunk-FD4AB6TM.js.map → chunk-AVZRY5SQ.js.map} +0 -0
  62. /package/dist/{chunk-MI7774NV.js.map → chunk-M7X6TWSX.js.map} +0 -0
  63. /package/dist/{chunk-YYIS6FDP.js.map → chunk-N2CTFOIK.js.map} +0 -0
  64. /package/dist/{chunk-GBZNFSFY.js.map → chunk-RWMY7KRT.js.map} +0 -0
  65. /package/dist/{chunk-RU6332MD.js.map → chunk-XXJAE6AP.js.map} +0 -0
@@ -6,15 +6,18 @@ import {
6
6
  boxSizing,
7
7
  configContext,
8
8
  dropRegion,
9
+ inferRecordFieldBaseType,
9
10
  interactionContext,
11
+ isRecordValue,
10
12
  itemContext,
11
13
  parseResponseAttribute,
12
14
  qtiContext,
15
+ readRecordFieldValues,
13
16
  removeDoubleSlashes,
14
17
  responseAttributeConverter,
15
18
  serializeResponseAttribute,
16
19
  validationMessage
17
- } from "./chunk-TDWJ6WZA.js";
20
+ } from "./chunk-T7YSBBAA.js";
18
21
 
19
22
  // ../interactions/core/dist/elements/qti-associable-hotspot/qti-associable-hotspot.js
20
23
  import { LitElement, html } from "lit";
@@ -49,6 +52,12 @@ var qti_associable_hotspot_styles_default = [
49
52
  width: 100%;
50
53
  height: 100%;
51
54
  }
55
+
56
+ /* A placed chip keeps the box it had in the bank, even in a hotspot narrower than it (a boxed
57
+ word on a small region): shrinking would wrap or squeeze its text (drag-drop.invariance). */
58
+ [part~='drag'] {
59
+ flex-shrink: 0;
60
+ }
52
61
  `
53
62
  ];
54
63
 
@@ -207,6 +216,10 @@ var qti_gap_img_styles_default = [
207
216
  align-items: center;
208
217
  justify-content: center;
209
218
  user-select: none;
219
+ /* In graphic-gap-match the picture's authored size is in the graphic's coordinate space, so it
220
+ scales with the graphic and keeps fitting its hotspot. The interaction publishes the factor;
221
+ anywhere else it is unset and the chip keeps its size. */
222
+ zoom: var(--qti-graphic-scale, 1);
210
223
  }
211
224
  `
212
225
  ];
@@ -269,8 +282,11 @@ var ariaBooleanConverter = {
269
282
  toAttribute: (value) => value ? "true" : "false",
270
283
  fromAttribute: (value) => value === "true"
271
284
  };
272
- function ActiveElementMixin(Base, type) {
285
+ function ActiveElementMixin(Base, type, { activateOn = "click" } = {}) {
273
286
  class QtiChoice extends Base {
287
+ /* Set when a press already activated, so the `click` that follows on release does not toggle it
288
+ back. Reset by every pointer-down, so a press that never ends in a click cannot leak. */
289
+ #pressActivated;
274
290
  #appliedChoiceRole;
275
291
  /**
276
292
  * Apply what the interaction published. No provider (standalone) means no role.
@@ -318,7 +334,22 @@ function ActiveElementMixin(Base, type) {
318
334
  this.tabIndex = 0;
319
335
  this.disabled = false;
320
336
  this.readonly = false;
337
+ this.#pressActivated = false;
321
338
  this.#appliedChoiceRole = null;
339
+ this._onMouseDown = (event) => {
340
+ if (this.disabled)
341
+ event.preventDefault();
342
+ };
343
+ this._onPointerDown = (event) => {
344
+ this.#pressActivated = false;
345
+ if (activateOn !== "press" || event.button !== 0 || !event.isPrimary)
346
+ return;
347
+ if (this.hasAttribute("qti-draggable") || this.disabled || this.readonly)
348
+ return;
349
+ this.#pressActivated = true;
350
+ this.focus();
351
+ this._activate();
352
+ };
322
353
  this.internals = this.attachInternals();
323
354
  }
324
355
  /* `PropertyValues`, not `PropertyValues<this>`: the polymorphic `this` narrows the
@@ -343,6 +374,8 @@ function ActiveElementMixin(Base, type) {
343
374
  }
344
375
  this.addEventListener("keyup", this._onKeyUp);
345
376
  this.addEventListener("click", this._onClick);
377
+ this.addEventListener("pointerdown", this._onPointerDown);
378
+ this.addEventListener("mousedown", this._onMouseDown);
346
379
  this.dispatchEvent(new CustomEvent(`register-${type}`, {
347
380
  bubbles: true,
348
381
  composed: true
@@ -352,6 +385,8 @@ function ActiveElementMixin(Base, type) {
352
385
  super.disconnectedCallback();
353
386
  this.removeEventListener("keyup", this._onKeyUp);
354
387
  this.removeEventListener("click", this._onClick);
388
+ this.removeEventListener("pointerdown", this._onPointerDown);
389
+ this.removeEventListener("mousedown", this._onMouseDown);
355
390
  this.dispatchEvent(new CustomEvent(`unregister-${type}`, {
356
391
  bubbles: true,
357
392
  composed: true
@@ -366,6 +401,10 @@ function ActiveElementMixin(Base, type) {
366
401
  }
367
402
  }
368
403
  _onClick() {
404
+ if (this.#pressActivated) {
405
+ this.#pressActivated = false;
406
+ return;
407
+ }
369
408
  if (this.disabled || this.readonly)
370
409
  return;
371
410
  this.focus();
@@ -968,7 +1007,7 @@ var __decorate9 = function(decorators, target, key, desc) {
968
1007
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
969
1008
  return c > 3 && r && Object.defineProperty(target, key, r), r;
970
1009
  };
971
- var QtiSimpleChoice = class extends ActiveElementMixin(LitElement10, "qti-simple-choice") {
1010
+ var QtiSimpleChoice = class extends ActiveElementMixin(LitElement10, "qti-simple-choice", { activateOn: "press" }) {
972
1011
  constructor() {
973
1012
  super(...arguments);
974
1013
  this.templateIdentifier = null;
@@ -978,17 +1017,11 @@ var QtiSimpleChoice = class extends ActiveElementMixin(LitElement10, "qti-simple
978
1017
  static {
979
1018
  this.styles = qti_simple_choice_styles_default;
980
1019
  }
981
- static {
982
- this.shadowRootOptions = {
983
- ...LitElement10.shadowRootOptions,
984
- delegatesFocus: true
985
- };
986
- }
987
1020
  get checked() {
988
1021
  return this["internals"].states.has("checked");
989
1022
  }
990
1023
  render() {
991
- return html10`<div part="control" tabindex="0"><div part="control-mark"></div></div>
1024
+ return html10`<div part="control"><div part="control-mark"></div></div>
992
1025
  ${this.marker ? html10`<div id="label" part="marker">${this.marker}</div>` : nothing}
993
1026
  <slot part="label"></slot>`;
994
1027
  }
@@ -1254,22 +1287,22 @@ var [Observable, Subscriber] = (() => {
1254
1287
  const AsyncFromSyncIteratorPrototype = {
1255
1288
  next(...args) {
1256
1289
  const O = this;
1257
- const state14 = privateState.get(O);
1258
- if (!state14?.syncIteratorRecord)
1290
+ const state15 = privateState.get(O);
1291
+ if (!state15?.syncIteratorRecord)
1259
1292
  throw new TypeError(
1260
1293
  "AsyncFromSyncIteratorPrototype.next called on invalid object"
1261
1294
  );
1262
- const { syncIteratorRecord } = state14;
1295
+ const { syncIteratorRecord } = state15;
1263
1296
  return pTry(() => syncIteratorRecord.next(...args));
1264
1297
  },
1265
1298
  return(...args) {
1266
1299
  const O = this;
1267
- const state14 = privateState.get(O);
1268
- if (!state14?.syncIteratorRecord)
1300
+ const state15 = privateState.get(O);
1301
+ if (!state15?.syncIteratorRecord)
1269
1302
  throw new TypeError(
1270
1303
  "AsyncFromSyncIteratorPrototype.return called on invalid object"
1271
1304
  );
1272
- const { syncIteratorRecord } = state14;
1305
+ const { syncIteratorRecord } = state15;
1273
1306
  return pTry(() => {
1274
1307
  if (!syncIteratorRecord.return) return { value: void 0, done: true };
1275
1308
  return syncIteratorRecord.return(...args);
@@ -1277,12 +1310,12 @@ var [Observable, Subscriber] = (() => {
1277
1310
  },
1278
1311
  throw(...args) {
1279
1312
  const O = this;
1280
- const state14 = privateState.get(O);
1281
- if (!state14?.syncIteratorRecord)
1313
+ const state15 = privateState.get(O);
1314
+ if (!state15?.syncIteratorRecord)
1282
1315
  throw new TypeError(
1283
1316
  "AsyncFromSyncIteratorPrototype.throw called on invalid object"
1284
1317
  );
1285
- const { syncIteratorRecord } = state14;
1318
+ const { syncIteratorRecord } = state15;
1286
1319
  return pTry(() => {
1287
1320
  if (!syncIteratorRecord.throw) {
1288
1321
  syncIteratorRecord.return();
@@ -1348,11 +1381,11 @@ var [Observable, Subscriber] = (() => {
1348
1381
  }
1349
1382
  }
1350
1383
  function closeASubscription(subscriber, reason) {
1351
- const state14 = privateState.get(subscriber);
1352
- if (!state14?.active) return;
1353
- state14.active = false;
1354
- state14.subscriptionController.abort(reason);
1355
- for (const teardown of state14.teardowns.reverse()) {
1384
+ const state15 = privateState.get(subscriber);
1385
+ if (!state15?.active) return;
1386
+ state15.active = false;
1387
+ state15.subscriptionController.abort(reason);
1388
+ for (const teardown of state15.teardowns.reverse()) {
1356
1389
  if (isBrowserContext() && !isDocumentFullyActive(document)) return;
1357
1390
  try {
1358
1391
  teardown();
@@ -1433,10 +1466,10 @@ var [Observable, Subscriber] = (() => {
1433
1466
  if (!(this instanceof Subscriber2))
1434
1467
  throw new TypeError("illegal invocation");
1435
1468
  if (!arguments.length) throw new TypeError("too few arguments");
1436
- const state14 = privateState.get(this);
1437
- if (!state14?.active) return;
1469
+ const state15 = privateState.get(this);
1470
+ if (!state15?.active) return;
1438
1471
  if (isBrowserContext() && !isDocumentFullyActive(document)) return;
1439
- const internalObservers = new Set(state14.observers);
1472
+ const internalObservers = new Set(state15.observers);
1440
1473
  for (const observer of internalObservers) {
1441
1474
  observer.next(value);
1442
1475
  }
@@ -1446,14 +1479,14 @@ var [Observable, Subscriber] = (() => {
1446
1479
  if (!(this instanceof Subscriber2))
1447
1480
  throw new TypeError("illegal invocation");
1448
1481
  if (!arguments.length) throw new TypeError("too few arguments");
1449
- const state14 = privateState.get(this);
1450
- if (!state14?.active) {
1482
+ const state15 = privateState.get(this);
1483
+ if (!state15?.active) {
1451
1484
  reportError(error);
1452
1485
  return;
1453
1486
  }
1454
1487
  if (isBrowserContext() && !isDocumentFullyActive(document)) return;
1455
1488
  closeASubscription(this, error);
1456
- const internalObservers = new Set(state14.observers);
1489
+ const internalObservers = new Set(state15.observers);
1457
1490
  for (const observer of internalObservers) {
1458
1491
  observer.error(error);
1459
1492
  }
@@ -1462,11 +1495,11 @@ var [Observable, Subscriber] = (() => {
1462
1495
  complete() {
1463
1496
  if (!(this instanceof Subscriber2))
1464
1497
  throw new TypeError("illegal invocation");
1465
- const state14 = privateState.get(this);
1466
- if (!state14?.active) return;
1498
+ const state15 = privateState.get(this);
1499
+ if (!state15?.active) return;
1467
1500
  if (isBrowserContext() && !isDocumentFullyActive(document)) return;
1468
1501
  closeASubscription(this);
1469
- const internalObservers = new Set(state14.observers);
1502
+ const internalObservers = new Set(state15.observers);
1470
1503
  for (const observer of internalObservers) {
1471
1504
  observer.complete();
1472
1505
  }
@@ -1479,9 +1512,9 @@ var [Observable, Subscriber] = (() => {
1479
1512
  throw new TypeError(`Parameter 1 is not of type 'Function'`);
1480
1513
  }
1481
1514
  if (isBrowserContext() && !isDocumentFullyActive(document)) return;
1482
- const state14 = privateState.get(this);
1483
- if (state14?.active)
1484
- state14.teardowns.push(teardown);
1515
+ const state15 = privateState.get(this);
1516
+ if (state15?.active)
1517
+ state15.teardowns.push(teardown);
1485
1518
  else teardown();
1486
1519
  }
1487
1520
  get active() {
@@ -2665,17 +2698,17 @@ function isDraggableDisabled(target) {
2665
2698
  return internals?.states?.has("disabled") ?? false;
2666
2699
  }
2667
2700
  var internalsOf = (el) => el?.internals;
2668
- function setDragChipState(el, state14, on) {
2701
+ function setDragChipState(el, state15, on) {
2669
2702
  const states = internalsOf(el)?.states;
2670
2703
  if (!states)
2671
2704
  return;
2672
2705
  if (on)
2673
- states.add(state14);
2706
+ states.add(state15);
2674
2707
  else
2675
- states.delete(state14);
2708
+ states.delete(state15);
2676
2709
  }
2677
- function hasDragChipState(el, state14) {
2678
- return internalsOf(el)?.states?.has(state14) ?? false;
2710
+ function hasDragChipState(el, state15) {
2711
+ return internalsOf(el)?.states?.has(state15) ?? false;
2679
2712
  }
2680
2713
  function clearDragChipStates(el) {
2681
2714
  setDragChipState(el, "dragging", false);
@@ -2771,7 +2804,7 @@ var resolveDragCloneHost = (dragSource, preferredHost) => {
2771
2804
  return hostFor(fullscreenElement);
2772
2805
  return host;
2773
2806
  };
2774
- var measureFixedFrame = (host) => {
2807
+ var measureFixedFrame = (host, ownZoom = 1) => {
2775
2808
  const ownerDocument = host.ownerDocument ?? document;
2776
2809
  const probe = ownerDocument.createElement("div");
2777
2810
  probe.style.cssText = `position:fixed;left:0;top:0;width:${PROBE_SIZE}px;height:${PROBE_SIZE}px;margin:0;padding:0;border:0;visibility:hidden;pointer-events:none;`;
@@ -2780,7 +2813,9 @@ var measureFixedFrame = (host) => {
2780
2813
  probe.remove();
2781
2814
  return {
2782
2815
  origin: { x: rect.left, y: rect.top },
2783
- scale: { x: rect.width / PROBE_SIZE || 1, y: rect.height / PROBE_SIZE || 1 }
2816
+ // The clone's own `zoom` (copied from the chip with the rest of its computed style) multiplies
2817
+ // its left/top/width/height on top of whatever scales the host, so it is part of the frame.
2818
+ scale: { x: (rect.width / PROBE_SIZE || 1) * ownZoom, y: (rect.height / PROBE_SIZE || 1) * ownZoom }
2784
2819
  };
2785
2820
  };
2786
2821
  var toFrameCoordinates = (frame, x, y) => ({
@@ -2821,6 +2856,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
2821
2856
  returnAnchorItems: []
2822
2857
  };
2823
2858
  this.cloneFrame = IDENTITY_FIXED_FRAME;
2859
+ this.cloneZoom = 1;
2824
2860
  this.subscriptions = [];
2825
2861
  this.dragSubscriptions = [];
2826
2862
  this.lastPointerDownAt = 0;
@@ -3390,8 +3426,10 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
3390
3426
  const property27 = computedStyles[i];
3391
3427
  clone.style.setProperty(property27, computedStyles.getPropertyValue(property27));
3392
3428
  }
3429
+ clone.style.removeProperty("box-shadow");
3393
3430
  const host = resolveDragCloneHost(element.isConnected ? element : this, this.dragCloneRoot());
3394
- this.cloneFrame = measureFixedFrame(host);
3431
+ this.cloneZoom = parseFloat(computedStyles.zoom) || 1;
3432
+ this.cloneFrame = measureFixedFrame(host, this.cloneZoom);
3395
3433
  clone.style.position = "fixed";
3396
3434
  clone.style.width = `${rect.width / this.cloneFrame.scale.x}px`;
3397
3435
  clone.style.height = `${rect.height / this.cloneFrame.scale.y}px`;
@@ -3399,7 +3437,6 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
3399
3437
  clone.style.pointerEvents = "none";
3400
3438
  clone.style.touchAction = "none";
3401
3439
  clone.style.userSelect = "none";
3402
- clone.style.opacity = "0.8";
3403
3440
  clone.removeAttribute("qti-draggable");
3404
3441
  clone.removeAttribute("tabindex");
3405
3442
  clone.setAttribute("data-drag-clone", "true");
@@ -3450,7 +3487,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
3450
3487
  if (host === dragClone.parentNode)
3451
3488
  return;
3452
3489
  host.appendChild(dragClone);
3453
- this.cloneFrame = measureFixedFrame(host);
3490
+ this.cloneFrame = measureFixedFrame(host, this.cloneZoom);
3454
3491
  if (lastCoordinates) {
3455
3492
  this.updateClonePosition(lastCoordinates.x, lastCoordinates.y);
3456
3493
  }
@@ -3506,6 +3543,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
3506
3543
  });
3507
3544
  this.dragSubscriptions = [];
3508
3545
  this.cloneFrame = IDENTITY_FIXED_FRAME;
3546
+ this.cloneZoom = 1;
3509
3547
  this.dragState = {
3510
3548
  dragging: false,
3511
3549
  dragSource: null,
@@ -3520,14 +3558,14 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
3520
3558
  returnAnchorItems: []
3521
3559
  };
3522
3560
  }
3523
- setInternalsState(state14, enabled) {
3561
+ setInternalsState(state15, enabled) {
3524
3562
  const internals = this._internals;
3525
3563
  if (!internals?.states)
3526
3564
  return;
3527
3565
  if (enabled) {
3528
- internals.states.add(state14);
3566
+ internals.states.add(state15);
3529
3567
  } else {
3530
- internals.states.delete(state14);
3568
+ internals.states.delete(state15);
3531
3569
  }
3532
3570
  }
3533
3571
  cleanup() {
@@ -4076,7 +4114,7 @@ var DragDropSlottedMixin = (superClass, draggablesSelector, droppablesSelector,
4076
4114
  cleanClone.setAttribute("qti-draggable", "true");
4077
4115
  cleanClone.setAttribute("tabindex", "0");
4078
4116
  if (this.isDeclarativeTarget(droppable)) {
4079
- cleanClone.setAttribute("part", "drag");
4117
+ cleanClone.setAttribute("part", cleanClone.localName === "qti-gap-text" ? "drag drag-text" : "drag");
4080
4118
  cleanClone.setAttribute("exportparts", "control: drag-control, label: drag-label, correction, correction-correct, correction-incorrect");
4081
4119
  this.placeChip(droppable, cleanClone);
4082
4120
  } else if (droppable.tagName === "SLOT") {
@@ -4098,16 +4136,7 @@ var DragDropSlottedMixin = (superClass, draggablesSelector, droppablesSelector,
4098
4136
  const deltaX = dragClonePosition.left - finalPosition.left;
4099
4137
  const deltaY = dragClonePosition.top - finalPosition.top;
4100
4138
  if (deltaX !== 0 || deltaY !== 0) {
4101
- cleanClone.animate([
4102
- {
4103
- transform: `translate(${deltaX}px, ${deltaY}px)`,
4104
- opacity: 0.8
4105
- },
4106
- {
4107
- transform: "translate(0, 0)",
4108
- opacity: 1
4109
- }
4110
- ], {
4139
+ cleanClone.animate([{ transform: `translate(${deltaX}px, ${deltaY}px)` }, { transform: "translate(0, 0)" }], {
4111
4140
  duration: this.flipAnimationConfig.duration || 200,
4112
4141
  easing: this.flipAnimationConfig.easing || "ease",
4113
4142
  fill: "both"
@@ -5112,9 +5141,11 @@ var qti_choice_interaction_styles_default = [
5112
5141
  display: block;
5113
5142
  }
5114
5143
 
5144
+ /* No gap of its own: a choice carries its own padding, which already spaces a list. A theme sets
5145
+ --qti-choice-gap where the choices are drawn as separate boxes and need air between them. */
5115
5146
  [part='slot'] {
5116
5147
  display: grid;
5117
- gap: 10px;
5148
+ gap: var(--qti-choice-gap, 0);
5118
5149
  }
5119
5150
 
5120
5151
  /* Define the number of columns dynamically */
@@ -6473,6 +6504,7 @@ __decorate19([
6473
6504
 
6474
6505
  // ../interactions/graphic-gap-match-interaction/dist/qti-graphic-gap-match-interaction.js
6475
6506
  import { html as html18 } from "lit";
6507
+ import { state as state9 } from "lit/decorators.js";
6476
6508
 
6477
6509
  // ../interactions/graphic-gap-match-interaction/dist/qti-graphic-gap-match-interaction.styles.js
6478
6510
  import { css as css17 } from "lit";
@@ -6568,15 +6600,34 @@ var qti_graphic_gap_match_interaction_styles_default = [
6568
6600
  ];
6569
6601
 
6570
6602
  // ../interactions/graphic-gap-match-interaction/dist/qti-graphic-gap-match-interaction.js
6603
+ var __decorate20 = function(decorators, target, key, desc) {
6604
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6605
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6606
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6607
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6608
+ };
6571
6609
  var SlottedBase2 = DragDropSlottedMixin(Interaction, "qti-gap-img, qti-gap-text", "qti-associable-hotspot", `slot[part~='drags']`);
6572
6610
  var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase2, '[qti-draggable="true"]') {
6611
+ constructor() {
6612
+ super(...arguments);
6613
+ this.autoSizeDropzones = false;
6614
+ this._graphicScale = 1;
6615
+ this.#graphicObserver = null;
6616
+ this.#observedGraphic = null;
6617
+ this.#positionHotspotOnRegister = (e) => {
6618
+ this.#positionHotspot(e.target);
6619
+ };
6620
+ }
6573
6621
  static {
6574
6622
  this.styles = qti_graphic_gap_match_interaction_styles_default;
6575
6623
  }
6624
+ #graphicObserver;
6625
+ #observedGraphic;
6576
6626
  render() {
6627
+ const scale = `--qti-graphic-scale: ${this._graphicScale}`;
6577
6628
  return html18` <slot name="prompt"></slot>
6578
- <slot part="image"></slot>
6579
- <slot part="drags" name="drags" class="hover-border"></slot>
6629
+ <slot part="image" style=${scale}></slot>
6630
+ <slot part="drags" name="drags" class="hover-border" style=${scale}></slot>
6580
6631
  <div role="alert" part="message" id="validation-message"></div>`;
6581
6632
  }
6582
6633
  shouldReturnToInventoryOnInventoryDrop() {
@@ -6624,11 +6675,30 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
6624
6675
  if (!graphic || !coords || !shape)
6625
6676
  return;
6626
6677
  this.#keepDeclaredRatio(graphic);
6678
+ this.#observeGraphic(graphic);
6627
6679
  positionShapes(shape, coords.split(",").map((s) => parseFloat(s)), graphic, hotspot);
6628
6680
  }
6629
- #positionHotspotOnRegister = (e) => {
6630
- this.#positionHotspot(e.target);
6631
- };
6681
+ /**
6682
+ * Tracks the graphic's rendered width. The authored chip sizes live in the same coordinate space
6683
+ * as the `coords` — an item that draws a 275x126 hotspot for a 275x126 tile means the tile to fill
6684
+ * it — so the chips scale by the same factor as the drop areas.
6685
+ */
6686
+ #observeGraphic(graphic) {
6687
+ if (this.#observedGraphic === graphic)
6688
+ return;
6689
+ this.#graphicObserver?.disconnect();
6690
+ this.#observedGraphic = graphic;
6691
+ this.#graphicObserver = new ResizeObserver(() => {
6692
+ const declared = parseFloat(graphic.getAttribute("width") ?? "");
6693
+ const rendered = graphic.getBoundingClientRect().width;
6694
+ const scale = declared > 0 && rendered > 0 ? Math.min(1, rendered / declared) : 1;
6695
+ const rounded = Math.round(scale * 1e3) / 1e3;
6696
+ if (rounded !== this._graphicScale)
6697
+ this._graphicScale = rounded;
6698
+ });
6699
+ this.#graphicObserver.observe(graphic);
6700
+ }
6701
+ #positionHotspotOnRegister;
6632
6702
  connectedCallback() {
6633
6703
  super.connectedCallback();
6634
6704
  this.addEventListener("qti-register-hotspot", this.#positionHotspotOnRegister);
@@ -6637,8 +6707,14 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
6637
6707
  disconnectedCallback() {
6638
6708
  super.disconnectedCallback();
6639
6709
  this.removeEventListener("qti-register-hotspot", this.#positionHotspotOnRegister);
6710
+ this.#graphicObserver?.disconnect();
6711
+ this.#graphicObserver = null;
6712
+ this.#observedGraphic = null;
6640
6713
  }
6641
6714
  };
6715
+ __decorate20([
6716
+ state9()
6717
+ ], QtiGraphicGapMatchInteraction.prototype, "_graphicScale", void 0);
6642
6718
 
6643
6719
  // ../interactions/graphic-order-interaction/dist/qti-graphic-order-interaction.js
6644
6720
  import { html as html19 } from "lit";
@@ -6691,7 +6767,7 @@ var qti_graphic_order_interaction_styles_default = [
6691
6767
  ];
6692
6768
 
6693
6769
  // ../interactions/graphic-order-interaction/dist/qti-graphic-order-interaction.js
6694
- var __decorate20 = function(decorators, target, key, desc) {
6770
+ var __decorate21 = function(decorators, target, key, desc) {
6695
6771
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6696
6772
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6697
6773
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -6826,10 +6902,10 @@ var QtiGraphicOrderInteraction = class _QtiGraphicOrderInteraction extends Choic
6826
6902
  this.removeEventListener("register-qti-hotspot-choice", this.#positionHotspotOnRegister);
6827
6903
  }
6828
6904
  };
6829
- __decorate20([
6905
+ __decorate21([
6830
6906
  property19({ type: Number, attribute: "max-choices" })
6831
6907
  ], QtiGraphicOrderInteraction.prototype, "maxChoices", void 0);
6832
- __decorate20([
6908
+ __decorate21([
6833
6909
  watch("response")
6834
6910
  ], QtiGraphicOrderInteraction.prototype, "handleOrderedResponseChange", null);
6835
6911
 
@@ -6974,7 +7050,7 @@ var QtiHottextInteraction = class extends ChoicesMixin(Interaction, "qti-hottext
6974
7050
 
6975
7051
  // ../interactions/inline-choice-interaction/dist/qti-inline-choice-interaction.js
6976
7052
  import { html as html22 } from "lit";
6977
- import { property as property20, state as state9 } from "lit/decorators.js";
7053
+ import { property as property20, state as state10 } from "lit/decorators.js";
6978
7054
  import { consume as consume5 } from "@lit/context";
6979
7055
 
6980
7056
  // ../interactions/core/dist/mixins/menu-auto-size/menu-auto-size.mixin.js
@@ -7349,7 +7425,7 @@ var styles2 = own;
7349
7425
  var qti_inline_choice_interaction_styles_default = styles2;
7350
7426
 
7351
7427
  // ../interactions/inline-choice-interaction/dist/qti-inline-choice-interaction.js
7352
- var __decorate21 = function(decorators, target, key, desc) {
7428
+ var __decorate22 = function(decorators, target, key, desc) {
7353
7429
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
7354
7430
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
7355
7431
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -7719,23 +7795,23 @@ var QtiInlineChoiceInteraction = class extends MenuAutoSizeMixin(Interaction) {
7719
7795
  return [...promptOption ? [promptOption] : [], ...slottedChoices];
7720
7796
  }
7721
7797
  };
7722
- __decorate21([
7723
- state9()
7798
+ __decorate22([
7799
+ state10()
7724
7800
  ], QtiInlineChoiceInteraction.prototype, "options", void 0);
7725
- __decorate21([
7726
- state9()
7801
+ __decorate22([
7802
+ state10()
7727
7803
  ], QtiInlineChoiceInteraction.prototype, "_dropdownOpen", void 0);
7728
- __decorate21([
7804
+ __decorate22([
7729
7805
  consume5({ context: configContext, subscribe: true }),
7730
7806
  property20({ attribute: false })
7731
7807
  ], QtiInlineChoiceInteraction.prototype, "configContext", void 0);
7732
- __decorate21([
7808
+ __decorate22([
7733
7809
  property20({ type: String, attribute: "data-prompt" })
7734
7810
  ], QtiInlineChoiceInteraction.prototype, "dataPrompt", void 0);
7735
- __decorate21([
7811
+ __decorate22([
7736
7812
  watch("dataPrompt", { waitUntilFirstUpdate: true })
7737
7813
  ], QtiInlineChoiceInteraction.prototype, "_handleDataPromptChange", void 0);
7738
- __decorate21([
7814
+ __decorate22([
7739
7815
  property20({
7740
7816
  type: Boolean,
7741
7817
  reflect: true,
@@ -7746,19 +7822,19 @@ __decorate21([
7746
7822
  }
7747
7823
  })
7748
7824
  ], QtiInlineChoiceInteraction.prototype, "required", void 0);
7749
- __decorate21([
7825
+ __decorate22([
7750
7826
  property20({ type: Number, attribute: "min-choices" })
7751
7827
  ], QtiInlineChoiceInteraction.prototype, "minChoices", void 0);
7752
- __decorate21([
7828
+ __decorate22([
7753
7829
  watch(["required", "minChoices"], { waitUntilFirstUpdate: true })
7754
7830
  ], QtiInlineChoiceInteraction.prototype, "_handleRequiredChange", void 0);
7755
- __decorate21([
7831
+ __decorate22([
7756
7832
  property20({ attribute: "response", reflect: false, noAccessor: true })
7757
7833
  ], QtiInlineChoiceInteraction.prototype, "response", null);
7758
7834
 
7759
7835
  // ../interactions/match-interaction/dist/qti-match-interaction.js
7760
7836
  import { html as html23, nothing as nothing3 } from "lit";
7761
- import { property as property21, state as state10 } from "lit/decorators.js";
7837
+ import { property as property21, state as state11 } from "lit/decorators.js";
7762
7838
 
7763
7839
  // ../interactions/match-interaction/dist/qti-match-interaction.styles.js
7764
7840
  import { css as css22 } from "lit";
@@ -7882,6 +7958,25 @@ var qti_match_interaction_tabular_styles_default = [
7882
7958
  :host(.qti-match-tabular) slot:not([hidden]) {
7883
7959
  display: contents;
7884
7960
  }
7961
+ /*
7962
+ * Each cell's radio or checkbox is a real input, visually hidden over the whole cell: it takes
7963
+ * Tab focus, the arrow keys move within a row's radio group and Space toggles a checkbox, all
7964
+ * natively. It was the hidden attribute, which took it out of the tab order, so the grid could not be
7965
+ * answered from a keyboard at all. The span beside it draws the control; the theme rings the
7966
+ * cell (::part(input-cell):focus-within).
7967
+ */
7968
+ :host(.qti-match-tabular) [part~='input-cell'] {
7969
+ position: relative;
7970
+ }
7971
+ :host(.qti-match-tabular) [part~='input-cell'] > input {
7972
+ position: absolute;
7973
+ inset: 0;
7974
+ width: 100%;
7975
+ height: 100%;
7976
+ margin: 0;
7977
+ opacity: 0;
7978
+ cursor: pointer;
7979
+ }
7885
7980
  :host(.qti-match-tabular) [part='grid'] {
7886
7981
  display: grid;
7887
7982
  /* Clips the cell rules — which are the grid's own background showing through a 1px gap — to the
@@ -7938,7 +8033,7 @@ var qti_match_interaction_tabular_styles_default = [
7938
8033
  ];
7939
8034
 
7940
8035
  // ../interactions/match-interaction/dist/qti-match-interaction.js
7941
- var __decorate22 = function(decorators, target, key, desc) {
8036
+ var __decorate23 = function(decorators, target, key, desc) {
7942
8037
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
7943
8038
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
7944
8039
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -8056,16 +8151,24 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(DragDropSlo
8056
8151
  this.sourceChoices?.forEach((c) => {
8057
8152
  stripSizing(c);
8058
8153
  c.setAttribute("role", "rowheader");
8154
+ c.tabIndex = -1;
8059
8155
  });
8060
8156
  this.targetChoices?.forEach((c) => {
8061
8157
  stripSizing(c);
8062
8158
  c.setAttribute("role", "columnheader");
8159
+ c.tabIndex = -1;
8063
8160
  });
8064
8161
  } else {
8065
8162
  sourceSet?.removeAttribute("slot");
8066
8163
  targetSet?.removeAttribute("slot");
8067
- this.sourceChoices?.forEach((c) => c.removeAttribute("role"));
8068
- this.targetChoices?.forEach((c) => c.removeAttribute("role"));
8164
+ this.sourceChoices?.forEach((c) => {
8165
+ c.removeAttribute("role");
8166
+ c.tabIndex = c.disabled ? -1 : 0;
8167
+ });
8168
+ this.targetChoices?.forEach((c) => {
8169
+ c.removeAttribute("role");
8170
+ c.tabIndex = c.disabled ? -1 : 0;
8171
+ });
8069
8172
  }
8070
8173
  }
8071
8174
  validate() {
@@ -8117,7 +8220,6 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(DragDropSlo
8117
8220
  >
8118
8221
  <input
8119
8222
  type=${type}
8120
- hidden
8121
8223
  name=${rowId}
8122
8224
  value=${value}
8123
8225
  .checked=${checked}
@@ -8141,13 +8243,13 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(DragDropSlo
8141
8243
  `;
8142
8244
  }
8143
8245
  };
8144
- __decorate22([
8246
+ __decorate23([
8145
8247
  property21({ type: String })
8146
8248
  ], QtiMatchInteraction.prototype, "class", void 0);
8147
- __decorate22([
8148
- state10()
8249
+ __decorate23([
8250
+ state11()
8149
8251
  ], QtiMatchInteraction.prototype, "_response", void 0);
8150
- __decorate22([
8252
+ __decorate23([
8151
8253
  property21({ type: String, attribute: "response-identifier" })
8152
8254
  ], QtiMatchInteraction.prototype, "responseIdentifier", void 0);
8153
8255
 
@@ -8225,7 +8327,7 @@ var QtiMediaInteraction = class extends Interaction {
8225
8327
  // ../interactions/order-interaction/dist/qti-order-interaction.js
8226
8328
  import { html as html25 } from "lit";
8227
8329
  import { repeat as repeat6 } from "lit/directives/repeat.js";
8228
- import { property as property22, state as state11 } from "lit/decorators.js";
8330
+ import { property as property22, state as state12 } from "lit/decorators.js";
8229
8331
 
8230
8332
  // ../interactions/order-interaction/dist/qti-order-interaction.styles.js
8231
8333
  import { css as css25 } from "lit";
@@ -8447,7 +8549,7 @@ var qti_order_interaction_styles_default = [
8447
8549
  ];
8448
8550
 
8449
8551
  // ../interactions/order-interaction/dist/qti-order-interaction.js
8450
- var __decorate23 = function(decorators, target, key, desc) {
8552
+ var __decorate24 = function(decorators, target, key, desc) {
8451
8553
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8452
8554
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
8453
8555
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -8506,18 +8608,21 @@ var QtiOrderInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
8506
8608
  this.childrenMap = Array.from(this.querySelectorAll("qti-simple-choice"));
8507
8609
  }
8508
8610
  };
8509
- __decorate23([
8510
- state11()
8611
+ __decorate24([
8612
+ state12()
8511
8613
  ], QtiOrderInteraction.prototype, "nrChoices", void 0);
8512
- __decorate23([
8614
+ __decorate24([
8513
8615
  property22({ type: String })
8514
8616
  ], QtiOrderInteraction.prototype, "orientation", void 0);
8515
8617
 
8516
8618
  // ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.js
8517
8619
  import { css as css27, html as html26 } from "lit";
8518
- import { property as property23, state as state12 } from "lit/decorators.js";
8620
+ import { property as property23, state as state13 } from "lit/decorators.js";
8519
8621
  import { consume as consume6 } from "@lit/context";
8520
8622
 
8623
+ // ../qti-theme/dist/native-css.js
8624
+ var native_css_default = "@layer qti-base {\n/* https://www.imsglobal.org/sites/default/files/spec/qti/v3/guide/img/qti3p0.css */\n/* ============================\n QTI 3 shared css\n 1. Display\n 2. Special Flex styles\n 3. Margin\n 4. Padding\n 5. Horizontal Alignment styles\n 6. Vertical Alignment styles\n 7. Height\n 8. Width\n 9. Text-Indent\n 10. List Style\n 11. Layout\n 12. Other QTI 3 presentation utilities\n ============================ */\n\n/* ==========\n Display css\n =========== */\n\n.qti-display-inline {\n display: inline;\n}\n\n.qti-display-inline-block {\n display: inline-block;\n}\n\n.qti-display-block {\n display: block;\n}\n\n.qti-display-flex {\n display: flex;\n}\n\n.qti-display-inline-flex {\n display: inline-flex;\n}\n\n.qti-display-grid {\n display: grid;\n}\n\n.qti-display-inline-grid {\n display: inline-grid;\n}\n\n.qti-display-table {\n display: table;\n}\n\n.qti-display-table-cell {\n display: table-cell;\n}\n\n.qti-display-table-row {\n display: table-row;\n}\n\n.qti-display-list-item {\n display: list-item;\n}\n\n.qti-display-inherit {\n display: inherit;\n}\n\n/* \n * hidden to screen readers and sighted\n */\n.qti-hidden {\n display: none;\n}\n\n/*\n * visible to screen readers, hidden to sighted\n */\n.qti-visually-hidden {\n position: fixed !important;\n overflow: hidden;\n clip: rect(1px 1px 1px 1px);\n height: 1px;\n width: 1px;\n border: 0;\n margin: -1px;\n}\n\n/* =============================\n Special flex styles\n ============================= */\n\n.qti-flex-direction-column {\n flex-direction: column;\n}\n\n.qti-flex-direction-row {\n flex-direction: row;\n}\n\n.qti-flex-grow-1 {\n flex-grow: 1;\n}\n\n.qti-flex-grow-0 {\n flex-grow: 0;\n}\n\n/* =========\n Margin css\n ========== */\n\n/**\n * For margin Top and Bottom and Left and Right\n */\n.qti-margin-0 {\n margin: 0 !important;\n}\n\n.qti-margin-1 {\n margin: 0.25rem !important;\n}\n\n.qti-margin-2 {\n margin: 0.5rem !important;\n}\n\n.qti-margin-3 {\n margin: 1rem !important;\n}\n\n.qti-margin-4 {\n margin: 1.5rem !important;\n}\n\n.qti-margin-5 {\n margin: 3rem !important;\n}\n\n.qti-margin-auto {\n margin: auto !important;\n}\n\n/*\n For margin Left and Right\n */\n.qti-margin-x-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n}\n\n.qti-margin-x-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-x-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-x-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n}\n\n.qti-margin-x-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-x-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n}\n\n.qti-margin-x-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n}\n\n/*\n For margin Top and Bottom\n */\n.qti-margin-y-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n}\n\n.qti-margin-y-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-y-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-y-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-y-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-y-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-y-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n}\n\n/*\n For margin Top\n */\n.qti-margin-t-0 {\n margin-top: 0 !important;\n}\n\n.qti-margin-t-1 {\n margin-top: 0.25rem !important;\n}\n\n.qti-margin-t-2 {\n margin-top: 0.5rem !important;\n}\n\n.qti-margin-t-3 {\n margin-top: 1rem !important;\n}\n\n.qti-margin-t-4 {\n margin-top: 1.5rem !important;\n}\n\n.qti-margin-t-5 {\n margin-top: 3rem !important;\n}\n\n.qti-margin-t-auto {\n margin-top: auto !important;\n}\n\n/* \n For margin Bottom\n */\n.qti-margin-b-0 {\n margin-bottom: 0 !important;\n}\n\n.qti-margin-b-1 {\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-b-2 {\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-b-3 {\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-b-4 {\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-b-5 {\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-b-auto {\n margin-bottom: auto !important;\n}\n\n/*\n For margin Start LTR\n */\n.qti-margin-s-0 {\n margin-left: 0 !important;\n}\n\n.qti-margin-s-1 {\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-s-2 {\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-s-3 {\n margin-left: 1rem !important;\n}\n\n.qti-margin-s-4 {\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-s-5 {\n margin-left: 3rem !important;\n}\n\n.qti-margin-s-auto {\n margin-left: auto !important;\n}\n\n/* \n For margin End LTR\n */\n.qti-margin-e-0 {\n margin-right: 0 !important;\n}\n\n.qti-margin-e-1 {\n margin-right: 0.25rem !important;\n}\n\n.qti-margin-e-2 {\n margin-right: 0.5rem !important;\n}\n\n.qti-margin-e-3 {\n margin-right: 1rem !important;\n}\n\n.qti-margin-e-4 {\n margin-right: 1.5rem !important;\n}\n\n.qti-margin-e-5 {\n margin-right: 3rem !important;\n}\n\n.qti-margin-e-auto {\n margin-right: auto !important;\n}\n\n/* =========\n Padding css\n ========== */\n\n/*\n For padding Top and Bottom and Left and Right\n */\n.qti-padding-0 {\n padding: 0 !important;\n}\n\n.qti-padding-1 {\n padding: 0.25rem !important;\n}\n\n.qti-padding-2 {\n padding: 0.5rem !important;\n}\n\n.qti-padding-3 {\n padding: 1rem !important;\n}\n\n.qti-padding-4 {\n padding: 1.5rem !important;\n}\n\n.qti-padding-5 {\n padding: 3rem !important;\n}\n\n/*\n For padding Left and Right\n */\n.qti-padding-x-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n}\n\n.qti-padding-x-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-x-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-x-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n}\n\n.qti-padding-x-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-x-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n}\n\n/*\n For padding Top and Bottom\n */\n.qti-padding-y-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n}\n\n.qti-padding-y-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-y-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-y-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-y-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-y-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Top\n */\n.qti-padding-t-0 {\n padding-top: 0 !important;\n}\n\n.qti-padding-t-1 {\n padding-top: 0.25rem !important;\n}\n\n.qti-padding-t-2 {\n padding-top: 0.5rem !important;\n}\n\n.qti-padding-t-3 {\n padding-top: 1rem !important;\n}\n\n.qti-padding-t-4 {\n padding-top: 1.5rem !important;\n}\n\n.qti-padding-t-5 {\n padding-top: 3rem !important;\n}\n\n/*\n For padding Bottom\n */\n.qti-padding-b-0 {\n padding-bottom: 0 !important;\n}\n\n.qti-padding-b-1 {\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-b-2 {\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-b-3 {\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-b-4 {\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-b-5 {\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Start LTR\n */\n.qti-padding-s-0 {\n padding-left: 0 !important;\n}\n\n.qti-padding-s-1 {\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-s-2 {\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-s-3 {\n padding-left: 1rem !important;\n}\n\n.qti-padding-s-4 {\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-s-5 {\n padding-left: 3rem !important;\n}\n\n/*\n For padding End LTR\n */\n.qti-padding-e-0 {\n padding-right: 0 !important;\n}\n\n.qti-padding-e-1 {\n padding-right: 0.25rem !important;\n}\n\n.qti-padding-e-2 {\n padding-right: 0.5rem !important;\n}\n\n.qti-padding-e-3 {\n padding-right: 1rem !important;\n}\n\n.qti-padding-e-4 {\n padding-right: 1.5rem !important;\n}\n\n.qti-padding-e-5 {\n padding-right: 3rem !important;\n}\n\n/* ====================\n Horizontal alignment\n ==================== */\n\n.qti-align-left {\n text-align: left;\n}\n\n.qti-align-center {\n text-align: center;\n}\n\n.qti-align-right {\n text-align: right;\n}\n\n/* ==================\n Vertical alignment\n ================== */\n\n.qti-valign-top {\n vertical-align: top;\n}\n\n.qti-valign-middle {\n vertical-align: middle;\n}\n\n.qti-valign-baseline {\n vertical-align: baseline;\n}\n\n.qti-valign-bottom {\n vertical-align: bottom;\n}\n\n/* =============\n Height styles\n ============= */\n\n.qti-height-0 {\n height: 0;\n}\n\n.qti-height-px {\n height: 1px;\n}\n\n.qti-height-0p5 {\n height: 0.125rem;\n}\n\n.qti-height-1 {\n height: 0.25rem;\n}\n\n.qti-height-1p5 {\n height: 0.375rem;\n}\n\n.qti-height-2 {\n height: 0.5rem;\n}\n\n.qti-height-2p5 {\n height: 0.625rem;\n}\n\n.qti-height-3 {\n height: 0.75rem;\n}\n\n.qti-height-3p5 {\n height: 0.875rem;\n}\n\n.qti-height-4 {\n height: 1rem;\n}\n\n.qti-height-5 {\n height: 1.25rem;\n}\n\n.qti-height-6 {\n height: 1.5rem;\n}\n\n.qti-height-7 {\n height: 1.75rem;\n}\n\n.qti-height-8 {\n height: 2rem;\n}\n\n.qti-height-9 {\n height: 2.25rem;\n}\n\n.qti-height-10 {\n height: 2.5rem;\n}\n\n.qti-height-11 {\n height: 2.75rem;\n}\n\n.qti-height-12 {\n height: 3rem;\n}\n\n.qti-height-14 {\n height: 3.5rem;\n}\n\n.qti-height-16 {\n height: 4rem;\n}\n\n.qti-height-20 {\n height: 5rem;\n}\n\n.qti-height-24 {\n height: 6rem;\n}\n\n.qti-height-28 {\n height: 7rem;\n}\n\n.qti-height-32 {\n height: 8rem;\n}\n\n.qti-height-36 {\n height: 9rem;\n}\n\n.qti-height-40 {\n height: 10rem;\n}\n\n.qti-height-44 {\n height: 11rem;\n}\n\n.qti-height-48 {\n height: 12rem;\n}\n\n.qti-height-52 {\n height: 13rem;\n}\n\n.qti-height-56 {\n height: 14rem;\n}\n\n.qti-height-60 {\n height: 15rem;\n}\n\n.qti-height-64 {\n height: 16rem;\n}\n\n.qti-height-72 {\n height: 18rem;\n}\n\n.qti-height-80 {\n height: 20rem;\n}\n\n.qti-height-96 {\n height: 24rem;\n}\n\n.qti-height-1-2 {\n height: 50%;\n}\n\n.qti-height-1-3 {\n height: 33.3333%;\n}\n\n.qti-height-2-3 {\n height: 66.6667%;\n}\n\n.qti-height-1-4 {\n height: 25%;\n}\n\n.qti-height-2-4 {\n height: 50%;\n}\n\n.qti-height-3-4 {\n height: 75%;\n}\n\n.qti-height-1-5 {\n height: 20%;\n}\n\n.qti-height-2-5 {\n height: 40%;\n}\n\n.qti-height-3-5 {\n height: 60%;\n}\n\n.qti-height-4-5 {\n height: 80%;\n}\n\n.qti-height-1-6 {\n height: 16.6667%;\n}\n\n.qti-height-2-6 {\n height: 33.3333%;\n}\n\n.qti-height-3-6 {\n height: 50%;\n}\n\n.qti-height-4-6 {\n height: 66.6667%;\n}\n\n.qti-height-5-6 {\n height: 83.3333%;\n}\n\n.qti-height-auto {\n height: auto;\n}\n\n.qti-height-full {\n height: 100%;\n}\n\n/* ============\n Width styles\n ============ */\n\n.qti-width-0 {\n width: 0;\n}\n\n.qti-width-px {\n width: 1px;\n}\n\n.qti-width-0p5 {\n width: 0.125rem;\n}\n\n.qti-width-1 {\n width: 0.25rem;\n}\n\n.qti-width-1p5 {\n width: 0.375rem;\n}\n\n.qti-width-2 {\n width: 0.5rem;\n}\n\n.qti-width-2p5 {\n width: 0.625rem;\n}\n\n.qti-width-3 {\n width: 0.75rem;\n}\n\n.qti-width-3p5 {\n width: 0.875rem;\n}\n\n.qti-width-4 {\n width: 1rem;\n}\n\n.qti-width-5 {\n width: 1.25rem;\n}\n\n.qti-width-6 {\n width: 1.5rem;\n}\n\n.qti-width-7 {\n width: 1.75rem;\n}\n\n.qti-width-8 {\n width: 2rem;\n}\n\n.qti-width-9 {\n width: 2.25rem;\n}\n\n.qti-width-10 {\n width: 2.5rem;\n}\n\n.qti-width-11 {\n width: 2.75rem;\n}\n\n.qti-width-12 {\n width: 3rem;\n}\n\n.qti-width-14 {\n width: 3.5rem;\n}\n\n.qti-width-16 {\n width: 4rem;\n}\n\n.qti-width-20 {\n width: 5rem;\n}\n\n.qti-width-24 {\n width: 6rem;\n}\n\n.qti-width-28 {\n width: 7rem;\n}\n\n.qti-width-32 {\n width: 8rem;\n}\n\n.qti-width-36 {\n width: 9rem;\n}\n\n.qti-width-40 {\n width: 10rem;\n}\n\n.qti-width-44 {\n width: 11rem;\n}\n\n.qti-width-48 {\n width: 12rem;\n}\n\n.qti-width-52 {\n width: 13rem;\n}\n\n.qti-width-56 {\n width: 14rem;\n}\n\n.qti-width-60 {\n width: 15rem;\n}\n\n.qti-width-64 {\n width: 16rem;\n}\n\n.qti-width-72 {\n width: 18rem;\n}\n\n.qti-width-80 {\n width: 20rem;\n}\n\n.qti-width-96 {\n width: 24rem;\n}\n\n.qti-width-auto {\n width: auto;\n}\n\n.qti-width-1-2 {\n width: 50%;\n}\n\n.qti-width-1-3 {\n width: 33.3333%;\n}\n\n.qti-width-2-3 {\n width: 66.6667%;\n}\n\n.qti-width-1-4 {\n width: 25%;\n}\n\n.qti-width-2-4 {\n width: 50%;\n}\n\n.qti-width-3-4 {\n width: 75%;\n}\n\n.qti-width-1-5 {\n width: 20%;\n}\n\n.qti-width-2-5 {\n width: 40%;\n}\n\n.qti-width-3-5 {\n width: 60%;\n}\n\n.qti-width-4-5 {\n width: 80%;\n}\n\n.qti-width-1-6 {\n width: 16.6667%;\n}\n\n.qti-width-2-6 {\n width: 33.3333%;\n}\n\n.qti-width-3-6 {\n width: 50%;\n}\n\n.qti-width-4-6 {\n width: 66.6667%;\n}\n\n.qti-width-5-6 {\n width: 83.3333%;\n}\n\n.qti-width-1-12 {\n width: 8.3333%;\n}\n\n.qti-width-2-12 {\n width: 16.6667%;\n}\n\n.qti-width-3-12 {\n width: 25%;\n}\n\n.qti-width-4-12 {\n width: 33.3333%;\n}\n\n.qti-width-5-12 {\n width: 41.6667%;\n}\n\n.qti-width-6-12 {\n width: 50%;\n}\n\n.qti-width-7-12 {\n width: 58.3333%;\n}\n\n.qti-width-8-12 {\n width: 66.6667%;\n}\n\n.qti-width-9-12 {\n width: 75%;\n}\n\n.qti-width-10-12 {\n width: 83.3333%;\n}\n\n.qti-width-11-12 {\n width: 91.6667%;\n}\n\n.qti-width-full,\n.qti-fullwidth {\n width: 100%;\n}\n\n/* ==================\n Text Indent styles\n ================== */\n\n.qti-text-indent-0 {\n text-indent: 0;\n}\n\n.qti-text-indent-px {\n text-indent: 1px;\n}\n\n.qti-text-indent-0p5 {\n text-indent: 0.125rem;\n}\n\n.qti-text-indent-1 {\n text-indent: 0.25rem;\n}\n\n.qti-text-indent-1p5 {\n text-indent: 0.375rem;\n}\n\n.qti-text-indent-2 {\n text-indent: 0.5rem;\n}\n\n.qti-text-indent-2p5 {\n text-indent: 0.625rem;\n}\n\n.qti-text-indent-3 {\n text-indent: 0.75rem;\n}\n\n.qti-text-indent-3p5 {\n text-indent: 0.875rem;\n}\n\n.qti-text-indent-4 {\n text-indent: 1rem;\n}\n\n.qti-text-indent-5 {\n text-indent: 1.25rem;\n}\n\n.qti-text-indent-6 {\n text-indent: 1.5rem;\n}\n\n.qti-text-indent-7 {\n text-indent: 1.75rem;\n}\n\n.qti-text-indent-8 {\n text-indent: 2rem;\n}\n\n.qti-text-indent-12 {\n text-indent: 3rem;\n}\n\n.qti-text-indent-16 {\n text-indent: 4rem;\n}\n\n.qti-text-indent-20 {\n text-indent: 5rem;\n}\n\n.qti-text-indent-24 {\n text-indent: 6rem;\n}\n\n.qti-text-indent-28 {\n text-indent: 7rem;\n}\n\n.qti-text-indent-32 {\n text-indent: 8rem;\n}\n\n/* =================\n List Style styles\n ================= */\n\n.qti-list-style-type-none {\n list-style-type: none;\n}\n\n.qti-list-style-type-disc {\n list-style-type: disc;\n}\n\n.qti-list-style-type-circle {\n list-style-type: circle;\n}\n\n.qti-list-style-type-square {\n list-style-type: square;\n}\n\n.qti-list-style-type-decimal {\n list-style-type: decimal;\n}\n\n.qti-list-style-type-decimal-leading-zero {\n list-style-type: decimal-leading-zero;\n}\n\n.qti-list-style-type-lower-alpha {\n list-style-type: lower-alpha;\n}\n\n.qti-list-style-type-upper-alpha {\n list-style-type: upper-alpha;\n}\n\n.qti-list-style-type-lower-roman {\n list-style-type: lower-roman;\n}\n\n.qti-list-style-type-upper-roman {\n list-style-type: upper-roman;\n}\n\n.qti-list-style-type-lower-latin {\n list-style-type: lower-latin;\n}\n\n.qti-list-style-type-upper-latin {\n list-style-type: upper-latin;\n}\n\n.qti-list-style-type-lower-greek {\n list-style-type: lower-greek;\n}\n\n.qti-list-style-type-arabic-indic {\n list-style-type: arabic-indic;\n}\n\n.qti-list-style-type-armenian {\n list-style-type: armenian;\n}\n\n.qti-list-style-type-lower-armenian {\n list-style-type: lower-armenian;\n}\n\n.qti-list-style-type-upper-armenian {\n list-style-type: upper-armenian;\n}\n\n.qti-list-style-type-bengali {\n list-style-type: bengali;\n}\n\n.qti-list-style-type-cambodian {\n list-style-type: cambodian;\n}\n\n.qti-list-style-type-simp-chinese-formal {\n list-style-type: simp-chinese-formal;\n}\n\n.qti-list-style-type-simp-chinese-informal {\n list-style-type: simp-chinese-informal;\n}\n\n.qti-list-style-type-trad-chinese-formal {\n list-style-type: trad-chinese-formal;\n}\n\n.qti-list-style-type-trad-chinese-informal {\n list-style-type: trad-chinese-informal;\n}\n\n.qti-list-style-type-cjk-ideographic {\n list-style-type: cjk-ideographic;\n}\n\n.qti-list-style-type-cjk-heavenly-stem {\n list-style-type: cjk-heavenly-stem;\n}\n\n.qti-list-style-type-cjk-earthly-branch {\n list-style-type: cjk-earthly-branch;\n}\n\n.qti-list-style-type-devanagari {\n list-style-type: devanagari;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-er {\n list-style-type: ethiopic-halehame-ti-er;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-et {\n list-style-type: ethiopic-halehame-ti-et;\n}\n\n.qti-list-style-type-ethiopic-halehame-am {\n list-style-type: ethiopic-halehame-am;\n}\n\n.qti-list-style-type-ethiopic-halehame {\n list-style-type: ethiopic-halehame;\n}\n\n.qti-list-style-type-georgian {\n list-style-type: georgian;\n}\n\n.qti-list-style-type-gujarati {\n list-style-type: gujarati;\n}\n\n.qti-list-style-type-gurmukhi {\n list-style-type: gurmukhi;\n}\n\n.qti-list-style-type-hangul {\n list-style-type: hangul;\n}\n\n.qti-list-style-type-hangul-consonant {\n list-style-type: hangul-consonant;\n}\n\n.qti-list-style-type-hebrew {\n list-style-type: hebrew;\n}\n\n.qti-list-style-type-hiragana {\n list-style-type: hiragana;\n}\n\n.qti-list-style-type-hiragana-iroha {\n list-style-type: hiragana-iroha;\n}\n\n.qti-list-style-type-khmer {\n list-style-type: khmer;\n}\n\n.qti-list-style-type-korean-hangul-formal {\n list-style-type: korean-hangul-formal;\n}\n\n.qti-list-style-type-korean-hanja-formal {\n list-style-type: korean-hanja-formal;\n}\n\n.qti-list-style-type-korean-hanja-informal {\n list-style-type: korean-hanja-informal;\n}\n\n.qti-list-style-type-lao {\n list-style-type: lao;\n}\n\n.qti-list-style-type-malayalam {\n list-style-type: malayalam;\n}\n\n.qti-list-style-type-mongolian {\n list-style-type: mongolian;\n}\n\n.qti-list-style-type-myanmar {\n list-style-type: myanmar;\n}\n\n.qti-list-style-type-oriya {\n list-style-type: oriya;\n}\n\n.qti-list-style-type-persian {\n list-style-type: persian;\n}\n\n.qti-list-style-type-thai {\n list-style-type: thai;\n}\n\n.qti-list-style-type-tibetan {\n list-style-type: tibetan;\n}\n\n.qti-list-style-type-telugu {\n list-style-type: telugu;\n}\n\n.qti-list-style-type-urdu {\n list-style-type: urdu;\n}\n\n/* =========================\n Other QTI 3 Presentation Utilities\n ========================= */\n\n.qti-bordered {\n border: 1px solid var(--table-border-color);\n}\n\n.qti-underline {\n text-decoration: underline;\n text-decoration-color: var(--foreground);\n}\n\n.qti-italic {\n font-style: italic;\n}\n\n.qti-well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: var(--well-bg);\n border: var(--well-border);\n border-radius: 4px;\n box-shadow: var(--well-box-shadow);\n}\n\n/* Set writing-mode to vertical-rl \n Typical for CJK vertical text */\n.qti-writing-mode-vertical-rl {\n writing-mode: vertical-rl;\n}\n\n/* Set writing-mode to vertical-lr\n Typical for Mongolian vertical text */\n.qti-writing-mode-vertical-lr {\n writing-mode: vertical-lr;\n}\n\n/* Set writing-mode to horizontal-tb \n Browser default */\n.qti-writing-mode-horizontal-tb {\n writing-mode: horizontal-tb;\n}\n\n/* Float an element left */\n.qti-float-left {\n float: left;\n}\n\n/* Float an element right */\n.qti-float-right {\n float: right;\n}\n\n/* Remove a float */\n.qti-float-none {\n float: none;\n}\n\n/* Clearfix Hack to apply to a container of \n floated content that overflows the container. */\n.qti-float-clearfix::after {\n content: '';\n clear: both;\n display: table;\n}\n\n.qti-float-clear-left\n .qti-float-clear-right\n .qti-float-clear-both\n \n /* Set text-orientation to upright */\n .qti-text-orientation-upright {\n text-orientation: upright;\n}\n}\n\n@layer qti-base {\n\n.qti-layout-row {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n gap: 2.1276595745%;\n}\n\n.qti-layout-row [class*='qti-layout-col']:not(:empty) {\n box-sizing: border-box;\n}\n\n.qti-layout-row > [class*='qti-layout-col'] > :first-child {\n margin-block-start: 0; /* a heading or paragraph that opens a column starts at the column's top edge */\n}\n\n.qti-layout-row [class*='qti-layout-col']:empty {\n width: 0;\n overflow: hidden; /* to fully collapse if there\u2019s padding or borders */\n}\n\n.qti-layout-col1 {\n width: 6.3829787234%;\n}\n\n.qti-layout-col2 {\n width: 14.8936170213%;\n}\n\n.qti-layout-col3 {\n width: 23.4042553191%;\n}\n\n.qti-layout-col4 {\n width: 31.914893617%;\n}\n\n.qti-layout-col5 {\n width: 40.4255319149%;\n}\n\n.qti-layout-col6 {\n width: 48.9361702128%;\n}\n\n.qti-layout-col7 {\n width: 57.4468085106%;\n}\n\n.qti-layout-col8 {\n width: 65.9574468085%;\n}\n\n.qti-layout-col9 {\n width: 74.4680851064%;\n}\n\n.qti-layout-col10 {\n width: 82.9787234043%;\n}\n\n.qti-layout-col11 {\n width: 91.4893617021%;\n}\n\n.qti-layout-col12 {\n width: 100%;\n}\n\n.qti-layout-offset1 {\n margin-left: 8.5106382979%;\n}\n\n.qti-layout-offset2 {\n margin-left: 17.0212765957%;\n}\n\n.qti-layout-offset3 {\n margin-left: 25.5319148936%;\n}\n\n.qti-layout-offset4 {\n margin-left: 34.0425531915%;\n}\n\n.qti-layout-offset5 {\n margin-left: 42.5531914894%;\n}\n\n.qti-layout-offset6 {\n margin-left: 51.0638297872%;\n}\n\n.qti-layout-offset7 {\n margin-left: 59.5744680851%;\n}\n\n.qti-layout-offset8 {\n margin-left: 68.085106383%;\n}\n\n.qti-layout-offset9 {\n margin-left: 76.5957446809%;\n}\n\n.qti-layout-offset10 {\n margin-left: 85.1063829787%;\n}\n\n.qti-layout-offset11 {\n margin-left: 93.6170212766%;\n}\n\n@media (width <= 767px) {\n [class*='qti-layout-col'] {\n width: 100%;\n }\n}\n}\n";
8625
+
8521
8626
  // ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.styles.js
8522
8627
  import { css as css26 } from "lit";
8523
8628
  var qti_portable_custom_interaction_styles_default = [
@@ -8535,18 +8640,179 @@ var qti_portable_custom_interaction_styles_default = [
8535
8640
  `
8536
8641
  ];
8537
8642
 
8643
+ // ../interactions/portable-custom-interaction/dist/record-response.js
8644
+ var PAIR_BASE_TYPES = /* @__PURE__ */ new Set(["point", "pair", "directedPair"]);
8645
+ var coerceBaseValue = (value, baseType) => {
8646
+ if (value === null || value === void 0)
8647
+ return value;
8648
+ switch (baseType) {
8649
+ case "integer": {
8650
+ if (typeof value === "number")
8651
+ return value;
8652
+ const parsed = parseInt(String(value), 10);
8653
+ return Number.isNaN(parsed) ? value : parsed;
8654
+ }
8655
+ case "float":
8656
+ case "duration": {
8657
+ if (typeof value === "number")
8658
+ return value;
8659
+ const parsed = parseFloat(String(value));
8660
+ return Number.isNaN(parsed) ? value : parsed;
8661
+ }
8662
+ case "boolean": {
8663
+ if (typeof value === "boolean")
8664
+ return value;
8665
+ if (typeof value === "string") {
8666
+ const lowered = value.toLowerCase();
8667
+ if (lowered === "true")
8668
+ return true;
8669
+ if (lowered === "false")
8670
+ return false;
8671
+ }
8672
+ return value;
8673
+ }
8674
+ case "point": {
8675
+ const parts = Array.isArray(value) ? value : String(value).trim().split(/[\s,]+/);
8676
+ const numbers = parts.map((part) => typeof part === "number" ? part : parseFloat(String(part)));
8677
+ return numbers.length === 2 && numbers.every(Number.isFinite) ? numbers : value;
8678
+ }
8679
+ case "pair":
8680
+ case "directedPair": {
8681
+ const parts = Array.isArray(value) ? value : String(value).trim().split(/\s+/);
8682
+ return parts.length === 2 ? parts.map(String) : value;
8683
+ }
8684
+ case "string":
8685
+ case "identifier":
8686
+ default:
8687
+ return String(value);
8688
+ }
8689
+ };
8690
+ var recordEntryFromValue = (name, entryValue, baseType) => {
8691
+ if (baseType) {
8692
+ if (Array.isArray(entryValue) && !PAIR_BASE_TYPES.has(baseType)) {
8693
+ return { name, list: { [baseType]: entryValue.map((v) => coerceBaseValue(v, baseType)) } };
8694
+ }
8695
+ if (entryValue === null || entryValue === void 0) {
8696
+ return { name, base: null };
8697
+ }
8698
+ return { name, base: { [baseType]: coerceBaseValue(entryValue, baseType) } };
8699
+ }
8700
+ if (Array.isArray(entryValue)) {
8701
+ const filtered = entryValue.filter((v) => v !== null && v !== void 0);
8702
+ if (filtered.length && filtered.every((v) => typeof v === "boolean")) {
8703
+ return { name, list: { boolean: filtered } };
8704
+ }
8705
+ if (filtered.length && filtered.every((v) => typeof v === "number")) {
8706
+ const numbers = filtered;
8707
+ const isIntegers = numbers.every((n) => Number.isInteger(n));
8708
+ return { name, list: { [isIntegers ? "integer" : "float"]: numbers } };
8709
+ }
8710
+ return { name, list: { string: entryValue.map((v) => v === null || v === void 0 ? "" : String(v)) } };
8711
+ }
8712
+ if (typeof entryValue === "boolean") {
8713
+ return { name, base: { boolean: entryValue } };
8714
+ }
8715
+ if (typeof entryValue === "number") {
8716
+ if (Number.isInteger(entryValue))
8717
+ return { name, base: { integer: entryValue } };
8718
+ return { name, base: { float: entryValue } };
8719
+ }
8720
+ if (entryValue === null || entryValue === void 0) {
8721
+ return { name, base: { string: "" } };
8722
+ }
8723
+ if (typeof entryValue === "object") {
8724
+ try {
8725
+ return { name, base: { string: JSON.stringify(entryValue) } };
8726
+ } catch {
8727
+ return { name, base: { string: String(entryValue) } };
8728
+ }
8729
+ }
8730
+ return { name, base: { string: String(entryValue) } };
8731
+ };
8732
+ var recordToQtiVariableJSON = (value, fieldBaseTypes = {}) => {
8733
+ if (!isRecordValue(value)) {
8734
+ return { record: [] };
8735
+ }
8736
+ const recordEntries = [];
8737
+ for (const [name, entryValue] of Object.entries(value)) {
8738
+ recordEntries.push(recordEntryFromValue(name, entryValue, fieldBaseTypes[name]));
8739
+ }
8740
+ return { record: recordEntries };
8741
+ };
8742
+ var recordFieldBaseTypes = (value, declared = {}) => {
8743
+ if (!isRecordValue(value))
8744
+ return { ...declared };
8745
+ const baseTypes = {};
8746
+ for (const [name, entryValue] of Object.entries(value)) {
8747
+ baseTypes[name] = declared[name] ?? inferRecordFieldBaseType(Array.isArray(entryValue) ? entryValue[0] : entryValue);
8748
+ }
8749
+ return baseTypes;
8750
+ };
8751
+ var recordResponseToQtiVariableJSON = (value, declared = {}) => recordToQtiVariableJSON(value, recordFieldBaseTypes(value, declared));
8752
+ var toQtiLiteral = (value) => {
8753
+ if (value === null || value === void 0)
8754
+ return null;
8755
+ if (Array.isArray(value))
8756
+ return value.map(String).join(" ");
8757
+ if (typeof value === "object") {
8758
+ try {
8759
+ return JSON.stringify(value);
8760
+ } catch {
8761
+ return String(value);
8762
+ }
8763
+ }
8764
+ return String(value);
8765
+ };
8766
+ var firstTypedValue = (typed) => {
8767
+ if (!typed)
8768
+ return void 0;
8769
+ for (const key of Object.keys(typed)) {
8770
+ const value = typed[key];
8771
+ if (value !== void 0 && value !== null)
8772
+ return value;
8773
+ }
8774
+ return void 0;
8775
+ };
8776
+ var recordFromQtiVariableJSON = (record) => {
8777
+ const value = {};
8778
+ for (const entry of record) {
8779
+ if (!entry || typeof entry.name !== "string" || !entry.name)
8780
+ continue;
8781
+ if (entry.list) {
8782
+ const items = firstTypedValue(entry.list);
8783
+ value[entry.name] = Array.isArray(items) ? items.map(toQtiLiteral).filter((v) => v !== null) : [];
8784
+ } else {
8785
+ value[entry.name] = toQtiLiteral(firstTypedValue(entry.base));
8786
+ }
8787
+ }
8788
+ return value;
8789
+ };
8790
+
8791
+ // ../interactions/portable-custom-interaction/dist/vendor/require-js.js
8792
+ var require_js_default = `/** vim: et:ts=4:sw=4:sts=4
8793
+ * @license RequireJS 2.3.8 Copyright jQuery Foundation and other contributors.
8794
+ * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
8795
+ */var requirejs,require,define;(function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.8",commentRegExp=/\\/\\*[\\s\\S]*?\\*\\/|([^:"'=]|^)\\/\\/.*$/mg,cjsRequireRegExp=/[^.]\\s*require\\s*\\(\\s*["']([^'"\\s]+)["']\\s*\\)/g,jsSuffixRegExp=/\\.js$/,currDirRegExp=/^\\.\\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!!(typeof window<"u"&&typeof navigator<"u"&&window.document),isWebWorker=!isBrowser&&typeof importScripts<"u",readyRegExp=isBrowser&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera=typeof opera<"u"&&opera.toString()==="[object Opera]",contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(r,a){return a||""}function isFunction(r){return ostring.call(r)==="[object Function]"}function isArray(r){return ostring.call(r)==="[object Array]"}function each(r,a){if(r){var c;for(c=0;c<r.length&&!(r[c]&&a(r[c],c,r));c+=1);}}function eachReverse(r,a){if(r){var c;for(c=r.length-1;c>-1&&!(r[c]&&a(r[c],c,r));c-=1);}}function hasProp(r,a){return hasOwn.call(r,a)}function getOwn(r,a){return hasProp(r,a)&&r[a]}function eachProp(r,a){var c;for(c in r)if(hasProp(r,c)&&c!=="__proto__"&&c!=="constructor"&&a(r[c],c))break}function mixin(r,a,c,u){return a&&eachProp(a,function(h,q){(c||!hasProp(r,q))&&(u&&typeof h=="object"&&h&&!isArray(h)&&!isFunction(h)&&!(h instanceof RegExp)?(r[q]||(r[q]={}),mixin(r[q],h,c,u)):r[q]=h)}),r}function bind(r,a){return function(){return a.apply(r,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(r){throw r}function getGlobal(r){if(!r)return r;var a=global;return each(r.split("."),function(c){a=a[c]}),a}function makeError(r,a,c,u){var h=new Error(a+\`
8796
+ https://requirejs.org/docs/errors.html#\`+r);return h.requireType=r,h.requireModules=u,c&&(h.originalError=c),h}if(typeof define<"u")return;if(typeof requirejs<"u"){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}typeof require<"u"&&!isFunction(require)&&(cfg=require,require=void 0);function newContext(r){var a,c,u,h,q,g={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},v={},B={},I={},M=[],w={},D={},L={},H=1,K=1;function X(e){var i,n;for(i=0;i<e.length;i++)if(n=e[i],n===".")e.splice(i,1),i-=1;else if(n===".."){if(i===0||i===1&&e[2]===".."||e[i-1]==="..")continue;i>0&&(e.splice(i-1,2),i-=2)}}function P(e,i,n){var o,t,f,d,l,p,b,E,m,x,R,A,O=i&&i.split("/"),k=g.map,j=k&&k["*"];if(e&&(e=e.split("/"),b=e.length-1,g.nodeIdCompat&&jsSuffixRegExp.test(e[b])&&(e[b]=e[b].replace(jsSuffixRegExp,"")),e[0].charAt(0)==="."&&O&&(A=O.slice(0,O.length-1),e=A.concat(e)),X(e),e=e.join("/")),n&&k&&(O||j)){f=e.split("/");e:for(d=f.length;d>0;d-=1){if(p=f.slice(0,d).join("/"),O){for(l=O.length;l>0;l-=1)if(t=getOwn(k,O.slice(0,l).join("/")),t&&(t=getOwn(t,p),t)){E=t,m=d;break e}}!x&&j&&getOwn(j,p)&&(x=getOwn(j,p),R=d)}!E&&x&&(E=x,m=R),E&&(f.splice(0,m,E),e=f.join("/"))}return o=getOwn(g.pkgs,e),o||e}function W(e){isBrowser&&each(scripts(),function(i){if(i.getAttribute("data-requiremodule")===e&&i.getAttribute("data-requirecontext")===u.contextName)return i.parentNode.removeChild(i),!0})}function Q(e){var i=getOwn(g.paths,e);if(i&&isArray(i)&&i.length>1)return i.shift(),u.require.undef(e),u.makeRequire(null,{skipMap:!0})([e]),!0}function G(e){var i,n=e?e.indexOf("!"):-1;return n>-1&&(i=e.substring(0,n),e=e.substring(n+1,e.length)),[i,e]}function S(e,i,n,o){var t,f,d,l,p=null,b=i?i.name:null,E=e,m=!0,x="";return e||(m=!1,e="_@r"+(H+=1)),l=G(e),p=l[0],e=l[1],p&&(p=P(p,b,o),f=getOwn(w,p)),e&&(p?n?x=e:f&&f.normalize?x=f.normalize(e,function(R){return P(R,b,o)}):x=e.indexOf("!")===-1?P(e,b,o):e:(x=P(e,b,o),l=G(x),p=l[0],x=l[1],n=!0,t=u.nameToUrl(x))),d=p&&!f&&!n?"_unnormalized"+(K+=1):"",{prefix:p,name:x,parentMap:i,unnormalized:!!d,url:t,originalName:E,isDefine:m,id:(p?p+"!"+x:x)+d}}function T(e){var i=e.id,n=getOwn(v,i);return n||(n=v[i]=new u.Module(e)),n}function C(e,i,n){var o=e.id,t=getOwn(v,o);hasProp(w,o)&&(!t||t.defineEmitComplete)?i==="defined"&&n(w[o]):(t=T(e),t.error&&i==="error"?n(t.error):t.on(i,n))}function y(e,i){var n=e.requireModules,o=!1;i?i(e):(each(n,function(t){var f=getOwn(v,t);f&&(f.error=e,f.events.error&&(o=!0,f.emit("error",e)))}),o||req.onError(e))}function F(){globalDefQueue.length&&(each(globalDefQueue,function(e){var i=e[0];typeof i=="string"&&(u.defQueueMap[i]=!0),M.push(e)}),globalDefQueue=[])}h={require:function(e){return e.require?e.require:e.require=u.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?w[e.map.id]=e.exports:e.exports=w[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(g.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}};function U(e){delete v[e],delete B[e]}function $(e,i,n){var o=e.map.id;e.error?e.emit("error",e.error):(i[o]=!0,each(e.depMaps,function(t,f){var d=t.id,l=getOwn(v,d);l&&!e.depMatched[f]&&!n[d]&&(getOwn(i,d)?(e.defineDep(f,w[d]),e.check()):$(l,i,n))}),n[o]=!0)}function z(){var e,i,n=g.waitSeconds*1e3,o=n&&u.startTime+n<new Date().getTime(),t=[],f=[],d=!1,l=!0;if(!a){if(a=!0,eachProp(B,function(p){var b=p.map,E=b.id;if(p.enabled&&(b.isDefine||f.push(p),!p.error)){if(!p.inited&&o)Q(E)?(i=!0,d=!0):(t.push(E),W(E));else if(!p.inited&&p.fetched&&b.isDefine&&(d=!0,!b.prefix))return l=!1}}),o&&t.length)return e=makeError("timeout","Load timeout for modules: "+t,null,t),e.contextName=u.contextName,y(e);l&&each(f,function(p){$(p,{},{})}),(!o||i)&&d&&(isBrowser||isWebWorker)&&!q&&(q=setTimeout(function(){q=0,z()},50)),a=!1}}c=function(e){this.events=getOwn(I,e.id)||{},this.map=e,this.shim=getOwn(g.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},c.prototype={init:function(e,i,n,o){o=o||{},!this.inited&&(this.factory=i,n?this.on("error",n):this.events.error&&(n=bind(this,function(t){this.emit("error",t)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=o.ignore,o.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,i){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=i)},fetch:function(){if(!this.fetched){this.fetched=!0,u.startTime=new Date().getTime();var e=this.map;if(this.shim)u.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}));else return e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;D[e]||(D[e]=!0,u.load(this.map.id,e))},check:function(){if(!(!this.enabled||this.enabling)){var e,i,n=this.map.id,o=this.depExports,t=this.exports,f=this.factory;if(!this.inited)hasProp(u.defQueueMap,n)||this.fetch();else if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(f)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{t=u.execCb(n,f,o,t)}catch(l){e=l}else t=u.execCb(n,f,o,t);if(this.map.isDefine&&t===void 0&&(i=this.module,i?t=i.exports:this.usingExports&&(t=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",y(this.error=e)}else t=f;if(this.exports=t,this.map.isDefine&&!this.ignore&&(w[n]=t,req.onResourceLoad)){var d=[];each(this.depMaps,function(l){d.push(l.normalizedMap||l)}),req.onResourceLoad(u,this.map,d)}U(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var e=this.map,i=e.id,n=S(e.prefix);this.depMaps.push(n),C(n,"defined",bind(this,function(o){var t,f,d,l=getOwn(L,this.map.id),p=this.map.name,b=this.map.parentMap?this.map.parentMap.name:null,E=u.makeRequire(e.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){o.normalize&&(p=o.normalize(p,function(m){return P(m,b,!0)})||""),f=S(e.prefix+"!"+p,this.map.parentMap,!0),C(f,"defined",bind(this,function(m){this.map.normalizedMap=f,this.init([],function(){return m},null,{enabled:!0,ignore:!0})})),d=getOwn(v,f.id),d&&(this.depMaps.push(f),this.events.error&&d.on("error",bind(this,function(m){this.emit("error",m)})),d.enable());return}if(l){this.map.url=u.nameToUrl(l),this.load();return}t=bind(this,function(m){this.init([],function(){return m},null,{enabled:!0})}),t.error=bind(this,function(m){this.inited=!0,this.error=m,m.requireModules=[i],eachProp(v,function(x){x.map.id.indexOf(i+"_unnormalized")===0&&U(x.map.id)}),y(m)}),t.fromText=bind(this,function(m,x){var R=e.name,A=S(R),O=useInteractive;x&&(m=x),O&&(useInteractive=!1),T(A),hasProp(g.config,i)&&(g.config[R]=g.config[i]);try{req.exec(m)}catch(k){return y(makeError("fromtexteval","fromText eval for "+i+" failed: "+k,k,[i]))}O&&(useInteractive=!0),this.depMaps.push(A),u.completeLoad(R),E([R],t)}),o.load(e.name,E,t,g)})),u.enable(n,this),this.pluginMaps[n.id]=n},enable:function(){B[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,i){var n,o,t;if(typeof e=="string"){if(e=S(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[i]=e,t=getOwn(h,e.id),t){this.depExports[i]=t(this);return}this.depCount+=1,C(e,"defined",bind(this,function(f){this.undefed||(this.defineDep(i,f),this.check())})),this.errback?C(e,"error",bind(this,this.errback)):this.events.error&&C(e,"error",bind(this,function(f){this.emit("error",f)}))}n=e.id,o=v[n],!hasProp(h,n)&&o&&!o.enabled&&u.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var i=getOwn(v,e.id);i&&!i.enabled&&u.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,i){var n=this.events[e];n||(n=this.events[e]=[]),n.push(i)},emit:function(e,i){each(this.events[e],function(n){n(i)}),e==="error"&&delete this.events[e]}};function _(e){hasProp(w,e[0])||T(S(e[0],null,!0)).init(e[1],e[2])}function J(e,i,n,o){e.detachEvent&&!isOpera?o&&e.detachEvent(o,i):e.removeEventListener(n,i,!1)}function V(e){var i=e.currentTarget||e.srcElement;return J(i,u.onScriptLoad,"load","onreadystatechange"),J(i,u.onScriptError,"error"),{node:i,id:i&&i.getAttribute("data-requiremodule")}}function Y(){var e;for(F();M.length;){if(e=M.shift(),e[0]===null)return y(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));_(e)}u.defQueueMap={}}return u={config:g,contextName:r,registry:v,defined:w,urlFetched:D,defQueue:M,defQueueMap:{},Module:c,makeModuleMap:S,nextTick:req.nextTick,onError:y,configure:function(e){if(e.baseUrl&&e.baseUrl.charAt(e.baseUrl.length-1)!=="/"&&(e.baseUrl+="/"),typeof e.urlArgs=="string"){var i=e.urlArgs;e.urlArgs=function(t,f){return(f.indexOf("?")===-1?"?":"&")+i}}var n=g.shim,o={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(t,f){o[f]?(g[f]||(g[f]={}),mixin(g[f],t,!0,!0)):g[f]=t}),e.bundles&&eachProp(e.bundles,function(t,f){each(t,function(d){d!==f&&(L[d]=f)})}),e.shim&&(eachProp(e.shim,function(t,f){isArray(t)&&(t={deps:t}),(t.exports||t.init)&&!t.exportsFn&&(t.exportsFn=u.makeShimExports(t)),n[f]=t}),g.shim=n),e.packages&&each(e.packages,function(t){var f,d;t=typeof t=="string"?{name:t}:t,d=t.name,f=t.location,f&&(g.paths[d]=t.location),g.pkgs[d]=t.name+"/"+(t.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(v,function(t,f){!t.inited&&!t.map.unnormalized&&(t.map=S(f,null,!0))}),(e.deps||e.callback)&&u.require(e.deps||[],e.callback)},makeShimExports:function(e){function i(){var n;return e.init&&(n=e.init.apply(global,arguments)),n||e.exports&&getGlobal(e.exports)}return i},makeRequire:function(e,i){i=i||{};function n(o,t,f){var d,l,p;return i.enableBuildCallback&&t&&isFunction(t)&&(t.__requireJsBuild=!0),typeof o=="string"?isFunction(t)?y(makeError("requireargs","Invalid require call"),f):e&&hasProp(h,o)?h[o](v[e.id]):req.get?req.get(u,o,e,n):(l=S(o,e,!1,!0),d=l.id,hasProp(w,d)?w[d]:y(makeError("notloaded",'Module name "'+d+'" has not been loaded yet for context: '+r+(e?"":". Use require([])")))):(Y(),u.nextTick(function(){Y(),p=T(S(null,e)),p.skipMap=i.skipMap,p.init(o,t,f,{enabled:!0}),z()}),n)}return mixin(n,{isBrowser,toUrl:function(o){var t,f=o.lastIndexOf("."),d=o.split("/")[0],l=d==="."||d==="..";return f!==-1&&(!l||f>1)&&(t=o.substring(f,o.length),o=o.substring(0,f)),u.nameToUrl(P(o,e&&e.id,!0),t,!0)},defined:function(o){return hasProp(w,S(o,e,!1,!0).id)},specified:function(o){return o=S(o,e,!1,!0).id,hasProp(w,o)||hasProp(v,o)}}),e||(n.undef=function(o){F();var t=S(o,e,!0),f=getOwn(v,o);f.undefed=!0,W(o),delete w[o],delete D[t.url],delete I[o],eachReverse(M,function(d,l){d[0]===o&&M.splice(l,1)}),delete u.defQueueMap[o],f&&(f.events.defined&&(I[o]=f.events),U(o))}),n},enable:function(e){var i=getOwn(v,e.id);i&&T(e).enable()},completeLoad:function(e){var i,n,o,t=getOwn(g.shim,e)||{},f=t.exports;for(F();M.length;){if(n=M.shift(),n[0]===null){if(n[0]=e,i)break;i=!0}else n[0]===e&&(i=!0);_(n)}if(u.defQueueMap={},o=getOwn(v,e),!i&&!hasProp(w,e)&&o&&!o.inited){if(g.enforceDefine&&(!f||!getGlobal(f)))return Q(e)?void 0:y(makeError("nodefine","No define call for "+e,null,[e]));_([e,t.deps||[],t.exportsFn])}z()},nameToUrl:function(e,i,n){var o,t,f,d,l,p,b,E=getOwn(g.pkgs,e);if(E&&(e=E),b=getOwn(L,e),b)return u.nameToUrl(b,i,n);if(req.jsExtRegExp.test(e))l=e+(i||"");else{for(o=g.paths,t=e.split("/"),f=t.length;f>0;f-=1)if(d=t.slice(0,f).join("/"),p=getOwn(o,d),p){isArray(p)&&(p=p[0]),t.splice(0,f,p);break}l=t.join("/"),l+=i||(/^data\\:|^blob\\:|\\?/.test(l)||n?"":".js"),l=(l.charAt(0)==="/"||l.match(/^[\\w\\+\\.\\-]+:/)?"":g.baseUrl)+l}return g.urlArgs&&!/^blob\\:/.test(l)?l+g.urlArgs(e,l):l},load:function(e,i){req.load(u,e,i)},execCb:function(e,i,n,o){return i.apply(o,n)},onScriptLoad:function(e){if(e.type==="load"||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var i=V(e);u.completeLoad(i.id)}},onScriptError:function(e){var i=V(e);if(!Q(i.id)){var n=[];return eachProp(v,function(o,t){t.indexOf("_@r")!==0&&each(o.depMaps,function(f){if(f.id===i.id)return n.push(t),!0})}),y(makeError("scripterror",'Script error for "'+i.id+(n.length?'", needed by: '+n.join(", "):'"'),e,[i.id]))}}},u.require=u.makeRequire(),u}req=requirejs=function(r,a,c,u){var h,q,g=defContextName;return!isArray(r)&&typeof r!="string"&&(q=r,isArray(a)?(r=a,a=c,c=u):r=[]),q&&q.context&&(g=q.context),h=getOwn(contexts,g),h||(h=contexts[g]=req.s.newContext(g)),q&&h.configure(q),h.require(r,a,c)},req.config=function(r){return req(r)},req.nextTick=typeof setTimeout<"u"?function(r){setTimeout(r,4)}:function(r){r()},require||(require=req),req.version=version,req.jsExtRegExp=/^\\/|:|\\?|\\.js$/,req.isBrowser=isBrowser,s=req.s={contexts,newContext},req({}),each(["toUrl","undef","defined","specified"],function(r){req[r]=function(){var a=contexts[defContextName];return a.require[r].apply(a,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(r,a,c){var u=r.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return u.type=r.scriptType||"text/javascript",u.charset="utf-8",u.async=!0,u},req.load=function(r,a,c){var u=r&&r.config||{},h;if(isBrowser)return h=req.createNode(u,a,c),h.setAttribute("data-requirecontext",r.contextName),h.setAttribute("data-requiremodule",a),h.attachEvent&&!(h.attachEvent.toString&&h.attachEvent.toString().indexOf("[native code")<0)&&!isOpera?(useInteractive=!0,h.attachEvent("onreadystatechange",r.onScriptLoad)):(h.addEventListener("load",r.onScriptLoad,!1),h.addEventListener("error",r.onScriptError,!1)),h.src=c,u.onNodeCreated&&u.onNodeCreated(h,u,a,c),currentlyAddingScript=h,baseElement?head.insertBefore(h,baseElement):head.appendChild(h),currentlyAddingScript=null,h;if(isWebWorker)try{setTimeout(function(){},0),importScripts(c),r.completeLoad(a)}catch(q){r.onError(makeError("importscripts","importScripts failed for "+a+" at "+c,q,[a]))}};function getInteractiveScript(){return interactiveScript&&interactiveScript.readyState==="interactive"||eachReverse(scripts(),function(r){if(r.readyState==="interactive")return interactiveScript=r}),interactiveScript}isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(r){if(head||(head=r.parentNode),dataMain=r.getAttribute("data-main"),dataMain)return mainScript=dataMain,!cfg.baseUrl&&mainScript.indexOf("!")===-1&&(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(r,a,c){var u,h;typeof r!="string"&&(c=a,a=r,r=null),isArray(a)||(c=a,a=null),!a&&isFunction(c)&&(a=[],c.length&&(c.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(q,g){a.push(g)}),a=(c.length===1?["require"]:["require","exports","module"]).concat(a))),useInteractive&&(u=currentlyAddingScript||getInteractiveScript(),u&&(r||(r=u.getAttribute("data-requiremodule")),h=contexts[u.getAttribute("data-requirecontext")])),h?(h.defQueue.push([r,a,c]),h.defQueueMap[r]=!0):globalDefQueue.push([r,a,c])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)})(this,typeof setTimeout>"u"?void 0:setTimeout);`;
8797
+
8538
8798
  // ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.js
8539
- var __decorate24 = function(decorators, target, key, desc) {
8799
+ var __decorate25 = function(decorators, target, key, desc) {
8540
8800
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8541
8801
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
8542
8802
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
8543
8803
  return c > 3 && r && Object.defineProperty(target, key, r), r;
8544
8804
  };
8805
+ var inlineScriptText = (text) => text.replace(/<\/(script)/gi, "<\\/$1");
8806
+ var inlineStyleText = (text) => text.replace(/<\/(style)/gi, "<\\/$1");
8545
8807
  var STATUSES_SHOWING_CORRECT_RESPONSE = ["solution", "review"];
8546
8808
  function hasCorrectResponseValue(value) {
8547
8809
  if (value === null || value === void 0)
8548
8810
  return false;
8549
- return Array.isArray(value) ? value.length > 0 : value !== "";
8811
+ if (Array.isArray(value))
8812
+ return value.length > 0;
8813
+ if (isRecordValue(value))
8814
+ return Object.keys(value).length > 0;
8815
+ return value !== "";
8550
8816
  }
8551
8817
  var QtiPortableCustomInteraction = class extends Interaction {
8552
8818
  constructor() {
@@ -8557,7 +8823,7 @@ var QtiPortableCustomInteraction = class extends Interaction {
8557
8823
  this._iframeMessageOrigin = null;
8558
8824
  this.requirePathsJson = "";
8559
8825
  this.requireShimJson = "";
8560
- this.requireJsUrl = "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js";
8826
+ this.requireJsUrl = "";
8561
8827
  this.baseUrl = "";
8562
8828
  this.useDefaultPaths = false;
8563
8829
  this.status = "interacting";
@@ -8596,7 +8862,6 @@ var QtiPortableCustomInteraction = class extends Interaction {
8596
8862
  case "resize":
8597
8863
  if (typeof data.height === "number" && this.iframe) {
8598
8864
  this.iframe.style.height = `${data.height}px`;
8599
- this.iframe.style.width = `${data.width}px`;
8600
8865
  }
8601
8866
  break;
8602
8867
  case "console":
@@ -8623,30 +8888,32 @@ var QtiPortableCustomInteraction = class extends Interaction {
8623
8888
  this.#pciCustomValidityMessage = pciCustomValidity;
8624
8889
  }
8625
8890
  const stateRaw = data?.params?.state;
8626
- let state14;
8891
+ let state15;
8627
8892
  if (stateRaw === void 0) {
8628
- state14 = void 0;
8893
+ state15 = void 0;
8629
8894
  } else if (stateRaw === null) {
8630
- state14 = null;
8895
+ state15 = null;
8631
8896
  } else if (typeof stateRaw === "string") {
8632
- state14 = stateRaw;
8897
+ state15 = stateRaw;
8633
8898
  } else {
8634
8899
  try {
8635
- state14 = `__qti_json__::${JSON.stringify(stateRaw)}`;
8900
+ state15 = `__qti_json__::${JSON.stringify(stateRaw)}`;
8636
8901
  } catch {
8637
- state14 = null;
8902
+ state15 = null;
8638
8903
  }
8639
8904
  }
8640
8905
  if (converted === null) {
8641
- const emptyResponse = this.responseVariable?.cardinality === "single" ? "" : [];
8906
+ const cardinality = this.responseVariable?.cardinality;
8907
+ const emptyResponse = cardinality === "record" ? null : cardinality === "single" ? "" : [];
8642
8908
  this.response = emptyResponse;
8643
8909
  this.validate();
8644
- this.saveResponse(emptyResponse, state14);
8910
+ this.saveResponse(emptyResponse, state15);
8645
8911
  break;
8646
8912
  }
8647
- this.response = converted;
8913
+ const response = converted;
8914
+ this.response = response;
8648
8915
  this.validate();
8649
- this.saveResponse(converted, state14);
8916
+ this.saveResponse(response, state15);
8650
8917
  break;
8651
8918
  }
8652
8919
  case "error":
@@ -8774,9 +9041,13 @@ var QtiPortableCustomInteraction = class extends Interaction {
8774
9041
  return this.#getRequireShim();
8775
9042
  }
8776
9043
  /**
8777
- * Converts QtiVariableJSON to a string or string array
9044
+ * Converts QtiVariableJSON to a string, a string array, or for a record its field map
8778
9045
  */
8779
9046
  #convertQtiVariableJSON(input) {
9047
+ if (input && Array.isArray(input.record)) {
9048
+ const record = recordFromQtiVariableJSON(input.record);
9049
+ return Object.keys(record).length ? record : null;
9050
+ }
8780
9051
  for (const topLevelKey in input) {
8781
9052
  if (input.hasOwnProperty(topLevelKey)) {
8782
9053
  const nestedObject = input[topLevelKey];
@@ -8803,44 +9074,6 @@ var QtiPortableCustomInteraction = class extends Interaction {
8803
9074
  const needle = tagName.toLowerCase();
8804
9075
  return Array.from(this.children).filter((child) => child.tagName.toLowerCase() === needle);
8805
9076
  }
8806
- /**
8807
- * Coerce a scalar value to the expected base-type when possible
8808
- */
8809
- coerceBaseValue(value, baseType) {
8810
- if (value === null || value === void 0)
8811
- return value;
8812
- switch (baseType) {
8813
- case "integer": {
8814
- if (typeof value === "number")
8815
- return value;
8816
- const parsed = parseInt(String(value), 10);
8817
- return Number.isNaN(parsed) ? value : parsed;
8818
- }
8819
- case "float":
8820
- case "duration": {
8821
- if (typeof value === "number")
8822
- return value;
8823
- const parsed = parseFloat(String(value));
8824
- return Number.isNaN(parsed) ? value : parsed;
8825
- }
8826
- case "boolean": {
8827
- if (typeof value === "boolean")
8828
- return value;
8829
- if (typeof value === "string") {
8830
- const lowered = value.toLowerCase();
8831
- if (lowered === "true")
8832
- return true;
8833
- if (lowered === "false")
8834
- return false;
8835
- }
8836
- return value;
8837
- }
8838
- case "string":
8839
- case "identifier":
8840
- default:
8841
- return String(value);
8842
- }
8843
- }
8844
9077
  /**
8845
9078
  * Normalize an input into a list form
8846
9079
  */
@@ -8854,62 +9087,13 @@ var QtiPortableCustomInteraction = class extends Interaction {
8854
9087
  */
8855
9088
  variableToQtiVariableJSON(value, cardinality, baseType) {
8856
9089
  if (cardinality === "record" || baseType === "record") {
8857
- return this.recordToQtiVariableJSON(value);
9090
+ return recordToQtiVariableJSON(value);
8858
9091
  }
8859
9092
  if (cardinality !== "single") {
8860
- const listValues = this.normalizeListValue(value).map((v) => this.coerceBaseValue(v, baseType));
9093
+ const listValues = this.normalizeListValue(value).map((v) => coerceBaseValue(v, baseType));
8861
9094
  return { list: { [baseType]: listValues } };
8862
9095
  }
8863
- return { base: { [baseType]: this.coerceBaseValue(value, baseType) } };
8864
- }
8865
- /**
8866
- * Convert a record object into QtiVariableJSON
8867
- */
8868
- recordToQtiVariableJSON(value) {
8869
- if (!value || typeof value !== "object") {
8870
- return { record: [] };
8871
- }
8872
- const recordEntries = [];
8873
- for (const [name, entryValue] of Object.entries(value)) {
8874
- recordEntries.push(this.recordEntryFromValue(name, entryValue));
8875
- }
8876
- return { record: recordEntries };
8877
- }
8878
- /**
8879
- * Build a record entry from an arbitrary value
8880
- */
8881
- recordEntryFromValue(name, entryValue) {
8882
- if (Array.isArray(entryValue)) {
8883
- const filtered = entryValue.filter((v) => v !== null && v !== void 0);
8884
- if (filtered.length && filtered.every((v) => typeof v === "boolean")) {
8885
- return { name, list: { boolean: filtered } };
8886
- }
8887
- if (filtered.length && filtered.every((v) => typeof v === "number")) {
8888
- const numbers = filtered;
8889
- const isIntegers = numbers.every((n) => Number.isInteger(n));
8890
- return { name, list: { [isIntegers ? "integer" : "float"]: numbers } };
8891
- }
8892
- return { name, list: { string: entryValue.map((v) => v === null || v === void 0 ? "" : String(v)) } };
8893
- }
8894
- if (typeof entryValue === "boolean") {
8895
- return { name, base: { boolean: entryValue } };
8896
- }
8897
- if (typeof entryValue === "number") {
8898
- if (Number.isInteger(entryValue))
8899
- return { name, base: { integer: entryValue } };
8900
- return { name, base: { float: entryValue } };
8901
- }
8902
- if (entryValue === null || entryValue === void 0) {
8903
- return { name, base: { string: "" } };
8904
- }
8905
- if (typeof entryValue === "object") {
8906
- try {
8907
- return { name, base: { string: JSON.stringify(entryValue) } };
8908
- } catch {
8909
- return { name, base: { string: String(entryValue) } };
8910
- }
8911
- }
8912
- return { name, base: { string: String(entryValue) } };
9096
+ return { base: { [baseType]: coerceBaseValue(value, baseType) } };
8913
9097
  }
8914
9098
  /**
8915
9099
  * Extract default QTI_CONTEXT values from qti-context-declaration elements
@@ -8924,15 +9108,10 @@ var QtiPortableCustomInteraction = class extends Interaction {
8924
9108
  const defaultValueElement = declaration.querySelector("qti-default-value");
8925
9109
  if (!defaultValueElement)
8926
9110
  return;
8927
- const valueElements = defaultValueElement.querySelectorAll("qti-value[field-identifier]");
8928
- valueElements.forEach((valueElement) => {
8929
- const fieldIdentifier = valueElement.getAttribute("field-identifier");
8930
- if (!fieldIdentifier)
8931
- return;
8932
- const baseType = valueElement.getAttribute("base-type") || "string";
8933
- const textContent = valueElement.textContent?.trim() || "";
8934
- defaults[fieldIdentifier] = this.coerceBaseValue(textContent, baseType);
8935
- });
9111
+ const { value, baseTypes } = readRecordFieldValues(defaultValueElement.querySelectorAll("qti-value"));
9112
+ for (const [fieldIdentifier, textContent] of Object.entries(value)) {
9113
+ defaults[fieldIdentifier] = coerceBaseValue(textContent, baseTypes[fieldIdentifier] ?? "string");
9114
+ }
8936
9115
  });
8937
9116
  return defaults;
8938
9117
  }
@@ -8951,7 +9130,7 @@ var QtiPortableCustomInteraction = class extends Interaction {
8951
9130
  environmentIdentifier: merged.environmentIdentifier ?? "",
8952
9131
  ...merged
8953
9132
  };
8954
- return this.recordToQtiVariableJSON(normalized);
9133
+ return recordToQtiVariableJSON(normalized);
8955
9134
  }
8956
9135
  /**
8957
9136
  * Collect template variables referenced by qti-template-variable children
@@ -9044,7 +9223,10 @@ var QtiPortableCustomInteraction = class extends Interaction {
9044
9223
  /**
9045
9224
  * Converts response variables to QtiVariableJSON
9046
9225
  */
9047
- responseVariablesToQtiVariableJSON(input, cardinality, baseType) {
9226
+ responseVariablesToQtiVariableJSON(input, cardinality, baseType, fieldBaseTypes) {
9227
+ if (cardinality === "record") {
9228
+ return recordResponseToQtiVariableJSON(input, fieldBaseTypes);
9229
+ }
9048
9230
  if (cardinality !== "single") {
9049
9231
  const list = { list: {} };
9050
9232
  list.list[baseType] = input;
@@ -9058,6 +9240,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
9058
9240
  #hasNonEmptyResponse() {
9059
9241
  if (this.response === null || this.response === void 0)
9060
9242
  return false;
9243
+ if (isRecordValue(this.response)) {
9244
+ return Object.values(this.response).some((v) => v !== "" && v !== null && v !== void 0);
9245
+ }
9061
9246
  if (Array.isArray(this.response)) {
9062
9247
  if (this.response.length === 0)
9063
9248
  return false;
@@ -9085,6 +9270,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
9085
9270
  get value() {
9086
9271
  if (this.#value === null || this.#value === void 0)
9087
9272
  return null;
9273
+ if (isRecordValue(this.#value))
9274
+ return JSON.stringify(this.#value);
9088
9275
  return Array.isArray(this.#value) ? this.#value.join(",") : String(this.#value);
9089
9276
  }
9090
9277
  set boundTo(newValue) {
@@ -9099,10 +9286,11 @@ var QtiPortableCustomInteraction = class extends Interaction {
9099
9286
  const responseVariable = {};
9100
9287
  const variable = this.context?.variables?.find((v) => v.identifier === this.responseIdentifier);
9101
9288
  if (variable) {
9102
- const cardinality = this.context?.variables?.find((v) => v.identifier === this.responseIdentifier)?.cardinality || "single";
9103
- const baseType = this.context?.variables?.find((v) => v.identifier === this.responseIdentifier)?.baseType || "string";
9104
- const value = this.context?.variables?.find((v) => v.identifier === this.responseIdentifier)?.value || null;
9105
- const responseVal = this.responseVariablesToQtiVariableJSON(value, cardinality, baseType);
9289
+ const cardinality = variable.cardinality || "single";
9290
+ const baseType = variable.baseType || "string";
9291
+ const value = variable.value || null;
9292
+ const fieldBaseTypes = variable.fieldBaseTypes;
9293
+ const responseVal = this.responseVariablesToQtiVariableJSON(value, cardinality, baseType, fieldBaseTypes);
9106
9294
  responseVariable[this.responseIdentifier] = responseVal;
9107
9295
  }
9108
9296
  return responseVariable;
@@ -9272,11 +9460,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
9272
9460
  const iframeBaseUrl = this.dataset.baseUrl ? this.dataset.baseUrl.startsWith("/") ? `${window.location.origin}${this.dataset.baseUrl}` : this.dataset.baseUrl : "";
9273
9461
  const iframeBaseHref = iframeBaseUrl ? iframeBaseUrl.endsWith("/") ? iframeBaseUrl : `${iframeBaseUrl}/` : `${window.location.origin}/`;
9274
9462
  const forwardConsole = this.dataset.forwardConsole === "true";
9275
- const isLocalhost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
9276
- const defaultComponentsCdnUrl = isLocalhost ? `${window.location.origin}/cdn/index.js` : "https://unpkg.com/@citolab/qti-components/cdn";
9277
- const defaultComponentsCssUrl = isLocalhost ? `${window.location.origin}/dist/item.css` : "https://unpkg.com/@citolab/qti-components@latest/dist/item.css";
9278
- const componentsCdnUrl = this.dataset.componentsCdnUrl || defaultComponentsCdnUrl;
9279
- const componentsCssUrl = this.dataset.componentsCssUrl || defaultComponentsCssUrl;
9463
+ const componentsCdnUrl = this.dataset.componentsCdnUrl;
9464
+ const componentsCssUrl = this.dataset.componentsCssUrl;
9465
+ const requireJsTag = this.requireJsUrl ? `<script src="${this.requireJsUrl}"></script>` : `<script>${inlineScriptText(require_js_default)}</script>`;
9280
9466
  const fontStyles = `
9281
9467
  font-family: ${parentStyles.getPropertyValue("font-family")};
9282
9468
  font-size: ${parentStyles.getPropertyValue("font-size")};
@@ -9284,17 +9470,18 @@ var QtiPortableCustomInteraction = class extends Interaction {
9284
9470
  font-weight: ${parentStyles.getPropertyValue("font-weight")};
9285
9471
  color: ${parentStyles.getPropertyValue("color")};
9286
9472
  `;
9473
+ const langHost = this.closest("[lang], [xml\\:lang]");
9474
+ const iframeLang = [langHost?.getAttribute("lang"), langHost?.getAttribute("xml:lang"), document.documentElement.lang].map((l) => (l ?? "").trim()).find((l) => /^[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*$/.test(l)) ?? "en";
9287
9475
  return (
9288
9476
  /* html */
9289
9477
  `<!DOCTYPE html>
9290
- <html lang="en">
9478
+ <html lang="${iframeLang}">
9291
9479
  <head>
9292
9480
  <meta charset="utf-8" />
9293
9481
  <title>QTI PCI Container</title>
9294
9482
  <base href="${iframeBaseHref}" />
9295
- <script type="module">
9296
- import '${componentsCdnUrl}';
9297
- </script>
9483
+ ${componentsCdnUrl ? `<script type="module">import '${componentsCdnUrl}';</script>` : ""}
9484
+ <style>${inlineStyleText(native_css_default)}</style>
9298
9485
  <style>
9299
9486
  body, html {
9300
9487
  margin: 0;
@@ -9311,6 +9498,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
9311
9498
  }
9312
9499
  #pci-container {
9313
9500
  width: 100%;
9501
+ /* Keeps the first and last child's margins inside, so scrollHeight is the full height. */
9502
+ display: flow-root;
9314
9503
  }
9315
9504
  qti-interaction-markup {
9316
9505
  display: block;
@@ -9318,8 +9507,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
9318
9507
  min-height: 50px;
9319
9508
  }
9320
9509
  </style>
9321
- <link href="${componentsCssUrl}" rel="stylesheet" />
9322
- <script src="${this.requireJsUrl}"></script>
9510
+ ${componentsCssUrl ? `<link href="${componentsCssUrl}" rel="stylesheet" />` : ""}
9511
+ ${requireJsTag}
9323
9512
  <script>
9324
9513
  const forwardConsole = ${forwardConsole ? "true" : "false"};
9325
9514
  if (forwardConsole) {
@@ -10064,7 +10253,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
10064
10253
  let previousHeight = 0;
10065
10254
  const notifyResize = () => {
10066
10255
  const container = document.getElementById('pci-container');
10067
- const newHeight = container.scrollHeight + 100;
10256
+ // The content's own height (subpixel, rounded up) or what overflows it, e.g. an open popup.
10257
+ const newHeight = Math.max(Math.ceil(container.getBoundingClientRect().height), container.scrollHeight);
10068
10258
  if (newHeight !== previousHeight) {
10069
10259
  previousHeight = newHeight;
10070
10260
  clearTimeout(resizeTimeout);
@@ -10234,42 +10424,42 @@ var QtiPortableCustomInteraction = class extends Interaction {
10234
10424
  `;
10235
10425
  }
10236
10426
  };
10237
- __decorate24([
10427
+ __decorate25([
10238
10428
  property23({ type: String, attribute: "module" })
10239
10429
  ], QtiPortableCustomInteraction.prototype, "module", void 0);
10240
- __decorate24([
10430
+ __decorate25([
10241
10431
  property23({ type: String, attribute: "custom-interaction-type-identifier" })
10242
10432
  ], QtiPortableCustomInteraction.prototype, "customInteractionTypeIdentifier", void 0);
10243
- __decorate24([
10433
+ __decorate25([
10244
10434
  property23({ type: String, attribute: "data-require-paths" })
10245
10435
  ], QtiPortableCustomInteraction.prototype, "requirePathsJson", void 0);
10246
- __decorate24([
10436
+ __decorate25([
10247
10437
  property23({ type: String, attribute: "data-require-shim" })
10248
10438
  ], QtiPortableCustomInteraction.prototype, "requireShimJson", void 0);
10249
- __decorate24([
10439
+ __decorate25([
10250
10440
  property23({ type: String, attribute: "data-require-js-url" })
10251
10441
  ], QtiPortableCustomInteraction.prototype, "requireJsUrl", void 0);
10252
- __decorate24([
10442
+ __decorate25([
10253
10443
  property23({ type: String, attribute: "data-base-url" })
10254
10444
  ], QtiPortableCustomInteraction.prototype, "baseUrl", void 0);
10255
- __decorate24([
10445
+ __decorate25([
10256
10446
  property23({ type: Boolean, attribute: "data-use-default-paths" })
10257
10447
  ], QtiPortableCustomInteraction.prototype, "useDefaultPaths", void 0);
10258
- __decorate24([
10448
+ __decorate25([
10259
10449
  property23({ type: String, attribute: "data-status" })
10260
10450
  ], QtiPortableCustomInteraction.prototype, "status", void 0);
10261
- __decorate24([
10262
- state12()
10451
+ __decorate25([
10452
+ state13()
10263
10453
  ], QtiPortableCustomInteraction.prototype, "_errorMessage", void 0);
10264
- __decorate24([
10454
+ __decorate25([
10265
10455
  consume6({ context: itemContext, subscribe: true }),
10266
- state12()
10456
+ state13()
10267
10457
  ], QtiPortableCustomInteraction.prototype, "context", void 0);
10268
- __decorate24([
10458
+ __decorate25([
10269
10459
  consume6({ context: qtiContext, subscribe: true }),
10270
- state12()
10460
+ state13()
10271
10461
  ], QtiPortableCustomInteraction.prototype, "qtiContext", void 0);
10272
- __decorate24([
10462
+ __decorate25([
10273
10463
  property23({ attribute: "response", reflect: false, converter: responseAttributeConverter({ emptyAs: null }) })
10274
10464
  ], QtiPortableCustomInteraction.prototype, "response", void 0);
10275
10465
 
@@ -10366,7 +10556,7 @@ var QtiPositionObjectStage = class extends LitElement13 {
10366
10556
 
10367
10557
  // ../interactions/select-point-interaction/dist/qti-select-point-interaction.js
10368
10558
  import { html as html29, nothing as nothing4 } from "lit";
10369
- import { property as property24, state as state13 } from "lit/decorators.js";
10559
+ import { property as property24, state as state14 } from "lit/decorators.js";
10370
10560
  import { repeat as repeat7 } from "lit/directives/repeat.js";
10371
10561
  import { styleMap } from "lit/directives/style-map.js";
10372
10562
 
@@ -10378,8 +10568,14 @@ var qti_select_point_interaction_styles_default = [
10378
10568
  :host {
10379
10569
  display: block;
10380
10570
  --qti-select-point-marker-size: 1.5rem;
10381
- --qti-select-point-marker-anchor: -100%;
10382
- --qti-select-point-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z'/%3E%3C/svg%3E");
10571
+ /* Where the marker's shape points: -100% stands it on the point by its bottom (a pin's tip),
10572
+ -50% centres it (a ring, a star). A theme that changes the shape sets --cito-marker-anchor. */
10573
+ --qti-select-point-marker-anchor: var(--cito-marker-anchor, -100%);
10574
+ /* The marker's shape: a pin by default, or the theme's --cito-icon-marker (a mask). */
10575
+ --qti-select-point-icon: var(
10576
+ --cito-icon-marker,
10577
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z'/%3E%3C/svg%3E")
10578
+ );
10383
10579
  }
10384
10580
  point-container {
10385
10581
  display: block;
@@ -10405,6 +10601,26 @@ var qti_select_point_interaction_styles_default = [
10405
10601
  background: transparent;
10406
10602
  color: inherit;
10407
10603
  cursor: pointer;
10604
+
10605
+ /*
10606
+ * A halo round the marker, so it stands out on any picture: white round a dark marker, black
10607
+ * round a light one. Derived from the marker colour by its lightness (relative colour
10608
+ * syntax), so setting one colour sets both; --qti-select-point-halo overrides it.
10609
+ *
10610
+ * The halo is two drop-shadows on this element, which hug the shape drawn by ::before. It
10611
+ * cannot sit on the masked shape itself: a mask clips its own element's filter away.
10612
+ */
10613
+ --qti-select-point-halo-auto: oklch(
10614
+ from var(--qti-select-point-marker-color, currentColor) clamp(0, (0.7 - l) * 1000, 1) 0 0
10615
+ );
10616
+ filter: drop-shadow(0 0 1px var(--qti-select-point-halo, var(--qti-select-point-halo-auto)))
10617
+ drop-shadow(0 0 1px var(--qti-select-point-halo, var(--qti-select-point-halo-auto)));
10618
+ }
10619
+
10620
+ [part~='point']::before {
10621
+ content: '';
10622
+ position: absolute;
10623
+ inset: 0;
10408
10624
  background-color: var(--qti-select-point-marker-color, currentColor);
10409
10625
  -webkit-mask: var(--qti-select-point-icon) no-repeat center / contain;
10410
10626
  mask: var(--qti-select-point-icon) no-repeat center / contain;
@@ -10413,7 +10629,7 @@ var qti_select_point_interaction_styles_default = [
10413
10629
  ];
10414
10630
 
10415
10631
  // ../interactions/select-point-interaction/dist/qti-select-point-interaction.js
10416
- var __decorate25 = function(decorators, target, key, desc) {
10632
+ var __decorate26 = function(decorators, target, key, desc) {
10417
10633
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10418
10634
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10419
10635
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -10594,6 +10810,7 @@ var QtiSelectPointInteraction = class extends Interaction {
10594
10810
  this.#imgElement = this.querySelector("img");
10595
10811
  if (this.#imgElement) {
10596
10812
  this.#calculateScale();
10813
+ this.requestUpdate();
10597
10814
  this.#imgElement.addEventListener("click", this.#onImageClick);
10598
10815
  } else {
10599
10816
  console.warn("No <img> element found in <qti-select-point-interaction>");
@@ -10607,19 +10824,19 @@ var QtiSelectPointInteraction = class extends Interaction {
10607
10824
  }
10608
10825
  }
10609
10826
  };
10610
- __decorate25([
10827
+ __decorate26([
10611
10828
  property24({
10612
10829
  type: Number,
10613
10830
  attribute: "max-choices"
10614
10831
  })
10615
10832
  ], QtiSelectPointInteraction.prototype, "maxChoices", void 0);
10616
- __decorate25([
10833
+ __decorate26([
10617
10834
  property24({
10618
10835
  type: Number,
10619
10836
  attribute: "min-choices"
10620
10837
  })
10621
10838
  ], QtiSelectPointInteraction.prototype, "minChoices", void 0);
10622
- __decorate25([
10839
+ __decorate26([
10623
10840
  property24({
10624
10841
  attribute: "response",
10625
10842
  reflect: false,
@@ -10636,13 +10853,13 @@ __decorate25([
10636
10853
  }
10637
10854
  })
10638
10855
  ], QtiSelectPointInteraction.prototype, "response", void 0);
10639
- __decorate25([
10856
+ __decorate26([
10640
10857
  property24({ attribute: "area-mappings" })
10641
10858
  ], QtiSelectPointInteraction.prototype, "areaMappings", void 0);
10642
- __decorate25([
10643
- state13()
10859
+ __decorate26([
10860
+ state14()
10644
10861
  ], QtiSelectPointInteraction.prototype, "_areaEntries", void 0);
10645
- __decorate25([
10862
+ __decorate26([
10646
10863
  watch("areaMappings")
10647
10864
  ], QtiSelectPointInteraction.prototype, "_handleAreaMappingsChange", void 0);
10648
10865
 
@@ -10726,7 +10943,7 @@ var qti_slider_interaction_styles_default = [
10726
10943
  ];
10727
10944
 
10728
10945
  // ../interactions/slider-interaction/dist/qti-slider-interaction.js
10729
- var __decorate26 = function(decorators, target, key, desc) {
10946
+ var __decorate27 = function(decorators, target, key, desc) {
10730
10947
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10731
10948
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10732
10949
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -10866,19 +11083,19 @@ var QtiSliderInteraction = class extends Interaction {
10866
11083
  this.dispatchEvent(new Event("change", { bubbles: true }));
10867
11084
  }
10868
11085
  };
10869
- __decorate26([
11086
+ __decorate27([
10870
11087
  query2("#rail")
10871
11088
  ], QtiSliderInteraction.prototype, "_rail", void 0);
10872
- __decorate26([
11089
+ __decorate27([
10873
11090
  property25({ type: Number, attribute: "lower-bound" })
10874
11091
  ], QtiSliderInteraction.prototype, "min", void 0);
10875
- __decorate26([
11092
+ __decorate27([
10876
11093
  property25({ type: Number, attribute: "upper-bound" })
10877
11094
  ], QtiSliderInteraction.prototype, "max", void 0);
10878
- __decorate26([
11095
+ __decorate27([
10879
11096
  property25({ type: Number, attribute: "step" })
10880
11097
  ], QtiSliderInteraction.prototype, "step", void 0);
10881
- __decorate26([
11098
+ __decorate27([
10882
11099
  property25({ attribute: "response", reflect: false, noAccessor: true })
10883
11100
  ], QtiSliderInteraction.prototype, "response", null);
10884
11101
 
@@ -10985,7 +11202,7 @@ var qti_text_entry_interaction_styles_default = [
10985
11202
  ];
10986
11203
 
10987
11204
  // ../interactions/text-entry-interaction/dist/qti-text-entry-interaction.js
10988
- var __decorate27 = function(decorators, target, key, desc) {
11205
+ var __decorate28 = function(decorators, target, key, desc) {
10989
11206
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10990
11207
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10991
11208
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -11092,25 +11309,25 @@ var QtiTextEntryInteraction = class extends Interaction {
11092
11309
  this.response = "";
11093
11310
  }
11094
11311
  };
11095
- __decorate27([
11312
+ __decorate28([
11096
11313
  property26({ type: Number, attribute: "expected-length" })
11097
11314
  ], QtiTextEntryInteraction.prototype, "expectedLength", void 0);
11098
- __decorate27([
11315
+ __decorate28([
11099
11316
  property26({ type: String, attribute: "pattern-mask" })
11100
11317
  ], QtiTextEntryInteraction.prototype, "patternMask", void 0);
11101
- __decorate27([
11318
+ __decorate28([
11102
11319
  property26({ type: String, attribute: "placeholder-text" })
11103
11320
  ], QtiTextEntryInteraction.prototype, "placeholderText", void 0);
11104
- __decorate27([
11321
+ __decorate28([
11105
11322
  property26({ type: String, attribute: "data-patternmask-message" })
11106
11323
  ], QtiTextEntryInteraction.prototype, "dataPatternmaskMessage", void 0);
11107
- __decorate27([
11324
+ __decorate28([
11108
11325
  property26({ type: String, attribute: "response", reflect: false })
11109
11326
  ], QtiTextEntryInteraction.prototype, "response", void 0);
11110
- __decorate27([
11327
+ __decorate28([
11111
11328
  query3("input")
11112
11329
  ], QtiTextEntryInteraction.prototype, "_input", void 0);
11113
- __decorate27([
11330
+ __decorate28([
11114
11331
  watch("response", { waitUntilFirstUpdate: true })
11115
11332
  ], QtiTextEntryInteraction.prototype, "_handleValueChange", void 0);
11116
11333
 
@@ -11170,7 +11387,13 @@ var QtiUploadInteraction = class extends Interaction {
11170
11387
  return html32`
11171
11388
  <div>
11172
11389
  <slot name="prompt"></slot>
11173
- <input type="file" @change="${this.#onFileChange}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" />
11390
+ <input
11391
+ type="file"
11392
+ part="input"
11393
+ @change="${this.#onFileChange}"
11394
+ ?disabled="${this.disabled}"
11395
+ ?readonly="${this.readonly}"
11396
+ />
11174
11397
  </div>
11175
11398
  `;
11176
11399
  }
@@ -11819,6 +12042,8 @@ export {
11819
12042
  elements24 as elements14,
11820
12043
  QtiOrderInteraction,
11821
12044
  elements25 as elements15,
12045
+ inlineScriptText,
12046
+ inlineStyleText,
11822
12047
  QtiPortableCustomInteraction,
11823
12048
  elements26 as elements16,
11824
12049
  QtiPositionObjectInteraction,
@@ -11834,4 +12059,4 @@ export {
11834
12059
  elements31 as elements21,
11835
12060
  qtiInteractionElements
11836
12061
  };
11837
- //# sourceMappingURL=chunk-RSMYGGQK.js.map
12062
+ //# sourceMappingURL=chunk-O76BOKAP.js.map