@pie-element/placement-ordering 14.1.1-next.11 → 14.1.2-next.0

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 (306) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/choice-editor.d.ts +39 -0
  4. package/dist/author/choice-editor.js +157 -0
  5. package/dist/author/choice-tile.d.ts +40 -0
  6. package/dist/author/choice-tile.js +132 -0
  7. package/dist/author/defaults.d.ts +213 -0
  8. package/dist/author/defaults.js +159 -0
  9. package/dist/author/design.d.ts +21 -0
  10. package/dist/author/design.js +274 -0
  11. package/dist/author/help.d.ts +11 -0
  12. package/dist/author/index.d.ts +45 -0
  13. package/dist/author/index.js +85 -0
  14. package/dist/author/utils.d.ts +15 -0
  15. package/dist/author/utils.js +62 -0
  16. package/dist/browser/author/index.js +40986 -0
  17. package/dist/browser/author/index.js.map +1 -0
  18. package/dist/browser/browser-CvJkn_Ec.js +1019 -0
  19. package/dist/browser/browser-CvJkn_Ec.js.map +1 -0
  20. package/dist/browser/controller/index.js +319 -0
  21. package/dist/browser/controller/index.js.map +1 -0
  22. package/dist/browser/delivery/index.js +1032 -0
  23. package/dist/browser/delivery/index.js.map +1 -0
  24. package/dist/browser/dist-BTHiIs74.js +1610 -0
  25. package/dist/browser/dist-BTHiIs74.js.map +1 -0
  26. package/dist/browser/drag-provider-DaPxkh4j.js +10833 -0
  27. package/dist/browser/drag-provider-DaPxkh4j.js.map +1 -0
  28. package/dist/browser/last-D7N4Qfx4.js +9 -0
  29. package/dist/browser/last-D7N4Qfx4.js.map +1 -0
  30. package/dist/browser/placement-ordering.css +2 -0
  31. package/dist/controller/defaults.d.ts +31 -0
  32. package/dist/controller/defaults.js +25 -0
  33. package/dist/controller/index.d.ts +29 -0
  34. package/dist/controller/index.js +128 -0
  35. package/dist/controller/scoring.d.ts +27 -0
  36. package/dist/controller/scoring.js +32 -0
  37. package/dist/delivery/index.d.ts +26 -0
  38. package/dist/delivery/index.js +70 -0
  39. package/dist/delivery/main.d.ts +19 -0
  40. package/dist/delivery/main.js +22 -0
  41. package/dist/delivery/ordering.d.ts +18 -0
  42. package/dist/delivery/ordering.js +96 -0
  43. package/dist/delivery/placement-ordering.d.ts +28 -0
  44. package/dist/delivery/placement-ordering.js +215 -0
  45. package/dist/delivery/tile.d.ts +28 -0
  46. package/dist/delivery/tile.js +165 -0
  47. package/dist/delivery/tiler.d.ts +42 -0
  48. package/dist/delivery/tiler.js +89 -0
  49. package/dist/delivery/utils.d.ts +9 -0
  50. package/dist/delivery/utils.js +8 -0
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.iife.d.ts +8 -0
  53. package/dist/index.iife.js +152 -0
  54. package/dist/index.js +2 -0
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +6 -0
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +16 -0
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +16 -0
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +6 -0
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +16 -0
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +6 -0
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +6 -0
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +11 -0
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +14 -0
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +5 -0
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +6 -0
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +12 -0
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +7 -0
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEvery.js +7 -0
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +10 -0
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludes.js +7 -0
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludesWith.js +7 -0
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +7 -0
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +7 -0
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js +8 -0
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayShuffle.js +8 -0
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +7 -0
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +10 -0
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +8 -0
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +8 -0
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +8 -0
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +12 -0
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +57 -0
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +14 -0
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseDifference.js +23 -0
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js +6 -0
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEvery.js +10 -0
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +7 -0
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +13 -0
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +5 -0
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js +8 -0
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +10 -0
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +6 -0
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIndexOf.js +9 -0
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +8 -0
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +9 -0
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMatch.js +26 -0
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNaN.js +6 -0
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +9 -0
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIteratee.js +11 -0
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +12 -0
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMap.js +11 -0
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js +12 -0
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js +8 -0
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js +9 -0
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRandom.js +7 -0
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js +8 -0
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +9 -0
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +14 -0
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseShuffle.js +8 -0
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +15 -0
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js +27 -0
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseValues.js +9 -0
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +6 -0
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +10 -0
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +10 -0
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +8 -0
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +8 -0
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +8 -0
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +8 -0
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +14 -0
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +8 -0
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createAssigner.js +15 -0
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js +12 -0
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +12 -0
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js +9 -0
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +35 -0
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +35 -0
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +32 -0
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +9 -0
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +8 -0
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMatchData.js +16 -0
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +5 -0
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +10 -0
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +23 -0
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js +18 -0
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +7 -0
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +7 -0
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +13 -0
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +9 -0
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +9 -0
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +8 -0
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +33 -0
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +9 -0
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +10 -0
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +12 -0
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +11 -0
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +7 -0
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isStrictComparable.js +7 -0
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +6 -0
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +9 -0
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +8 -0
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +7 -0
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +8 -0
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +13 -0
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +7 -0
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +7 -0
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +8 -0
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +9 -0
  186. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
  187. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +11 -0
  188. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +5 -0
  189. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +5 -0
  190. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  191. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
  192. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
  193. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +8 -0
  194. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +13 -0
  195. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
  196. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +7 -0
  197. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +6 -0
  198. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +9 -0
  199. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +6 -0
  200. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +14 -0
  201. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shuffleSelf.js +12 -0
  202. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +7 -0
  203. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +7 -0
  204. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +6 -0
  205. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +6 -0
  206. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +16 -0
  207. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_strictIndexOf.js +7 -0
  208. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +10 -0
  209. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +10 -0
  210. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
  211. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/assign.js +16 -0
  212. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +8 -0
  213. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/compact.js +10 -0
  214. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +8 -0
  215. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +16 -0
  216. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/difference.js +10 -0
  217. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js +12 -0
  218. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
  219. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/every.js +12 -0
  220. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js +8 -0
  221. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +8 -0
  222. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +6 -0
  223. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
  224. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
  225. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
  226. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js +8 -0
  227. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
  228. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +21 -0
  229. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +7 -0
  230. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
  231. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
  232. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +7 -0
  233. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
  234. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
  235. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +7 -0
  236. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +9 -0
  237. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
  238. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +9 -0
  239. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
  240. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/last.js +7 -0
  241. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/map.js +10 -0
  242. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +16 -0
  243. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/noop.js +4 -0
  244. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/property.js +10 -0
  245. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js +12 -0
  246. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/shuffle.js +9 -0
  247. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +6 -0
  248. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
  249. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +7 -0
  250. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js +7 -0
  251. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js +9 -0
  252. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/values.js +8 -0
  253. package/package.json +83 -19
  254. package/CHANGELOG.json +0 -1312
  255. package/CHANGELOG.md +0 -2428
  256. package/LICENSE.md +0 -5
  257. package/README.md +0 -57
  258. package/configure/CHANGELOG.json +0 -952
  259. package/configure/CHANGELOG.md +0 -2123
  260. package/configure/lib/choice-editor.js +0 -252
  261. package/configure/lib/choice-editor.js.map +0 -1
  262. package/configure/lib/choice-tile.js +0 -205
  263. package/configure/lib/choice-tile.js.map +0 -1
  264. package/configure/lib/defaults.js +0 -211
  265. package/configure/lib/defaults.js.map +0 -1
  266. package/configure/lib/design.js +0 -427
  267. package/configure/lib/design.js.map +0 -1
  268. package/configure/lib/help.js +0 -14
  269. package/configure/lib/help.js.map +0 -1
  270. package/configure/lib/index.js +0 -155
  271. package/configure/lib/index.js.map +0 -1
  272. package/configure/lib/utils.js +0 -108
  273. package/configure/lib/utils.js.map +0 -1
  274. package/configure/package.json +0 -26
  275. package/controller/CHANGELOG.json +0 -517
  276. package/controller/CHANGELOG.md +0 -1514
  277. package/controller/lib/defaults.js +0 -29
  278. package/controller/lib/defaults.js.map +0 -1
  279. package/controller/lib/index.js +0 -285
  280. package/controller/lib/index.js.map +0 -1
  281. package/controller/lib/scoring.js +0 -109
  282. package/controller/lib/scoring.js.map +0 -1
  283. package/controller/package.json +0 -15
  284. package/docs/config-schema.json +0 -2964
  285. package/docs/config-schema.json.md +0 -2190
  286. package/docs/demo/config.js +0 -8
  287. package/docs/demo/generate.js +0 -50
  288. package/docs/demo/index.html +0 -1
  289. package/docs/demo/session.js +0 -7
  290. package/docs/pie-schema.json +0 -1613
  291. package/docs/pie-schema.json.md +0 -973
  292. package/icon.png +0 -0
  293. package/lib/index.js +0 -122
  294. package/lib/index.js.map +0 -1
  295. package/lib/main.js +0 -32
  296. package/lib/main.js.map +0 -1
  297. package/lib/ordering.js +0 -165
  298. package/lib/ordering.js.map +0 -1
  299. package/lib/placement-ordering.js +0 -419
  300. package/lib/placement-ordering.js.map +0 -1
  301. package/lib/tile.js +0 -259
  302. package/lib/tile.js.map +0 -1
  303. package/lib/tiler.js +0 -165
  304. package/lib/tiler.js.map +0 -1
  305. package/lib/utils.js +0 -18
  306. package/lib/utils.js.map +0 -1
