@pie-element/ebsr 14.2.2-next.0 → 14.2.2-next.10

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 (190) hide show
  1. package/dist/author/defaults.d.ts +284 -2
  2. package/dist/author/defaults.js +1 -1
  3. package/dist/author/index.js +24 -22
  4. package/dist/author/main.d.ts +1 -0
  5. package/dist/author/main.js +72 -70
  6. package/dist/browser/author/index.js +41058 -12238
  7. package/dist/browser/author/index.js.map +1 -1
  8. package/dist/browser/controller/index.js +90 -268
  9. package/dist/browser/controller/index.js.map +1 -1
  10. package/dist/browser/delivery/index.js +26 -26
  11. package/dist/browser/delivery/index.js.map +1 -1
  12. package/dist/browser/delivery-DM01fVuQ.js +1290 -0
  13. package/dist/browser/delivery-DM01fVuQ.js.map +1 -0
  14. package/dist/browser/dist-CHbLnyuX.js +111 -0
  15. package/dist/browser/dist-CHbLnyuX.js.map +1 -0
  16. package/dist/browser/{dist-D9ARZhQk.js → dist-DiGNNRzu.js} +2 -2
  17. package/dist/browser/{dist-D9ARZhQk.js.map → dist-DiGNNRzu.js.map} +1 -1
  18. package/dist/browser/ebsr.css +2 -0
  19. package/dist/browser/print/index.js +27 -28
  20. package/dist/browser/print/index.js.map +1 -1
  21. package/dist/browser/private-tags-Z0nu6DO5.js +9590 -0
  22. package/dist/browser/private-tags-Z0nu6DO5.js.map +1 -0
  23. package/dist/controller/index.js +29 -30
  24. package/dist/controller/utils.d.ts +1 -1
  25. package/dist/controller/utils.js +2 -2
  26. package/dist/delivery/index.js +25 -24
  27. package/dist/index.iife.js +37 -37
  28. package/dist/print/index.js +32 -32
  29. package/dist/private-tags.d.ts +2 -0
  30. package/dist/private-tags.js +3 -0
  31. package/dist/runtime-support.d.ts +12 -0
  32. package/dist/runtime-support.js +12 -0
  33. package/module/print.js +18298 -0
  34. package/module/print.js.map +1 -0
  35. package/package.json +27 -10
  36. package/print.js +2 -0
  37. package/dist/browser/_Uint8Array-fRN8Lsus.js +0 -193
  38. package/dist/browser/_Uint8Array-fRN8Lsus.js.map +0 -1
  39. package/dist/browser/browser-CdX8WGiZ.js +0 -207
  40. package/dist/browser/browser-CdX8WGiZ.js.map +0 -1
  41. package/dist/browser/cloneDeep-o_mWij0W.js +0 -251
  42. package/dist/browser/cloneDeep-o_mWij0W.js.map +0 -1
  43. package/dist/browser/dist-DQkngCcw.js +0 -36
  44. package/dist/browser/dist-DQkngCcw.js.map +0 -1
  45. package/dist/browser/get-BfBCyZ1r.js +0 -333
  46. package/dist/browser/get-BfBCyZ1r.js.map +0 -1
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +0 -10
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +0 -12
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +0 -16
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js +0 -8
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
  186. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
  187. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
  188. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
  189. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
  190. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
@@ -1,7 +1,6 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js";
2
- import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
3
- import n from "./defaults.js";
4
- import { isResponseCorrect as r } from "./utils.js";
1
+ import e from "./defaults.js";
2
+ import { isResponseCorrect as t } from "./utils.js";
3
+ import { get as n, isEmpty as r } from "@pie-element/shared-lodash";
5
4
  import { getShuffledChoices as i, lockChoices as a, partialScoring as o } from "@pie-element/shared-controller-utils";
6
5
  import s from "@pie-lib/translator";
7
6
  //#region src/controller/index.ts
@@ -15,7 +14,7 @@ var { translator: c } = s, l = (e, t, n) => (r) => {
15
14
  e === "default" ? i.feedback = n[r.correct ? "correct" : "incorrect"] : e === "custom" && (i.feedback = r.feedback.value);
16
15
  }
17
16
  return i;