@@ -0,0 +1,319 @@
1
+ import { R as e, V as t, X as n, b as r, c as i, i as a, l as o, n as s, ot as c, p as l, r as u, t as d, u as f } from "../browser-CvJkn_Ec.js";
2
+ import { a as p, i as ee, n as m, o as h, r as te, s as g, t as _ } from "../dist-BTHiIs74.js";
3
+ import { t as v } from "../last-D7N4Qfx4.js";
4
+ //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/noop.js
5
+ function y() {}
6
+ //#endregion
7
+ //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js
8
+ function b(e, t, n, r) {
9
+ var i = -1, a = e == null ? 0 : e.length;
10
+ for (r && a && (n = e[++i]); ++i < a;) n = t(n, e[i], i, e);
11
+ return n;
12
+ }
13
+ //#endregion
14
+ //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js
15
+ var x = t(function(e, t) {
16
+ var n = v(t);
17
+ return a(n) && (n = void 0), a(e) ? te(e, r(t, 1, a, !0), void 0, n) : [];
18
+ });
19
+ //#endregion
20
+ //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEvery.js
21
+ function S(e, t) {
22
+ for (var n = -1, r = e == null ? 0 : e.length; ++n < r;) if (!t(e[n], n, e)) return !1;
23
+ return !0;
24
+ }
25
+ //#endregion
26
+ //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEvery.js
27
+ function C(e, t) {
28
+ var n = !0;
29
+ return p(e, function(e, r, i) {
30
+ return n = !!t(e, r, i), n;
31
+ }), n;
32
+ }
33
+ //#endregion
34
+ //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/every.js
35
+ function w(t, r, i) {
36
+ var a = n(t) ? S : C;
37
+ return i && e(t, r, i) && (r = void 0), a(t, h(r, 3));
38
+ }
39
+ //#endregion
40
+ //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js
41
+ function T(e, t, n, r, i) {
42
+ return i(e, function(e, i, a) {
43
+ n = r ? (r = !1, e) : t(n, e, i, a);
44
+ }), n;
45
+ }
46
+ //#endregion
47
+ //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js
48
+ function E(e, t, r) {
49
+ var i = n(e) ? b : T, a = arguments.length < 3;
50
+ return i(e, h(t, 4), r, a, p);
51
+ }
52
+ //#endregion
53
+ //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js
54
+ var D = l && 1 / i(new l([, -0]))[1] == Infinity ? function(e) {
55
+ return new l(e);
56
+ } : y, O = 200;
57
+ function ne(e, t, n) {
58
+ var r = -1, a = g, s = e.length, c = !0, l = [], u = l;
59
+ if (n) c = !1, a = ee;
60
+ else if (s >= O) {
61
+ var d = t ? null : D(e);
62
+ if (d) return i(d);
63
+ c = !1, a = o, u = new f();
64
+ } else u = t ? [] : l;
65
+ outer: for (; ++r < s;) {
66
+ var p = e[r], m = t ? t(p) : p;
67
+ if (p = n || p !== 0 ? p : 0, c && m === m) {
68
+ for (var h = u.length; h--;) if (u[h] === m) continue outer;
69
+ t && u.push(m), l.push(p);
70
+ } else a(u, m, n) || (u !== l && u.push(m), l.push(p));
71
+ }
72
+ return l;
73
+ }
74
+ //#endregion
75
+ //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js
76
+ function k(e) {
77
+ return e && e.length ? ne(e) : [];
78
+ }
79
+ //#endregion
80
+ //#region ../../../node_modules/.bun/js-combinatorics@2.1.2/node_modules/js-combinatorics/combinatorics.js
81
+ function A(e, t) {
82
+ if (e < 0) throw RangeError(`${e} is out of range`);
83
+ if (t < 0) throw RangeError(`${t} is out of range`);
84
+ if (t == 0) return 1n;
85
+ if (e < t) return 0n;
86
+ let [n, r, i] = [
87
+ BigInt(e),
88
+ BigInt(t),
89
+ 1n
90
+ ];
91
+ for (; r--;) i *= n--;
92
+ return i;
93
+ }
94
+ function j(e, t) {
95
+ return t == 0 || e == t ? 1n : e < t ? 0n : A(e, t) / A(t, t);
96
+ }
97
+ var M = typeof crypto < "u" ? crypto : {};
98
+ typeof M.randomBytes == "function" || M.getRandomValues;
99
+ //#endregion
100
+ //#region src/controller/scoring.ts
101
+ var N = /* @__PURE__ */ c(d(), 1), P = (0, N.default)("pie-elements:placement-ordering:controller"), F = (e) => /* @__PURE__ */ Error(`Cant score answer: ${e} it has duplicates and allowDuplicates is false`), I = (e, t, n) => {
102
+ if (n = {
103
+ allowDuplicates: !1,
104
+ orderMustBeComplete: !1,
105
+ ...n
106
+ }, !n.allowDuplicates && !s(k(e), e)) throw F(t);
107
+ if (n.allowDuplicates === !1 && t.length !== k(t).length) return 0;
108
+ if (t = n.allowDuplicates === !1 ? k(t) : t, P("answer:", t), !Array.isArray(e) || e.length === 0) throw Error("correct must be non empty an array");
109
+ if (e.length === 1) return +!!s(e, t);
110
+ if (!Array.isArray(t) || t.length < 2 || t.length > e.length || e.length !== t.length && n.orderMustBeComplete) return 0;
111
+ let r = j(e, 2).toArray(), i = j(t, 2).toArray(), a = x(i, r, s), o = r.length - i.length, c = r.length, l = ((c - a.length - o) / c).toFixed(2);
112
+ return parseFloat(l);
113
+ }, L = (e) => e.correctResponse ? e.correctResponse.map((e) => e && e.id ? e.id : e) : [], R = (e) => {
114
+ let t = (e.alternateResponses || []).map((e) => Array.isArray(e) ? e : e.response).filter((e) => e !== void 0);
115
+ return [L(e), ...t];
116
+ }, z = (e, t) => {
117
+ let { value: n } = t || {};
118
+ if (!n) return 0;
119
+ let r = R(e), i = (e.configure && e.configure.removeTilesAfterPlacing) !== !1, a = 0;
120
+ return r.forEach((e) => {
121
+ let t = I(e, n, { allowDuplicates: i });
122
+ t >= a && (a = t);
123
+ }), a;
124
+ }, B = {
125
+ correct: {
126
+ type: "default",
127
+ default: "Correct",
128
+ custom: "Correct"
129
+ },
130
+ incorrect: {
131
+ type: "default",
132
+ default: "Incorrect",
133
+ custom: "Incorrect"
134
+ },
135
+ partial: {
136
+ type: "default",
137
+ default: "Nearly",
138
+ custom: "Nearly"
139
+ },
140
+ unanswered: {
141
+ type: "default",
142
+ default: "You have not entered a response",
143
+ custom: "You have not entered a response"
144
+ }
145
+ };
146
+ function V(e) {
147
+ return e === "partially-correct" ? "partial" : e;
148
+ }
149
+ function H(e, t = {}) {
150
+ return new Promise((n) => {
151
+ let r = {
152
+ ...B,
153
+ ...t
154
+ }, i = V(e), a = r[i], o = B[i];
155
+ U(a, o[a.type]).then(n);
156
+ });
157
+ }
158
+ function U(e, t) {
159
+ return new Promise((n) => {
160
+ if (!e || e.type === "none") {
161
+ n(void 0);
162
+ return;
163
+ }
164
+ n(e[e.type] || t);
165
+ });
166
+ }
167
+ //#endregion
168
+ //#region ../../shared/controller-utils/dist/index.js
169
+ var W = Object.defineProperty, G = /* @__PURE__ */ ((e, t) => {
170
+ let n = {};
171
+ for (var r in e) W(n, r, {
172
+ get: e[r],
173
+ enumerable: !0
174
+ });
175
+ return t || W(n, Symbol.toStringTag, { value: "Module" }), n;
176
+ })({ enabled: () => K });
177
+ function K(e, t, n) {
178
+ return e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n == "boolean" ? n : !0;
179
+ }
180
+ //#endregion
181
+ //#region src/controller/defaults.ts
182
+ var q = {
183
+ choiceLabel: "",
184
+ choiceLabelEnabled: !0,
185
+ choices: [],
186
+ correctResponse: [],
187
+ feedbackEnabled: !1,
188
+ numberedGuides: !1,
189
+ orientation: "vertical",
190
+ partialScoring: !0,
191
+ placementArea: !1,
192
+ prompt: "",
193
+ promptEnabled: !0,
194
+ rationale: "",
195
+ rationaleEnabled: !0,
196
+ removeTilesAfterPlacing: !0,
197
+ scoringType: "auto",
198
+ studentInstructionsEnabled: !0,
199
+ targetLabel: "",
200
+ teacherInstructions: "",
201
+ teacherInstructionsEnabled: !0,
202
+ toolbarEditorPosition: "bottom"
203
+ }, J = (0, N.default)("@pie-element:placement-ordering:controller"), { translator: Y } = _, X = () => /* @__PURE__ */ Error("Question is missing required array: correctResponse"), Z = (e, t, n) => {
204
+ let r = [], i = t?.value || [];
205
+ e?.correctResponse;
206
+ let a = e?.placementArea === !0;
207
+ if (!i.length) return a ? r.push("Student did not place any tiles in the target area.") : r.push("Student did not reorder any tiles."), r.push("Final score: 0."), r;
208
+ let o = R(e), c = {
209
+ score: 0,
210
+ response: []
211
+ };
212
+ o.forEach((e) => {
213
+ let t = 0;
214
+ i.forEach((n, r) => {
215
+ e[r] === n && t++;
216
+ }), t > c.score && (c = {
217
+ score: t,
218
+ response: e
219
+ });
220
+ });
221
+ let l = c.score, u = i.length - l;
222
+ l > 0 && r.push(`${l} tile(s) placed in the correct order.`), u > 0 && r.push(`${u} tile(s) placed in an incorrect order.`), o.some((e) => s(e, i));
223
+ let d = G.enabled(e, n || {});
224
+ d ? (r.push("Score calculated using partial scoring."), r.push("Each tile placed in the correct position contributes to the score.")) : (r.push("Score calculated using all-or-nothing scoring."), a ? r.push("Student must place all tiles in the correct positions within the target area to receive full credit.") : r.push("Student must arrange all tiles in the correct order to receive full credit."));
225
+ let f = z(e, t), p = d ? f : +(f === 1);
226
+ return r.push(`Final score: ${p}.`), r;
227
+ };
228
+ function re(e, t, n) {
229
+ return new Promise((r, i) => {
230
+ if (!t || u(t)) {
231
+ r({
232
+ score: 0,
233
+ empty: !0,
234
+ logTrace: ["Student did not interact with the placement-ordering item."]
235
+ });
236
+ return;
237
+ }
238
+ if (!e || !e.correctResponse || u(e.correctResponse)) i(X());
239
+ else try {
240
+ let i = z(e, t);
241
+ r({
242
+ score: G.enabled(e, n || {}) ? i : +(i === 1),
243
+ logTrace: Z(e, t, n)
244
+ });
245
+ } catch (e) {
246
+ i(e);
247
+ }
248
+ });
249
+ }
250
+ function ie(e = {}) {
251
+ return new Promise((t) => {
252
+ t({
253
+ ...q,
254
+ ...e
255
+ });
256
+ });
257
+ }
258
+ var Q = (e) => ({
259
+ ...q,
260
+ rationaleEnabled: !0,
261
+ feedbackEnabled: !1,
262
+ promptEnabled: !0,
263
+ teacherInstructionsEnabled: !0,
264
+ studentInstructionsEnabled: !0,
265
+ ...e
266
+ });
267
+ async function ae(e, t, r) {
268
+ let i = Q(e), a = {};
269
+ if (e.alternateResponses && w(e.alternateResponses, n) && (J("Deprecated structure of alternateResponses is in use"), console.error("Deprecated structure of alternateResponses is in use")), a.env = r, a.extraCSSRules = i.extraCSSRules, a.outcomes = [], a.completeLength = (i.correctResponse || []).length, a.choices = (i.choices || []).filter((e) => e.label), a.note = i.note, a.showNote = i.alternateResponses && i.alternateResponses.length > 0, a.language = i.language, J("[model] removing tileSize for the moment."), a.prompt = i.promptEnabled ? i.prompt : null, a.config = {
270
+ orientation: i.orientation || "vertical",
271
+ includeTargets: i.placementArea,
272
+ choiceLabelEnabled: i.choiceLabelEnabled,
273
+ targetLabel: i.targetLabel,
274
+ choiceLabel: i.choiceLabel,
275
+ showOrdering: i.numberedGuides,
276
+ allowSameChoiceInTargets: !i.removeTilesAfterPlacing
277
+ }, a.disabled = r.mode !== "gather", a.note ||= Y.t("common:commonCorrectAnswerWithAlternates", { lng: i.language }), r.role === "instructor" && (r.mode === "view" || r.mode === "evaluate") ? (a.rationale = i.rationaleEnabled ? i.rationale : null, a.teacherInstructions = i.teacherInstructionsEnabled ? i.teacherInstructions : null) : (a.rationale = null, a.teacherInstructions = null), r.mode === "evaluate") {
278
+ let n = t && t.value || [], o = R(i), c = o.reduce((e, t) => {
279
+ let r = E(n, (e, n, r) => e + (Array.isArray(t) && t[r] === n ? 1 : 0), 0);
280
+ return r > e.score ? {
281
+ arr: t,
282
+ score: r
283
+ } : e;
284
+ }, {
285
+ arr: [],
286
+ score: 0
287
+ });
288
+ a.outcomes = m(n, (e, t) => ({
289
+ id: e,
290
+ outcome: c.arr[t] === e ? "correct" : "incorrect"
291
+ }));
292
+ let l = o.some((e) => s(e, n)), u = z(e, t), d = u === 1, f = !d && G.enabled(i, r || {}) && u !== 0;
293
+ return a.correctness = d ? "correct" : f ? "partial" : "incorrect", l || (a.correctResponse = L(i)), i.feedback || (i.feedbackEnabled = !1), a.feedback = i.feedbackEnabled ? await H(a.correctness, i.feedback) : void 0, a;
294
+ } else return a;
295
+ }
296
+ var oe = (e, t) => new Promise((n) => {
297
+ t.mode !== "evaluate" && t.role === "instructor" ? n({
298
+ id: "1",
299
+ value: L(e)
300
+ }) : n(null);
301
+ }), $ = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), se = (e = {}, t = {}) => {
302
+ let { choices: n, correctResponse: r } = e, i = {};
303
+ [
304
+ "teacherInstructions",
305
+ "prompt",
306
+ "rationale"
307
+ ].forEach((n) => {
308
+ t[n]?.required && !$(e[n]) && (i[n] = "This field is required.");
309
+ });
310
+ let a = [...n || []].reverse(), o = {};
311
+ return a.forEach((e, t) => {
312
+ let { id: n, label: r } = e;
313
+ $(r) ? a.slice(t + 1).some((e) => e.label === r) && (o[n] = "Content should be unique.") : o[n] = "Content should not be empty.";
314
+ }), s((n || []).map((e) => e.id), (r || []).map((e) => e.id || e)) && (i.orderError = "The correct ordering should not be identical to the initial ordering."), u(o) || (i.choicesErrors = o), i;
315
+ };
316
+ //#endregion
317
+ export { oe as createCorrectResponseSession, ie as createDefaultModel, Z as getLogTrace, ae as model, Q as normalize, re as outcome, X as questionError, se as validate };
318
+
319
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/noop.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEvery.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEvery.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/every.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js","../../../../../../node_modules/.bun/js-combinatorics@2.1.2/node_modules/js-combinatorics/combinatorics.js","../../../src/controller/scoring.ts","../../../../../shared/feedback/dist/index.js","../../../../../shared/controller-utils/dist/index.js","../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nexport default noop;\n","/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nexport default arrayReduce;\n","import baseDifference from './_baseDifference.js';\nimport baseFlatten from './_baseFlatten.js';\nimport baseRest from './_baseRest.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport last from './last.js';\n\n/**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\nvar differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n});\n\nexport default differenceWith;\n","/**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\nfunction arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n}\n\nexport default arrayEvery;\n","import baseEach from './_baseEach.js';\n\n/**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\nfunction baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n}\n\nexport default baseEvery;\n","import arrayEvery from './_arrayEvery.js';\nimport baseEvery from './_baseEvery.js';\nimport baseIteratee from './_baseIteratee.js';\nimport isArray from './isArray.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\nfunction every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n}\n\nexport default every;\n","/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nexport default baseReduce;\n","import arrayReduce from './_arrayReduce.js';\nimport baseEach from './_baseEach.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseReduce from './_baseReduce.js';\nimport isArray from './isArray.js';\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\nfunction reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n}\n\nexport default reduce;\n","import Set from './_Set.js';\nimport noop from './noop.js';\nimport setToArray from './_setToArray.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nexport default createSet;\n","import SetCache from './_SetCache.js';\nimport arrayIncludes from './_arrayIncludes.js';\nimport arrayIncludesWith from './_arrayIncludesWith.js';\nimport cacheHas from './_cacheHas.js';\nimport createSet from './_createSet.js';\nimport setToArray from './_setToArray.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseUniq;\n","import baseUniq from './_baseUniq.js';\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\nfunction uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n}\n\nexport default uniq;\n","/**\n * combinatorics.js\n *\n * Licensed under the MIT license.\n * http://www.opensource.org/licenses/mit-license.php\n *\n * @author: Dan Kogai <dankogai+github@gmail.com>\n *\n * References:\n * @link: http://www.ruby-doc.org/core-2.0/Array.html#method-i-combination\n * @link: http://www.ruby-doc.org/core-2.0/Array.html#method-i-permutation\n * @link: http://en.wikipedia.org/wiki/Factorial_number_system\n * @link: https://en.wikipedia.org/wiki/Combinatorial_number_system\n */\nexport const version = '2.1.2';\n/**\n * calculates `P(n, k)`.\n *\n * @link https://en.wikipedia.org/wiki/Permutation\n */\nexport function permutation(n, k) {\n if (n < 0)\n throw new RangeError(`${n} is out of range`);\n if (k < 0)\n throw new RangeError(`${k} is out of range`);\n if (0 == k)\n return 1n;\n if (n < k)\n return 0n;\n let [bn, bk, bp] = [BigInt(n), BigInt(k), 1n];\n while (bk--)\n bp *= bn--;\n return bp;\n}\n/**\n * calculates `C(n, k)`.\n *\n * @link https://en.wikipedia.org/wiki/Combination\n */\nexport function combination(n, k) {\n if (0 == k)\n return 1n;\n if (n == k)\n return 1n;\n if (n < k)\n return 0n;\n return permutation(n, k) / permutation(k, k);\n}\n/**\n * calculates `n!` === `P(n, n)`.\n *\n * @link https://en.wikipedia.org/wiki/Factorial\n */\nexport function factorial(n) {\n return permutation(n, n);\n}\n/**\n * returns the factoradic representation of `n`, least significant order.\n *\n * @link https://en.wikipedia.org/wiki/Factorial_number_system\n * @param {number} l the number of digits\n */\nexport function factoradic(n, l = 0) {\n if (n < 0)\n throw new RangeError(`${n} is out of range`);\n let [bn, bf] = [BigInt(n), 1n];\n if (!l) {\n for (l = 1; bf < bn; bf *= BigInt(++l))\n ;\n if (bn < bf)\n bf /= BigInt(l--);\n }\n else {\n bf = BigInt(factorial(l));\n }\n let digits = [0];\n for (; l; bf /= BigInt(l--)) {\n digits[l] = Number(bn / bf);\n bn %= bf;\n }\n return digits;\n}\n/**\n * `combinadic(n, k)` returns a function\n * that takes `m` as an argument and\n * returns the combinadics representation of `m` for `n C k`.\n *\n * @link https://en.wikipedia.org/wiki/Combinatorial_number_system\n */\nexport function combinadic(n, k) {\n const count = combination(n, k);\n const [bn, bk] = [BigInt(n), BigInt(k)];\n return (m) => {\n if (m < 0 || count <= m)\n throw new RangeError(`${m} is out of range`);\n let digits = [];\n let [ba, bb] = [bn, bk];\n let x = BigInt(count) - 1n - BigInt(m);\n for (let i = 0; i < k; i++) {\n ba--;\n while (x < combination(ba, bb))\n ba--;\n digits.push(Number(bn - 1n - ba));\n x -= combination(ba, bb);\n bb--;\n }\n return digits;\n };\n}\n/**\n *\n */\nconst _crypto = typeof crypto !== 'undefined' ? crypto : {};\nconst _randomBytes = typeof _crypto['randomBytes'] === 'function'\n ? (len) => Uint8Array.from(_crypto['randomBytes'](len))\n : typeof _crypto['getRandomValues'] === 'function'\n ? (len) => _crypto['getRandomValues'](new Uint8Array(len))\n : (len) => Uint8Array.from(Array(len), () => Math.random() * 256);\n/**\n * returns random integer `n` where `min` <= `n` < `max`:\n *\n * if the argument is `BigInt` the result is also `BigInt`.\n *\n * @param {anyint} min\n * @param {anyint} max\n */\nexport function randomInteger(min = 0, max = Math.pow(2, 53)) {\n let ctor = min.constructor;\n if (arguments.length === 0) {\n return Math.floor(Math.random() * ctor(max));\n }\n if (arguments.length == 1) {\n [min, max] = [ctor(0), min];\n }\n if (typeof min == 'number') { // number\n [min, max] = [Math.ceil(Number(min)), Math.ceil(Number(max))];\n return Math.floor(Math.random() * (max - min)) + min;\n }\n const mag = ctor(max) - ctor(min);\n const len = mag.toString(16).length;\n const u8s = _randomBytes(len);\n const rnd = u8s.reduce((a, v) => ((a << ctor(8)) + ctor(v)), ctor(0));\n return ((ctor(rnd) * mag) >> ctor(len * 8)) + ctor(min);\n}\n;\n/**\n * Base Class of `js-combinatorics`\n */\nclass _CBase {\n /**\n * does `new`\n * @param args\n */\n static of(...args) {\n return new (Function.prototype.bind.apply(this, [null].concat(args)));\n }\n /**\n * Same as `of` but takes a single array `arg`\n *\n * cf. https://stackoverflow.com/questions/1606797/use-of-apply-with-new-operator-is-this-possible\n */\n static from(arg) {\n return new (Function.prototype.bind.apply(this, [null].concat(arg)));\n }\n /**\n * Common iterator\n */\n [Symbol.iterator]() {\n return function* (it, len) {\n for (let i = 0n; i < len; i++)\n yield it.at(i);\n }(this, this.length);\n }\n /**\n * returns `[...this]`.\n */\n toArray() {\n return [...this];\n }\n /**\n * @deprecated\n * tells wether you need `BigInt` to access all elements.\n */\n get isBig() {\n return Number.MAX_SAFE_INTEGER < this.length;\n }\n /**\n * @deprecated\n * tells wether it is safe to work on this instance.\n *\n * * always `true` unless your platform does not support `BigInt`.\n * * if not, `true` iff `.isBig` is `false`.\n */\n get isSafe() {\n return typeof BigInt !== 'undefined' || !this.isBig;\n }\n /**\n * check n for nth\n */\n _check(n) {\n if (n < 0) {\n if (this.length < -n)\n throw new RangeError(`${n} is out of range`);\n return BigInt(this.length) + BigInt(n);\n }\n if (this.length <= n)\n throw new RangeError(`${n} is out of range`);\n return n;\n }\n /**\n * get the `n`th element of the iterator.\n * negative `n` goes backwards\n * like `Array.prototype.at()`\n * @link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at\n */\n at(n) { return undefined; }\n /**\n * an alias of `at`\n */\n nth(n) { return this.at(n); }\n /**\n * the seed iterable\n */\n seed;\n /**\n * the size (# of elements) of each element.\n */\n size;\n /**\n * the number of elements\n */\n length;\n /**\n * pick random element\n */\n sample() {\n return this.at(randomInteger(this.length));\n }\n /**\n * an infinite steam of random elements\n */\n samples() {\n return function* (it) {\n while (true)\n yield it.sample();\n }(this);\n }\n}\n/**\n * Permutation\n */\nexport class Permutation extends _CBase {\n constructor(seed, size = 0) {\n super();\n this.seed = [...seed];\n this.size = 0 < size ? size : this.seed.length;\n this.length = permutation(this.seed.length, this.size);\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n const offset = this.seed.length - this.size;\n const skip = factorial(offset);\n let digits = factoradic(BigInt(n) * BigInt(skip), this.seed.length);\n let source = this.seed.slice();\n let result = [];\n for (let i = this.seed.length - 1; offset <= i; i--) {\n result.push(source.splice(digits[i], 1)[0]);\n }\n return result;\n }\n}\n/**\n * Combination\n */\nexport class Combination extends _CBase {\n comb;\n constructor(seed, size = 0) {\n super();\n this.seed = [...seed];\n this.size = 0 < size ? size : this.seed.length;\n this.size = size;\n this.length = combination(this.seed.length, this.size);\n this.comb = combinadic(this.seed.length, this.size);\n Object.freeze(this);\n }\n /**\n * returns an iterator which is more efficient\n * than the default iterator that uses .nth\n *\n * @link https://en.wikipedia.org/wiki/Combinatorial_number_system#Applications\n */\n bitwiseIterator() {\n // [Symbol.iterator]() {\n // console.log('overriding _CBase');\n const inc = (x) => {\n if (x <= 0n)\n return 0n;\n const u = x & -x;\n const v = u + x;\n return v + (((v ^ x) / u) >> 2n);\n };\n let x = (1n << BigInt(this.size)) - 1n; // 0b11...1\n return function* (it, len) {\n for (let i = 0n; i < BigInt(len); i++, x = inc(x)) {\n let result = [];\n for (let y = x, j = 0; 0n < y; y >>= 1n, j++) {\n if (y & 1n)\n result.push(it.seed[j]);\n }\n // console.log(`x = ${x}`);\n yield result;\n }\n }(this, this.length);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let result = [];\n for (let i of this.comb(n)) {\n result.push(this.seed[i]);\n }\n return result;\n }\n}\n/**\n * Base N\n */\nexport class BaseN extends _CBase {\n base;\n constructor(seed, size = 1) {\n if (size < 1)\n throw new RangeError(`${size} is out of range`);\n super();\n this.seed = [...seed];\n this.size = size;\n let base = this.seed.length;\n this.base = base;\n this.length = BigInt(base) ** BigInt(size);\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n const bb = BigInt(this.base);\n let result = [];\n for (let i = 0; i < this.size; i++) {\n let bd = bn % bb;\n result.push(this.seed[Number(bd)]);\n bn -= bd;\n bn /= bb;\n }\n return result;\n }\n}\n/**\n * Power Set\n */\nexport class PowerSet extends _CBase {\n constructor(seed) {\n super();\n this.seed = [...seed];\n const length = 1n << BigInt(this.seed.length);\n this.length = length;\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n let result = [];\n for (let bi = 0n; bn; bn >>= 1n, bi++)\n if (bn & 1n)\n result.push(this.seed[Number(bi)]);\n return result;\n }\n}\n/**\n * Cartesian Product\n */\nexport class CartesianProduct extends _CBase {\n constructor(...args) {\n super();\n this.seed = args.map(v => [...v]);\n this.size = this.seed.length;\n const length = this.seed.reduce((a, v) => a * BigInt(v.length), 1n);\n this.length = length;\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n let result = [];\n for (let i = 0; i < this.size; i++) {\n const base = this.seed[i].length;\n const bb = BigInt(base);\n const bd = bn % bb;\n result.push(this.seed[i][Number(bd)]);\n bn -= bd;\n bn /= bb;\n }\n return result;\n }\n}\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/scoring.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { differenceWith, isEqual, uniq } from 'lodash-es';\nimport { combination } from 'js-combinatorics';\nimport debug from 'debug';\n\nconst log = debug('pie-elements:placement-ordering:controller');\n\nexport const illegalArgumentError = (answer) =>\n new Error(`Cant score answer: ${answer} it has duplicates and allowDuplicates is false`);\nexport const pairwiseCombinationScore = (correct, answer, opts) => {\n opts = { allowDuplicates: false, orderMustBeComplete: false, ...opts };\n\n if (!opts.allowDuplicates && !isEqual(uniq(correct), correct)) {\n throw illegalArgumentError(answer);\n }\n\n if (opts.allowDuplicates === false && answer.length !== uniq(answer).length) {\n return 0;\n }\n\n answer = opts.allowDuplicates !== false ? answer : uniq(answer);\n\n log('answer:', answer);\n if (!Array.isArray(correct) || correct.length === 0) {\n throw new Error('correct must be non empty an array');\n }\n\n if (correct.length === 1) {\n return isEqual(correct, answer) ? 1 : 0;\n }\n\n if (!Array.isArray(answer) || answer.length < 2) {\n return 0;\n }\n\n if (answer.length > correct.length) {\n return 0;\n }\n\n if (correct.length !== answer.length && opts.orderMustBeComplete) {\n return 0;\n }\n\n const correctCombo = combination(correct, 2).toArray();\n const answerCombo = combination(answer, 2).toArray();\n\n const diff = differenceWith(answerCombo, correctCombo, isEqual);\n\n const comboLengthDiff = correctCombo.length - answerCombo.length;\n\n const total = correctCombo.length;\n const actual = total - diff.length - comboLengthDiff;\n\n const n = (actual / total).toFixed(2);\n\n return parseFloat(n);\n};\n\n/**\n * Flattens the correctResponse into an array of ordered identifiers representing the\n * correct response.\n */\nexport const flattenCorrect = (question) =>\n question.correctResponse ? question.correctResponse.map((r) => (r && r.id ? r.id : r)) : [];\n\n/**\n * Returns all correct responses for this question\n * @param question - array\n */\nexport const getAllCorrectResponses = (question) => {\n const alternates = (question.alternateResponses || [])\n .map((alternate) => {\n if (Array.isArray(alternate)) {\n return alternate;\n }\n\n return alternate.response;\n })\n .filter((item) => item !== undefined);\n\n return [flattenCorrect(question), ...alternates];\n};\n\n/**\n * Returns the score for a session. If weighted scoring is present in the correctResponse\n * field for the question, this will be used. If partial scoring is present in the question\n * model, this will be used. Otherwise the default scoring mechanism (0 for any incorrect, 1\n * for all correct) will be used.\n */\n\nexport const score = (question, session) => {\n const { value } = session || {};\n\n if (!value) {\n return 0;\n }\n\n const allCorrectResponse = getAllCorrectResponses(question);\n const allowDuplicates = (question.configure && question.configure.removeTilesAfterPlacing) !== false;\n\n /**\n * We require this to be the case - locking\n */\n //const orderMustBeComplete = true;\n\n let bestScore = 0;\n\n allCorrectResponse.forEach((cr) => {\n const currentScore = pairwiseCombinationScore(cr, value, {\n allowDuplicates,\n });\n\n if (currentScore >= bestScore) {\n bestScore = currentScore;\n }\n });\n\n return bestScore;\n};\n","//#region src/defaults.ts\nvar e = {\n\tcorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Correct\",\n\t\tcustom: \"Correct\"\n\t},\n\tincorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Incorrect\",\n\t\tcustom: \"Incorrect\"\n\t},\n\tpartial: {\n\t\ttype: \"default\",\n\t\tdefault: \"Nearly\",\n\t\tcustom: \"Nearly\"\n\t},\n\tunanswered: {\n\t\ttype: \"default\",\n\t\tdefault: \"You have not entered a response\",\n\t\tcustom: \"You have not entered a response\"\n\t}\n};\n//#endregion\n//#region src/utils.ts\nfunction t(e) {\n\treturn e === \"partially-correct\" ? \"partial\" : e;\n}\n//#endregion\n//#region src/index.ts\nfunction n(n, i = {}) {\n\treturn new Promise((a) => {\n\t\tlet o = {\n\t\t\t...e,\n\t\t\t...i\n\t\t}, s = t(n), c = o[s], l = e[s];\n\t\tr(c, l[c.type]).then(a);\n\t});\n}\nfunction r(e, t) {\n\treturn new Promise((n) => {\n\t\tif (!e || e.type === \"none\") {\n\t\t\tn(void 0);\n\t\t\treturn;\n\t\t}\n\t\tn(e[e.type] || t);\n\t});\n}\nfunction i(n, r = {}) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, o = t(n), s = i[o], c = e[o];\n\treturn a(s, c[s.type]);\n}\nfunction a(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, a as getActualFeedback, i as getActualFeedbackForCorrectness, r as getFeedback, n as getFeedbackForCorrectness, t as normalizeCorrectness };\n","//#region \\0rolldown/runtime.js\nvar e = Object.defineProperty, t = (t, n) => {\n\tlet r = {};\n\tfor (var i in t) e(r, i, {\n\t\tget: t[i],\n\t\tenumerable: !0\n\t});\n\treturn n || e(r, Symbol.toStringTag, { value: \"Module\" }), r;\n};\n//#endregion\n//#region src/persistence.ts\nfunction n(e) {\n\treturn Array.isArray(e) ? e.filter((e) => e != null) : [];\n}\nfunction r(e) {\n\tlet t = [...e];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction i(e) {\n\treturn e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == \"object\" ? Object.keys(e).length === 0 : !1;\n}\nasync function a(e, t, a, o = \"value\") {\n\tlet s = n(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);\n\tif (!t) {\n\t\tconsole.warn(\"Unable to save shuffled choices because there's no session.\");\n\t\treturn;\n\t}\n\tif (!i(s)) return n(s.map((t) => e.find((e) => e[o] === t)));\n\tlet c = r(e);\n\tif (a && typeof a == \"function\") try {\n\t\tlet e = n(c.map((e) => e[o]));\n\t\ti(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(c)}, key: ${o}`) : t.id && t.element && await a(t.id, t.element, { shuffledValues: e });\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to save shuffled order for choices\"), console.error(e);\n\t}\n\telse console.warn(\"Unable to save shuffled choices, shuffle will happen every time.\");\n\treturn c;\n}\nfunction o(e, t, n) {\n\treturn !!(e.lockChoiceOrder || n[\"@pie-element\"]?.lockChoiceOrder || (n.role ?? \"student\") === \"instructor\");\n}\n//#endregion\n//#region src/partial-scoring.ts\nvar s = /* @__PURE__ */ t({ enabled: () => c });\nfunction c(e, t, n) {\n\treturn e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n == \"boolean\" ? n : !0;\n}\n//#endregion\nexport { a as getShuffledChoices, o as lockChoices, s as partialScoring };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n choiceLabel: '',\n choiceLabelEnabled: true,\n choices: [],\n correctResponse: [],\n feedbackEnabled: false,\n numberedGuides: false,\n orientation: 'vertical',\n partialScoring: true,\n placementArea: false,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n removeTilesAfterPlacing: true,\n scoringType: 'auto',\n studentInstructionsEnabled: true,\n targetLabel: '',\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { flattenCorrect, getAllCorrectResponses, score } from './scoring.js';\n\nimport { every, isArray, isEmpty, isEqual, map, reduce } from 'lodash-es';\nimport { getFeedbackForCorrectness } from '@pie-element/shared-feedback';\nimport { partialScoring } from '@pie-element/shared-controller-utils';\nimport debug from 'debug';\n\nimport defaults from './defaults.js';\n\nconst log = debug('@pie-element:placement-ordering:controller');\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nexport const questionError = () => new Error('Question is missing required array: correctResponse');\n\n/**\n * Generates detailed trace log for placement-ordering scoring evaluation\n * @param {Object} question - the question model\n * @param {Object} session - the student session\n * @param {Object} env - the environment\n * @returns {Array<string>} traceLog\n */\nexport const getLogTrace = (question, session, env) => {\n const traceLog = [];\n\n const value = session?.value || [];\n const correctResponse = question?.correctResponse || [];\n const hasPlacementArea = question?.placementArea === true;\n\n if (!value.length) {\n if (hasPlacementArea) {\n traceLog.push('Student did not place any tiles in the target area.');\n } else {\n traceLog.push('Student did not reorder any tiles.');\n }\n traceLog.push('Final score: 0.');\n return traceLog;\n }\n\n const allCorrectResponses = getAllCorrectResponses(question);\n\n let bestMatch = { score: 0, response: [] };\n\n allCorrectResponses.forEach((cr) => {\n let matchCount = 0;\n value.forEach((v, idx) => {\n if (cr[idx] === v) {\n matchCount++;\n }\n });\n\n if (matchCount > bestMatch.score) {\n bestMatch = { score: matchCount, response: cr };\n }\n });\n\n const correctCount = bestMatch.score;\n const incorrectCount = value.length - correctCount;\n\n if (correctCount > 0) {\n traceLog.push(`${correctCount} tile(s) placed in the correct order.`);\n }\n\n if (incorrectCount > 0) {\n traceLog.push(`${incorrectCount} tile(s) placed in an incorrect order.`);\n }\n\n const isFullyCorrect = allCorrectResponses.some((cr) => isEqual(cr, value));\n\n const partialScoringEnabled = partialScoring.enabled(question, env || {});\n\n if (partialScoringEnabled) {\n traceLog.push('Score calculated using partial scoring.');\n traceLog.push(\n 'Each tile placed in the correct position contributes to the score.',\n );\n } else {\n traceLog.push('Score calculated using all-or-nothing scoring.');\n if (hasPlacementArea) {\n traceLog.push(\n 'Student must place all tiles in the correct positions within the target area to receive full credit.',\n );\n } else {\n traceLog.push(\n 'Student must arrange all tiles in the correct order to receive full credit.',\n );\n }\n }\n\n const rawScore = score(question, session);\n const finalScore = partialScoringEnabled ? rawScore : rawScore === 1 ? 1 : 0;\n\n traceLog.push(`Final score: ${finalScore}.`);\n\n return traceLog;\n};\n\nexport function outcome(question, session, env) {\n return new Promise((resolve, reject) => {\n if (!session || isEmpty(session)) {\n resolve({ \n score: 0, \n empty: true, \n logTrace: ['Student did not interact with the placement-ordering item.'] \n });\n return;\n }\n\n if (!question || !question.correctResponse || isEmpty(question.correctResponse)) {\n reject(questionError());\n } else {\n try {\n const s = score(question, session);\n const finalScore = partialScoring.enabled(question, env || {}) ? s : s === 1 ? 1 : 0;\n resolve({\n score: finalScore,\n logTrace: getLogTrace(question, session, env)\n });\n } catch (e) {\n reject(e);\n }\n }\n });\n}\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n}\n\nexport const normalize = (question) => ({\n ...defaults,\n rationaleEnabled: true,\n feedbackEnabled: false,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n ...question,\n});\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n const base = {};\n\n if (question.alternateResponses && every(question.alternateResponses, isArray)) {\n log('Deprecated structure of alternateResponses is in use');\n // eslint-disable-next-line no-console\n console.error('Deprecated structure of alternateResponses is in use');\n }\n\n base.env = env;\n base.extraCSSRules = normalizedQuestion.extraCSSRules;\n base.outcomes = [];\n base.completeLength = (normalizedQuestion.correctResponse || []).length;\n base.choices = (normalizedQuestion.choices || []).filter((choice) => choice.label);\n base.note = normalizedQuestion.note;\n base.showNote = normalizedQuestion.alternateResponses && normalizedQuestion.alternateResponses.length > 0;\n base.language = normalizedQuestion.language;\n\n log('[model] removing tileSize for the moment.');\n\n base.prompt = normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null;\n base.config = {\n orientation: normalizedQuestion.orientation || 'vertical',\n includeTargets: normalizedQuestion.placementArea,\n choiceLabelEnabled: normalizedQuestion.choiceLabelEnabled,\n targetLabel: normalizedQuestion.targetLabel,\n choiceLabel: normalizedQuestion.choiceLabel,\n showOrdering: normalizedQuestion.numberedGuides,\n allowSameChoiceInTargets: !normalizedQuestion.removeTilesAfterPlacing,\n };\n\n base.disabled = env.mode !== 'gather';\n\n if (!base.note) {\n base.note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: normalizedQuestion.language });\n }\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n base.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n base.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n base.rationale = null;\n base.teacherInstructions = null;\n }\n\n if (env.mode === 'evaluate') {\n const value = (session && session.value) || [];\n const allCorrectResponses = getAllCorrectResponses(normalizedQuestion);\n\n const bestSetOfResponses = allCorrectResponses.reduce(\n (info, cr) => {\n const currentScore = reduce(value, (acc, c, idx) => acc + (Array.isArray(cr) && cr[idx] === c ? 1 : 0), 0);\n\n if (currentScore > info.score) {\n return {\n arr: cr,\n score: currentScore,\n };\n }\n\n return info;\n },\n { arr: [], score: 0 },\n );\n\n base.outcomes = map(value, (c, idx) => {\n return {\n id: c,\n outcome: bestSetOfResponses.arr[idx] === c ? 'correct' : 'incorrect',\n };\n });\n\n const isResponseCorrect = allCorrectResponses.some((response) => isEqual(response, value));\n const responseScore = score(question, session);\n const isCorrect = responseScore === 1;\n const isPartialCorrect = !isCorrect && partialScoring.enabled(normalizedQuestion, env || {}) && responseScore !== 0;\n\n base.correctness = isCorrect ? 'correct' : isPartialCorrect ? 'partial' : 'incorrect';\n\n if (!isResponseCorrect) {\n base.correctResponse = flattenCorrect(normalizedQuestion);\n }\n\n // requirement made in PD-2182\n if (!normalizedQuestion.feedback) {\n normalizedQuestion.feedbackEnabled = false;\n }\n\n const feedback = normalizedQuestion.feedbackEnabled\n ? await getFeedbackForCorrectness(base.correctness, normalizedQuestion.feedback)\n : undefined;\n\n base.feedback = feedback;\n return base;\n } else {\n return base;\n }\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({\n id: '1',\n value: flattenCorrect(question),\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { choices, correctResponse } = model;\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n const reversedChoices = [...(choices || [])].reverse();\n const choicesErrors = {};\n\n reversedChoices.forEach((choice, index) => {\n const { id, label } = choice;\n\n if (!getContent(label)) {\n choicesErrors[id] = 'Content should not be empty.';\n } else {\n const identicalAnswer = reversedChoices.slice(index + 1).some((c) => c.label === label);\n\n if (identicalAnswer) {\n choicesErrors[id] = 'Content should be unique.';\n }\n }\n });\n\n const choicesIds = (choices || []).map((choice) => choice.id);\n const correctResponseIds = (correctResponse || []).map((response) => response.id || response);\n\n if (isEqual(choicesIds, correctResponseIds)) {\n errors.orderError = 'The correct ordering should not be identical to the initial ordering.';\n }\n\n if (!isEmpty(choicesErrors)) {\n errors.choicesErrors = choicesErrors;\n }\n\n return errors;\n};\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11],"mappings":";;;;AAYA,SAAS,IAAO,CAEhB;;;ACFA,SAAS,EAAY,GAAO,GAAU,GAAa,GAAW;CAC5D,IAAI,IAAQ,IACR,IAAS,KAAS,OAAO,IAAI,EAAM;CAKvC,KAHI,KAAa,MACf,IAAc,EAAM,EAAE,KAEjB,EAAE,IAAQ,IACf,IAAc,EAAS,GAAa,EAAM,IAAQ,GAAO,CAAK;CAEhE,OAAO;AACT;;;ACMA,IAAI,IAAiB,EAAS,SAAS,GAAO,GAAQ;CACpD,IAAI,IAAa,EAAK,CAAM;CAI5B,OAHI,EAAkB,CAAU,MAC9B,IAAa,KAAA,IAER,EAAkB,CAAK,IAC1B,GAAe,GAAO,EAAY,GAAQ,GAAG,GAAmB,EAAI,GAAG,KAAA,GAAW,CAAU,IAC5F,CAAC;AACP,CAAC;;;AC3BD,SAAS,EAAW,GAAO,GAAW;CAIpC,KAHA,IAAI,IAAQ,IACR,IAAS,KAAS,OAAO,IAAI,EAAM,QAEhC,EAAE,IAAQ,IACf,IAAI,CAAC,EAAU,EAAM,IAAQ,GAAO,CAAK,GACvC,OAAO;CAGX,OAAO;AACT;;;ACTA,SAAS,EAAU,GAAY,GAAW;CACxC,IAAI,IAAS;CAKb,OAJA,EAAS,GAAY,SAAS,GAAO,GAAO,GAAY;EAEtD,OADA,IAAS,CAAC,CAAC,EAAU,GAAO,GAAO,CAAU,GACtC;CACT,CAAC,GACM;AACT;;;AC6BA,SAAS,EAAM,GAAY,GAAW,GAAO;CAC3C,IAAI,IAAO,EAAQ,CAAU,IAAI,IAAa;CAI9C,OAHI,KAAS,EAAe,GAAY,GAAW,CAAK,MACtD,IAAY,K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