18
- }, u = (e, t, n, i) => {
17
+ }, u = (e, n, r, i) => {
19
18
  let a = Object.assign({
20
19
  correct: "Correct",
21
20
  incorrect: "Incorrect"
@@ -25,31 +24,31 @@ var { translator: c } = s, l = (e, t, n) => (r) => {
25
24
  choices: o,
26
25
  disabled: i.mode !== "gather",
27
26
  complete: { min: e.choices.filter((e) => e.correct).length },
28
- responseCorrect: i.mode === "evaluate" ? r(e, t, n) : void 0
27
+ responseCorrect: i.mode === "evaluate" ? t(e, n, r) : void 0
29
28
  };
30
29
  }, d = (e, t) => ({
31
30
  ...t,
32
31
  ...e,
33
32
  choicesLayout: e.choicesLayout || e.verticalMode === !1 && "horizontal" || "vertical"
34
- }), f = ({ partA: e = {}, partB: t = {}, language: r, ...i }) => ({
35
- ...n,
33
+ }), f = ({ partA: t = {}, partB: n = {}, language: r, ...i }) => ({
34
+ ...e,
36
35
  ...i,
37
- partA: d(e, {
38
- ...n.partA,
36
+ partA: d(t, {
37
+ ...e.partA,
39
38
  language: r
40
39
  }),
41
- partB: d(t, {
42
- ...n.partB,
40
+ partB: d(n, {
41
+ ...e.partB,
43
42
  language: r
44
43
  })
45
44
  });
46
- async function p(n, r, o, s) {
47
- let l = f(n), d = u(l.partA, "partA", r, o), p = u(l.partB, "partB", r, o), m = {}, h = (e) => (t, n, r) => new Promise((t) => {
45
+ async function p(e, t, o, s) {
46
+ let l = f(e), d = u(l.partA, "partA", t, o), p = u(l.partB, "partB", t, o), m = {}, h = (e) => (t, n, r) => new Promise((t) => {
48
47
  m[e] = r.shuffledValues, t();
49
- }), g = e(r, "value.partA"), _ = a(l.partA, g, o), { choices: v } = d || {}, { choices: y } = p || {};
50
- !_ && v && v.length && (d.choices = await i(v, { shuffledValues: (r.shuffledValues || {}).partA }, h("partA"), "value"));
51
- let b = e(r, "value.partB");
52
- if (!a(l.partB, b, o) && y && y.length && (p.choices = await i(y, { shuffledValues: (r.shuffledValues || {}).partB }, h("partB"), "value")), t(m) || s && typeof s == "function" && s(r.id, r.element, { shuffledValues: m }).catch((e) => {
48
+ }), g = n(t, "value.partA"), _ = a(l.partA, g, o), { choices: v } = d || {}, { choices: y } = p || {};
49
+ !_ && v && v.length && (d.choices = await i(v, { shuffledValues: (t.shuffledValues || {}).partA }, h("partA"), "value"));
50
+ let b = n(t, "value.partB");
51
+ if (!a(l.partB, b, o) && y && y.length && (p.choices = await i(y, { shuffledValues: (t.shuffledValues || {}).partB }, h("partB"), "value")), r(m) || s && typeof s == "function" && s(t.id, t.element, { shuffledValues: m }).catch((e) => {
53
52
  console.error("update session failed", e);
54
53
  }), l.partLabels) {
55
54
  let e = l.language;
@@ -71,10 +70,10 @@ async function p(n, r, o, s) {
71
70
  });
72
71
  });
73
72
  }
74
- var m = (e = {}) => new Promise((t) => {
75
- t({
76
- ...n,
77
- ...e
73
+ var m = (t = {}) => new Promise((n) => {
74
+ n({
75
+ ...e,
76
+ ...t
78
77
  });
79
78
  }), h = (e) => e.correct === !0, g = (e, t, n, r) => {
80
79
  let { choices: i = [] } = e && e[n] || {}, a = i.length, { value: o } = t || {}, s = (e) => !!(o || []).find((t) => t === e.value), c = (e) => h(e) && !s(e), l = (e) => !h(e) && s(e), u = i.reduce((e, t) => c(t) || l(t) ? e - 1 : e, i.length);
@@ -165,16 +164,16 @@ var y = (e) => {
165
164
  id: "1"
166
165
  });
167
166
  } else n(null);
168
- }), x = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), S = (e = {}, n = {}) => {
169
- let { choices: r } = e, { minAnswerChoices: i = 2, maxAnswerChoices: a } = n, o = [...r || []].reverse(), s = {}, c = {}, l = {}, u = !1;
170
- ["teacherInstructions", "prompt"].forEach((t) => {
171
- n[t]?.required && !x(e[t]) && (s[t] = "This field is required.");
172
- }), o.forEach((e, t) => {
167
+ }), x = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), S = (e = {}, t = {}) => {
168
+ let { choices: n } = e, { minAnswerChoices: i = 2, maxAnswerChoices: a } = t, o = [...n || []].reverse(), s = {}, c = {}, l = {}, u = !1;
169
+ ["teacherInstructions", "prompt"].forEach((n) => {
170
+ t[n]?.required && !x(e[n]) && (s[n] = "This field is required.");
171
+ }), o.forEach((e, n) => {
173
172
  let { correct: r, value: i, label: a, rationale: s } = e;
174
- r && (u = !0), x(a) ? o.slice(t + 1).some((e) => e.label === a) && (c[i] = "Content should be unique.") : c[i] = "Content should not be empty.", n.rationale?.required && !x(s) && (l[i] = "This field is required.");
173
+ r && (u = !0), x(a) ? o.slice(n + 1).some((e) => e.label === a) && (c[i] = "Content should be unique.") : c[i] = "Content should not be empty.", t.rationale?.required && !x(s) && (l[i] = "This field is required.");
175
174
  });
176
- let d = (r || []).length;
177
- return d < i ? s.answerChoices = `There should be at least ${i} choices defined.` : d > a && (s.answerChoices = `No more than ${a} choices should be defined.`), u || (s.correctResponse = "No correct response defined."), t(c) || (s.choices = c), t(l) || (s.rationale = l), s;
175
+ let d = (n || []).length;
176
+ return d < i ? s.answerChoices = `There should be at least ${i} choices defined.` : d > a && (s.answerChoices = `No more than ${a} choices should be defined.`), u || (s.correctResponse = "No correct response defined."), r(c) || (s.choices = c), r(l) || (s.rationale = l), s;
178
177
  }, C = (e = {}, t = {}) => {
179
178
  let { partA: n, partB: r } = e || {}, { partA: i, partB: a } = t || {};
180
179
  return {
@@ -7,4 +7,4 @@
7
7
  * To make changes, edit the upstream JavaScript file and run sync again.
8
8
  */
9
9
  export declare const getCorrectResponse: (choices: any) => any;
10
- export declare const isResponseCorrect: (question: any, key: any, session: any) => any;
10
+ export declare const isResponseCorrect: (question: any, key: any, session: any) => boolean;
@@ -1,8 +1,8 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js";
1
+ import { isEqual as e } from "@pie-element/shared-lodash";
2
2
  //#region src/controller/utils.ts
3
3
  var t = (e) => e && e.filter((e) => e.correct).map((e) => e.value).sort(), n = (n, r, i) => {
4
4
  let a = t(n.choices);
5
5
  return i && i.value ? e((i.value[r].value || []).sort(), a) : !1;
6
6
  };
7
7
  //#endregion
8
- export { n as isResponseCorrect };
8
+ export { t as getCorrectResponse, n as isResponseCorrect };
@@ -1,15 +1,16 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js";
1
+ import { EBSR_MULTIPLE_CHOICE_TAG as e } from "../private-tags.js";
2
2
  import { SessionChangedEvent as t } from "@pie-element/shared-player-events";
3
3
  import n from "@pie-element/multiple-choice";
4
- import r from "debug";
4
+ import { get as r } from "@pie-element/shared-lodash";
5
+ import i from "debug";
5
6
  //#region src/delivery/index.tsx
6
- var i = t.TYPE, a = "ebsr-multiple-choice", o = r("pie-elements:ebsr"), s = class extends n {};
7
- customElements.get(a) || customElements.define(a, s);
8
- var c = (e) => Array.isArray(e) && e.length > 0, l = (t) => {
9
- let n = e(t, "value.partA.value"), r = e(t, "value.partB.value");
10
- return c(n) && c(r);
7
+ var a = t.TYPE, o = e, s = i("pie-elements:ebsr"), c = class extends n {};
8
+ customElements.get(o) || customElements.define(o, c);
9
+ var l = (e) => Array.isArray(e) && e.length > 0, u = (e) => {
10
+ let t = r(e, "value.partA.value"), n = r(e, "value.partB.value");
11
+ return l(t) && l(n);
11
12
  };
12
- function u(e) {
13
+ function d(e) {
13
14
  let t = e.closest("pie-player") || e.closest("pie-item-player");
14
15
  if (!t) return {
15
16
  baseHeadingLevel: void 0,
@@ -21,10 +22,10 @@ function u(e) {
21
22
  }, r = n("baseHeadingLevel", "base-heading-level", "baseheadinglevel"), i = parseInt(r, 10), a = Number.isFinite(i) && i >= 1 && i <= 6 ? i : void 0, o = n("includeSrHeading", "include-sr-heading", "includesrheading");
22
23
  return {
23
24
  baseHeadingLevel: a,
24
- includeSrHeading: o == null ? !0 : o !== !1 && o !== "false"
25
+ includeSrHeading: o == null || o !== !1 && o !== "false"
25
26
  };
26
27
  }
27
- var d = class extends HTMLElement {
28
+ var f = class extends HTMLElement {
28
29
  constructor() {
29
30
  super(), this._model = {}, this._session = {};
30
31
  }
@@ -38,12 +39,12 @@ var d = class extends HTMLElement {
38
39
  }
39
40
  };
40
41
  set model(e) {
41
- this._model = e, customElements.whenDefined(a).then(() => {
42
+ this._model = e, customElements.whenDefined(o).then(() => {
42
43
  this.setPartModel(this.partA, "partA"), this.setPartModel(this.partB, "partB");
43
44
  });
44
45
  }
45
46
  set session(e) {
46
- this._session = e, customElements.whenDefined(a).then(() => {
47
+ this._session = e, customElements.whenDefined(o).then(() => {
47
48
  this.setPartSession(this.partA, "partA"), this.setPartSession(this.partB, "partB");
48
49
  });
49
50
  }
@@ -58,7 +59,7 @@ var d = class extends HTMLElement {
58
59
  mode: n,
59
60
  keyMode: this._model[t].choicePrefix
60
61
  };
61
- let { includeSrHeading: r, baseHeadingLevel: i } = u(this);
62
+ let { includeSrHeading: r, baseHeadingLevel: i } = d(this);
62
63
  e.includeSrHeading = r, e.baseHeadingLevel = i;
63
64
  }
64
65
  }
@@ -72,21 +73,21 @@ var d = class extends HTMLElement {
72
73
  this._session.value = {
73
74
  ...this._session.value,
74
75
  [n]: e
75
- }, o("[onSessionChanged] session: ", this._session);
76
- let r = l(this._session);
76
+ }, s("[onSessionChanged] session: ", this._session);
77
+ let r = u(this._session);
77
78
  this.dispatchEvent(new t(this.tagName.toLowerCase(), r));
78
79
  }
79
80
  get partA() {
80
- return this.querySelector(`${a}#a`);
81
+ return this.querySelector(`${o}#a`);
81
82
  }
82
83
  get partB() {
83
- return this.querySelector(`${a}#b`);
84
+ return this.querySelector(`${o}#b`);
84
85
  }
85
86
  connectedCallback() {
86
- this._render(), this._initPlayerObserver(), this.addEventListener(i, this.onSessionUpdated);
87
+ this._render(), this._initPlayerObserver(), this.addEventListener(a, this.onSessionUpdated);
87
88
  }
88
89
  disconnectedCallback() {
89
- this._disconnectPlayerObserver(), this.removeEventListener(i, this.onSessionUpdated);
90
+ this._disconnectPlayerObserver(), this.removeEventListener(a, this.onSessionUpdated);
90
91
  }
91
92
  _initPlayerObserver() {
92
93
  let e = this.closest("pie-player") || this.closest("pie-item-player");
@@ -107,7 +108,7 @@ var d = class extends HTMLElement {
107
108
  }
108
109
  _render() {
109
110
  this.ariaLabel = "Two-Part Question", this.role = "region";
110
- let { baseHeadingLevel: e, includeSrHeading: t } = u(this), n = e ? `h${Math.min(6, e)}` : "h2", r = t ? `<${n} class="srOnly">Two-Part Question</${n}>` : "";
111
+ let { baseHeadingLevel: e, includeSrHeading: t } = d(this), n = e ? `h${Math.min(6, e)}` : "h2", r = t ? `<${n} class="srOnly">Two-Part Question</${n}>` : "";
111
112
  this.innerHTML = `
112
113
  <style>
113
114
  .srOnly {
@@ -123,10 +124,10 @@ var d = class extends HTMLElement {
123
124
  ${this._model?.extraCSSRules?.rules}
124
125
  </style>
125
126
  ${r}
126
- <${a} id="a"></${a}>
127
- <${a} id="b"></${a}>
128
- `, customElements.get(a) && (this.setPartModel(this.partA, "partA"), this.setPartModel(this.partB, "partB"), this.setPartSession(this.partA, "partA"), this.setPartSession(this.partB, "partB"));
127
+ <${o} id="a"></${o}>
128
+ <${o} id="b"></${o}>
129
+ `, customElements.get(o) && (this.setPartModel(this.partA, "partA"), this.setPartModel(this.partB, "partB"), this.setPartSession(this.partA, "partA"), this.setPartSession(this.partB, "partB"));
129
130
  }
130
131
  };
131
132
  //#endregion
132
- export { d as default, l as isSessionComplete };
133
+ export { f as default, u as isSessionComplete };