@pie-element/placement-ordering 14.1.2-next.0 → 14.1.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 (239) hide show
  1. package/dist/author/choice-editor.js +16 -17
  2. package/dist/author/choice-tile.js +3 -2
  3. package/dist/author/design.js +50 -51
  4. package/dist/author/index.d.ts +1 -0
  5. package/dist/author/index.js +25 -22
  6. package/dist/author/utils.js +1 -1
  7. package/dist/browser/author/index.js +23612 -21053
  8. package/dist/browser/author/index.js.map +1 -1
  9. package/dist/browser/browser-Bd36Xf5z.js +376 -0
  10. package/dist/browser/browser-Bd36Xf5z.js.map +1 -0
  11. package/dist/browser/controller/index.js +87 -164
  12. package/dist/browser/controller/index.js.map +1 -1
  13. package/dist/browser/delivery/index.js +476 -336
  14. package/dist/browser/delivery/index.js.map +1 -1
  15. package/dist/browser/{dist-BTHiIs74.js → dist-DiGNNRzu.js} +354 -538
  16. package/dist/browser/dist-DiGNNRzu.js.map +1 -0
  17. package/dist/browser/{drag-provider-DaPxkh4j.js → drag-provider-B5wazJHM.js} +3284 -3615
  18. package/dist/browser/drag-provider-B5wazJHM.js.map +1 -0
  19. package/dist/controller/index.js +44 -49
  20. package/dist/controller/scoring.js +2 -4
  21. package/dist/delivery/index.js +12 -12
  22. package/dist/delivery/keyboard-coordinates.d.ts +47 -0
  23. package/dist/delivery/keyboard-coordinates.js +51 -0
  24. package/dist/delivery/main.js +1 -1
  25. package/dist/delivery/ordering.js +4 -6
  26. package/dist/delivery/placement-ordering.d.ts +11 -0
  27. package/dist/delivery/placement-ordering.js +175 -105
  28. package/dist/delivery/tile.d.ts +3 -0
  29. package/dist/delivery/tile.js +66 -57
  30. package/dist/delivery/tiler.d.ts +6 -0
  31. package/dist/delivery/tiler.js +6 -3
  32. package/dist/index.iife.js +35 -35
  33. package/dist/runtime-support.d.ts +12 -0
  34. package/dist/runtime-support.js +12 -0
  35. package/package.json +22 -18
  36. package/dist/browser/browser-CvJkn_Ec.js +0 -1019
  37. package/dist/browser/browser-CvJkn_Ec.js.map +0 -1
  38. package/dist/browser/dist-BTHiIs74.js.map +0 -1
  39. package/dist/browser/drag-provider-DaPxkh4j.js.map +0 -1
  40. package/dist/browser/last-D7N4Qfx4.js +0 -9
  41. package/dist/browser/last-D7N4Qfx4.js.map +0 -1
  42. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
  43. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
  44. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEvery.js +0 -7
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludes.js +0 -7
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludesWith.js +0 -7
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js +0 -8
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayShuffle.js +0 -8
  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/_baseDifference.js +0 -23
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js +0 -6
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEvery.js +0 -10
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +0 -7
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +0 -13
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +0 -5
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js +0 -8
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +0 -10
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +0 -6
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIndexOf.js +0 -9
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMatch.js +0 -26
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNaN.js +0 -6
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIteratee.js +0 -11
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMap.js +0 -11
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js +0 -12
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js +0 -8
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js +0 -9
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRandom.js +0 -7
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js +0 -8
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseShuffle.js +0 -8
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js +0 -27
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseValues.js +0 -9
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createAssigner.js +0 -15
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js +0 -12
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +0 -12
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js +0 -9
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMatchData.js +0 -16
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js +0 -18
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +0 -10
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +0 -12
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isStrictComparable.js +0 -7
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
  186. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
  187. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
  188. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shuffleSelf.js +0 -12
  189. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
  190. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
  191. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
  192. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
  193. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
  194. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_strictIndexOf.js +0 -7
  195. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
  196. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
  197. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
  198. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/assign.js +0 -16
  199. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
  200. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/compact.js +0 -10
  201. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
  202. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +0 -16
  203. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/difference.js +0 -10
  204. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js +0 -12
  205. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
  206. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/every.js +0 -12
  207. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js +0 -8
  208. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +0 -8
  209. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
  210. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
  211. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
  212. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
  213. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  214. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
  215. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
  216. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
  217. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
  218. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
  219. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
  220. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
  221. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
  222. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
  223. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
  224. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
  225. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
  226. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
  227. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/last.js +0 -7
  228. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/map.js +0 -10
  229. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
  230. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/noop.js +0 -4
  231. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/property.js +0 -10
  232. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js +0 -12
  233. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/shuffle.js +0 -9
  234. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
  235. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
  236. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
  237. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js +0 -7
  238. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js +0 -9
  239. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/values.js +0 -8
@@ -1,27 +1,12 @@
1
- import { E as e, L as t, O as n, V as r, b as i, i as a, n as o, ot as s, r as c, t as l, z as u } from "../browser-CvJkn_Ec.js";
2
- import { E as d, Gt as f, It as p, Kt as m, Lt as h, Nt as g, Pt as _, bt as v, c as y, ct as b, d as x, dt as ee, ft as S, ht as C, l as te, lt as w, n as T, pt as E, qt as ne, r as D, t as re, u as ie, ut as O, y as ae } from "../drag-provider-DaPxkh4j.js";
3
- import { n as oe, r as se, t as ce } from "../dist-BTHiIs74.js";
4
- import k, { createElement as le, useRef as ue } from "react";
5
- import { createRoot as de } from "react-dom/client";
6
- import fe from "react-dom";
7
- import { jsx as A, jsxs as j } from "react/jsx-runtime";
8
- //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/assign.js
9
- var pe = Object.prototype.hasOwnProperty, me = f(function(e, r) {
10
- if (t(r) || u(r)) {
11
- m(r, n(r), e);
12
- return;
13
- }
14
- for (var i in r) pe.call(r, i) && ne(e, i, r[i]);
15
- }), M = r(function(e, t) {
16
- return a(e) ? se(e, i(t, 1, a, !0)) : [];
17
- }), he = 0;
18
- function ge(t) {
19
- var n = ++he;
20
- return e(t) + n;
21
- }
22
- //#endregion
1
+ import { C as e, _ as t, b as n, g as r, k as i, l as a, r as o, t as s, u as c, v as l } from "../browser-Bd36Xf5z.js";
2
+ import { Lt as u, Rt as d, T as f, at as p, c as m, ct as h, dt as g, ft as _, l as v, lt as y, mt as b, n as x, ot as S, s as C, st as w, t as ee, u as T, ut as E, v as D } from "../drag-provider-B5wazJHM.js";
3
+ import { t as O } from "../dist-DiGNNRzu.js";
4
+ import k, { createElement as A, useRef as j } from "react";
5
+ import { createRoot as M } from "react-dom/client";
6
+ import N from "react-dom";
7
+ import { jsx as P, jsxs as F } from "react/jsx-runtime";
23
8
  //#region ../../shared/player-events/dist/index.js
24
- var N = /* @__PURE__ */ s(l(), 1);
9
+ var I = /* @__PURE__ */ i(s(), 1);
25
10
  (class e extends CustomEvent {
26
11
  static {
27
12
  this.TYPE = "model-set";
@@ -38,7 +23,7 @@ var N = /* @__PURE__ */ s(l(), 1);
38
23
  }), this.component = t, this.complete = n;
39
24
  }
40
25
  });
41
- var _e = class e extends CustomEvent {
26
+ var te = class e extends CustomEvent {
42
27
  static {
43
28
  this.TYPE = "session-changed";
44
29
  }
@@ -52,39 +37,47 @@ var _e = class e extends CustomEvent {
52
37
  }
53
38
  }), this.component = t, this.complete = n;
54
39
  }
55
- }, P = /* @__PURE__ */ s(g(), 1), F = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ j("svg", {
40
+ }, L = /* @__PURE__ */ i(u(), 1);
41
+ function ne(e, t, n) {
42
+ let r = { ...e };
43
+ return t.top + e.y <= n.top ? r.y = n.top - t.top : t.bottom + e.y >= n.top + n.height && (r.y = n.top + n.height - t.bottom), t.left + e.x <= n.left ? r.x = n.left - t.left : t.right + e.x >= n.left + n.width && (r.x = n.left + n.width - t.right), r;
44
+ }
45
+ var re = (e) => {
46
+ let { containerNodeRect: t, draggingNodeRect: n, transform: r } = e;
47
+ return !n || !t ? r : ne(r, n, t);
48
+ }, R = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ F("svg", {
56
49
  preserveAspectRatio: "xMinYMin meet",
57
50
  version: "1.1",
58
51
  viewBox: "-283 359 34 35",
59
52
  style: { enableBackground: "new -283 359 34 35" },
60
53
  children: [
61
- /* @__PURE__ */ A("circle", {
54
+ /* @__PURE__ */ P("circle", {
62
55
  cx: "-266",
63
56
  cy: "375.9",
64
57
  r: "14",
65
58
  fill: e
66
59
  }),
67
- /* @__PURE__ */ A("path", {
60
+ /* @__PURE__ */ P("path", {
68
61
  d: "M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z\n M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z",
69
62
  fill: e
70
63
  }),
71
- /* @__PURE__ */ A("polygon", {
64
+ /* @__PURE__ */ P("polygon", {
72
65
  points: "-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6",
73
66
  fill: t
74
67
  })
75
68
  ]
76
69
  });
77
- F.propTypes = {
78
- bgFill: P.default.string.isRequired,
79
- fgFill: P.default.string.isRequired
70
+ R.propTypes = {
71
+ bgFill: L.default.string.isRequired,
72
+ fgFill: L.default.string.isRequired
80
73
  };
81
- var I = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ j("svg", {
74
+ var ie = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ F("svg", {
82
75
  preserveAspectRatio: "xMinYMin meet",
83
76
  version: "1.1",
84
77
  viewBox: "-129.5 127 34 35",
85
78
  style: { enableBackground: "new -129.5 127 34 35" },
86
79
  children: [
87
- /* @__PURE__ */ A("path", {
80
+ /* @__PURE__ */ P("path", {
88
81
  style: {
89
82
  fill: "#D0CAC5",
90
83
  stroke: "#E6E3E0",
@@ -93,7 +86,7 @@ var I = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ j("svg", {
93
86
  },
94
87
  d: "M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5\n C-97.4,153.5-104.3,160.4-112.9,160.4z"
95
88
  }),
96
- /* @__PURE__ */ A("path", {
89
+ /* @__PURE__ */ P("path", {
97
90
  style: {
98
91
  fill: "#B3ABA4",
99
92
  stroke: "#CDC7C2",
@@ -102,48 +95,48 @@ var I = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ j("svg", {
102
95
  },
103
96
  d: "M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z"
104
97
  }),
105
- /* @__PURE__ */ A("circle", {
98
+ /* @__PURE__ */ P("circle", {
106
99
  cx: "-114.2",
107
100
  cy: "143.5",
108
101
  r: "14",
109
102
  fill: e
110
103
  }),
111
- /* @__PURE__ */ A("path", {
104
+ /* @__PURE__ */ P("path", {
112
105
  d: "M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z\n M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z",
113
106
  fill: n
114
107
  }),
115
- /* @__PURE__ */ A("polygon", {
108
+ /* @__PURE__ */ P("polygon", {
116
109
  points: "-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2",
117
110
  fill: t
118
111
  })
119
112
  ]
120
113
  });
121
- I.propTypes = {
122
- bgFill: P.default.string.isRequired,
123
- fgFill: P.default.string.isRequired,
124
- borderFill: P.default.string.isRequired
114
+ ie.propTypes = {
115
+ bgFill: L.default.string.isRequired,
116
+ fgFill: L.default.string.isRequired,
117
+ borderFill: L.default.string.isRequired
125
118
  };
126
- var ve = C("div")(({ size: e }) => ({
119
+ var ae = b("div")(({ size: e }) => ({
127
120
  width: e || "25px",
128
121
  height: e || "25px"
129
- })), L = ({ open: e, size: t }) => /* @__PURE__ */ A(ve, {
122
+ })), z = ({ open: e, size: t }) => /* @__PURE__ */ P(ae, {
130
123
  size: t,
131
- children: e ? /* @__PURE__ */ A(F, {
124
+ children: e ? /* @__PURE__ */ P(R, {
132
125
  bgFill: "#bce2ff",
133
126
  fgFill: "#1a9cff"
134
- }) : /* @__PURE__ */ A(I, {
127
+ }) : /* @__PURE__ */ P(ie, {
135
128
  bgFill: "white",
136
129
  fgFill: "#1a9cff",
137
130
  borderFill: "#bce2ff"
138
131
  })
139
132
  });
140
- L.propTypes = {
141
- open: P.default.bool,
142
- size: P.default.string
143
- }, L.defaultProps = { open: !1 };
133
+ z.propTypes = {
134
+ open: L.default.bool,
135
+ size: L.default.string
136
+ }, z.defaultProps = { open: !1 };
144
137
  //#endregion
145
138
  //#region ../../lib-react/correct-answer-toggle/dist/expander.js
146
- var R = "height ease-in 300ms, opacity ease-in 300ms", ye = C("div")(() => ({
139
+ var oe = "height ease-in 300ms, opacity ease-in 300ms", se = b("div")(() => ({
147
140
  position: "relative",
148
141
  height: 0,
149
142
  overflow: "hidden",
@@ -151,7 +144,7 @@ var R = "height ease-in 300ms, opacity ease-in 300ms", ye = C("div")(() => ({
151
144
  visibility: "hidden",
152
145
  width: 0,
153
146
  "&.enter": {
154
- transition: R,
147
+ transition: oe,
155
148
  opacity: 1,
156
149
  height: "auto",
157
150
  width: "auto",
@@ -165,7 +158,7 @@ var R = "height ease-in 300ms, opacity ease-in 300ms", ye = C("div")(() => ({
165
158
  minHeight: "25px"
166
159
  },
167
160
  "&.exit": {
168
- transition: R,
161
+ transition: oe,
169
162
  opacity: 0,
170
163
  height: 0,
171
164
  visibility: "visible",
@@ -177,9 +170,9 @@ var R = "height ease-in 300ms, opacity ease-in 300ms", ye = C("div")(() => ({
177
170
  height: 0,
178
171
  width: 0
179
172
  }
180
- })), z = (e) => {
181
- let { show: t, children: n, className: r } = e, i = ue(null);
182
- return /* @__PURE__ */ A(w, {
173
+ })), ce = (e) => {
174
+ let { show: t, children: n, className: r } = e, i = j(null);
175
+ return /* @__PURE__ */ P(S, {
183
176
  nodeRef: i,
184
177
  in: t,
185
178
  appear: !0,
@@ -191,49 +184,49 @@ var R = "height ease-in 300ms, opacity ease-in 300ms", ye = C("div")(() => ({
191
184
  exit: "exit",
192
185
  exitDone: "exit-done"
193
186
  },
194
- children: /* @__PURE__ */ A(ye, {
187
+ children: /* @__PURE__ */ P(se, {
195
188
  ref: i,
196
189
  className: r,
197
190
  children: n
198
191
  })
199
192
  });
200
193
  };
201
- z.propTypes = {
202
- show: P.default.bool.isRequired,
203
- className: P.default.string,
204
- children: P.default.oneOfType([P.default.arrayOf(P.default.node), P.default.node]).isRequired
194
+ ce.propTypes = {
195
+ show: L.default.bool.isRequired,
196
+ className: L.default.string,
197
+ children: L.default.oneOfType([L.default.arrayOf(L.default.node), L.default.node]).isRequired
205
198
  };
206
199
  //#endregion
207
200
  //#region ../../lib-react/correct-answer-toggle/dist/index.js
208
201
  function B(e) {
209
202
  return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
210
203
  }
211
- function be(e, t) {
204
+ function le(e, t) {
212
205
  return !e || B(e) ? e : B(e.default) ? e.default : t && B(e[t]) ? e[t] : t && B(e[t]?.default) ? e[t].default : e;
213
206
  }
214
- var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.default, Ce = V && typeof V == "object" ? V : Se, { translator: H } = ce, we = {
207
+ var ue = le(v, "Readable") || le(fe.Readable, "Readable"), de = x, V = de.default, fe = V && typeof V == "object" ? V : de, { translator: H } = O, pe = {
215
208
  WebkitTouchCallout: "none",
216
209
  WebkitUserSelect: "none",
217
210
  KhtmlUserSelect: "none",
218
211
  MozUserSelect: "none",
219
212
  msUserSelect: "none",
220
213
  userSelect: "none"
221
- }, Te = C("div")(() => ({
214
+ }, me = b("div")(() => ({
222
215
  width: "100%",
223
216
  cursor: "pointer"
224
- })), Ee = C("div")(() => ({
217
+ })), he = b("div")(() => ({
225
218
  margin: "0 auto",
226
219
  textAlign: "center",
227
220
  display: "flex"
228
- })), De = C("div")(() => ({
221
+ })), ge = b("div")(() => ({
229
222
  width: "fit-content",
230
223
  minWidth: "140px",
231
224
  alignSelf: "center",
232
225
  verticalAlign: "middle",
233
- color: `var(--correct-answer-toggle-label-color, ${O.text()})`,
226
+ color: `var(--correct-answer-toggle-label-color, ${w.text()})`,
234
227
  fontWeight: "normal",
235
- ...we
236
- })), Oe = C("div")(() => ({
228
+ ...pe
229
+ })), U = b("div")(() => ({
237
230
  position: "absolute",
238
231
  width: "25px",
239
232
  "&.enter": { opacity: "0" },
@@ -246,20 +239,20 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
246
239
  opacity: "0",
247
240
  transition: "opacity 0.3s ease-in"
248
241
  }
249
- })), ke = C("div")(() => ({
242
+ })), _e = b("div")(() => ({
250
243
  width: "25px",
251
244
  marginRight: "5px",
252
245
  display: "flex",
253
246
  alignItems: "center"
254
- })), Ae = class e extends k.Component {
247
+ })), ve = class e extends k.Component {
255
248
  static propTypes = {
256
- onToggle: P.default.func,
257
- toggled: P.default.bool,
258
- show: P.default.bool,
259
- hideMessage: P.default.string,
260
- showMessage: P.default.string,
261
- className: P.default.string,
262
- language: P.default.string
249
+ onToggle: L.default.func,
250
+ toggled: L.default.bool,
251
+ show: L.default.bool,
252
+ hideMessage: L.default.string,
253
+ showMessage: L.default.string,
254
+ className: L.default.string,
255
+ language: L.default.string
263
256
  };
264
257
  static defaultProps = {
265
258
  showMessage: "Show correct answer",
@@ -289,14 +282,14 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
289
282
  }
290
283
  render() {
291
284
  let { className: e, toggled: t, hideMessage: n, showMessage: r } = this.props;
292
- return /* @__PURE__ */ A(Te, {
285
+ return /* @__PURE__ */ P(me, {
293
286
  className: e,
294
- children: /* @__PURE__ */ A(z, {
287
+ children: /* @__PURE__ */ P(ce, {
295
288
  show: this.state.show,
296
- children: /* @__PURE__ */ j(Ee, {
289
+ children: /* @__PURE__ */ F(he, {
297
290
  onClick: this.onClick.bind(this),
298
291
  onTouchEnd: this.onTouch.bind(this),
299
- children: [/* @__PURE__ */ j(ke, { children: [/* @__PURE__ */ A(w, {
292
+ children: [/* @__PURE__ */ F(_e, { children: [/* @__PURE__ */ P(S, {
300
293
  nodeRef: this.openIconRef,
301
294
  timeout: 400,
302
295
  in: t,
@@ -307,11 +300,11 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
307
300
  exit: "exit",
308
301
  exitActive: "exit-active"
309
302
  },
310
- children: /* @__PURE__ */ A(Oe, {
303
+ children: /* @__PURE__ */ P(U, {
311
304
  ref: this.openIconRef,
312
- children: /* @__PURE__ */ A(L, { open: t }, "correct-open")
305
+ children: /* @__PURE__ */ P(z, { open: t }, "correct-open")
313
306
  })
314
- }), /* @__PURE__ */ A(w, {
307
+ }), /* @__PURE__ */ P(S, {
315
308
  nodeRef: this.closedIconRef,
316
309
  timeout: 5e3,
317
310
  in: !t,
@@ -322,13 +315,13 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
322
315
  exit: "exit",
323
316
  exitActive: "exit-active"
324
317
  },
325
- children: /* @__PURE__ */ A(Oe, {
318
+ children: /* @__PURE__ */ P(U, {
326
319
  ref: this.closedIconRef,
327
- children: /* @__PURE__ */ A(L, { open: t }, "correct-closed")
320
+ children: /* @__PURE__ */ P(z, { open: t }, "correct-closed")
328
321
  })
329
- })] }), /* @__PURE__ */ A(xe, {
322
+ })] }), /* @__PURE__ */ P(ue, {
330
323
  false: !0,
331
- children: /* @__PURE__ */ A(De, {
324
+ children: /* @__PURE__ */ P(ge, {
332
325
  "aria-hidden": !this.state.show,
333
326
  children: t ? n : r
334
327
  })
@@ -337,7 +330,25 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
337
330
  })
338
331
  });
339
332
  }
340
- }, je = /* @__PURE__ */ s(T(), 1), Me = C("div")(({ theme: e }) => ({
333
+ };
334
+ //#endregion
335
+ //#region ../../lib-react/drag/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js
336
+ function ye(e) {
337
+ var t, n, r = "";
338
+ if (typeof e == "string" || typeof e == "number") r += e;
339
+ else if (typeof e == "object") if (Array.isArray(e)) {
340
+ var i = e.length;
341
+ for (t = 0; t < i; t++) e[t] && (n = ye(e[t])) && (r && (r += " "), r += n);
342
+ } else for (n in e) e[n] && (r && (r += " "), r += n);
343
+ return r;
344
+ }
345
+ function be() {
346
+ for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = ye(e)) && (r && (r += " "), r += t);
347
+ return r;
348
+ }
349
+ //#endregion
350
+ //#region ../../lib-react/drag/dist/placeholder.js
351
+ var xe = b("div")(({ theme: e }) => ({
341
352
  "&.placeholder": {
342
353
  WebkitTouchCallout: "none",
343
354
  WebkitUserSelect: "none",
@@ -347,22 +358,22 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
347
358
  userSelect: "none",
348
359
  width: "100%",
349
360
  height: "100%",
350
- background: O.white(),
361
+ background: w.white(),
351
362
  transition: "background-color 200ms linear, border-color 200ms linear",
352
363
  boxSizing: "border-box",
353
364
  display: "grid",
354
365
  gridRowGap: e.spacing(1),
355
366
  gridColumnGap: e.spacing(1),
356
367
  padding: e.spacing(1),
357
- border: `2px dashed ${O.black()}`
368
+ border: `2px dashed ${w.black()}`
358
369
  },
359
- "&.disabled": {
370
+ "&.placeholderDisabled": {
360
371
  boxShadow: "none",
361
- background: e.palette.background.paper
372
+ background: w.white()
362
373
  },
363
374
  "&.over": {
364
- border: `1px solid ${v[500]}`,
365
- backgroundColor: `${v[300]}`
375
+ border: `1px solid ${w.border()}`,
376
+ backgroundColor: w.backgroundDark()
366
377
  },
367
378
  "&.board": {
368
379
  padding: e.spacing(1),
@@ -373,7 +384,7 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
373
384
  justifyContent: "center",
374
385
  overflow: "hidden",
375
386
  touchAction: "none",
376
- backgroundColor: O.backgroundDark()
387
+ backgroundColor: w.surface()
377
388
  },
378
389
  "&.categorizeBoard": {
379
390
  padding: e.spacing(.5),
@@ -384,183 +395,189 @@ var xe = be(ie, "Readable") || be(Ce.Readable, "Readable"), Se = D, V = Se.defau
384
395
  justifyContent: "center",
385
396
  overflow: "hidden",
386
397
  touchAction: "none",
387
- backgroundColor: O.backgroundDark()
398
+ backgroundColor: w.surface()
388
399
  },
389
400
  "&.verticalPool": {
390
401
  display: "flex",
391
402
  flexFlow: "column wrap"
392
403
  }
393
- })), Ne = (e) => {
394
- let { children: t, className: n, isOver: r, type: i, grid: a, disabled: o, choiceBoard: s, isCategorize: c, isVerticalPool: l, minHeight: u, extraStyles: d } = e, f = (0, je.default)("placeholder", o && "disabled", r && "over", i, n), p = {};
404
+ })), Se = (e) => {
405
+ let { children: t, className: n, isOver: r, type: i, grid: a, disabled: o, choiceBoard: s, isCategorize: c, isVerticalPool: l, minHeight: u, extraStyles: d } = e, f = be("placeholder", o && "placeholderDisabled", r && "over", i, n), p = {};
395
406
  if (a && a.columns && (p.gridTemplateColumns = `repeat(${a.columns}, 1fr)`), a && a.rows) {
396
407
  let e = a.rowsRepeatValue || "1fr";
397
408
  p.gridTemplateRows = `repeat(${a.rows}, ${e})`;
398
409
  }
399
- i === "choice" && (p.border = `1px solid ${O.borderLight()}`, p.background = O.backgroundDark());
410
+ i === "choice" && (p.border = `1px solid ${w.borderLight()}`, p.background = w.backgroundDark());
400
411
  let m = c ? "categorizeBoard" : "board";
401
- return /* @__PURE__ */ A(Me, {
412
+ return /* @__PURE__ */ P(xe, {
402
413
  style: {
403
414
  ...p,
404
415
  minHeight: u,
405
416
  ...d
406
417
  },
407
- className: (0, je.default)(s ? m : f, l && "verticalPool"),
418
+ className: be(s ? m : f, l && "verticalPool"),
408
419
  children: t
409
420
  });
410
421
  };
411
- Ne.propTypes = {
412
- choiceBoard: P.default.bool,
413
- grid: P.default.shape({
414
- columns: P.default.number,
415
- rows: P.default.number,
416
- rowsRepeatValue: P.default.string
422
+ Se.propTypes = {
423
+ choiceBoard: L.default.bool,
424
+ grid: L.default.shape({
425
+ columns: L.default.number,
426
+ rows: L.default.number,
427
+ rowsRepeatValue: L.default.string
417
428
  }),
418
- children: P.default.oneOfType([P.default.arrayOf(P.default.node), P.default.node]).isRequired,
419
- className: P.default.string,
420
- isOver: P.default.bool,
421
- index: P.default.number,
422
- type: P.default.string,
423
- disabled: P.default.bool,
424
- isCategorize: P.default.bool,
425
- isVerticalPool: P.default.bool,
426
- minHeight: P.default.number
429
+ children: L.default.oneOfType([L.default.arrayOf(L.default.node), L.default.node]).isRequired,
430
+ className: L.default.string,
431
+ isOver: L.default.bool,
432
+ index: L.default.number,
433
+ type: L.default.string,
434
+ disabled: L.default.bool,
435
+ isCategorize: L.default.bool,
436
+ isVerticalPool: L.default.bool,
437
+ minHeight: L.default.number
427
438
  };
428
439
  //#endregion
429
440
  //#region src/delivery/tile.tsx
430
- var Pe = (0, N.default)("pie-elements:placement-ordering:tile"), Fe = C("div")(({ theme: e }) => ({
441
+ var Ce = (0, I.default)("pie-elements:placement-ordering:tile"), we = b("div")(({ theme: e }) => ({
431
442
  width: "100%",
432
443
  fontSize: e.typography.fontSize + 4,
433
444
  textAlign: "center",
434
445
  color: `rgba(${e.palette.common.black}, 0.6)`
435
- })), U = ({ type: e, index: t, isOver: n, disabled: r }) => /* @__PURE__ */ A(Ne, {
446
+ })), Te = ({ type: e, index: t, isOver: n, disabled: r }) => /* @__PURE__ */ P(Se, {
436
447
  type: e,
437
448
  isOver: n,
438
449
  disabled: r,
439
- children: e === "target" && t !== void 0 && /* @__PURE__ */ A(Fe, { children: t })
450
+ children: e === "target" && t !== void 0 && /* @__PURE__ */ P(we, { children: t })
440
451
  });
441
- U.propTypes = {
442
- type: P.default.string,
443
- index: P.default.number,
444
- isOver: P.default.bool,
445
- disabled: P.default.bool
452
+ Te.propTypes = {
453
+ type: L.default.string,
454
+ index: L.default.number,
455
+ isOver: L.default.bool,
456
+ disabled: L.default.bool
446
457
  };
447
- var Ie = C("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i, label: a, type: o }) => ({
448
- cursor: r ? "not-allowed" : "grab",
458
+ var Ee = b("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled: i, outcome: a, label: o, type: s }) => ({
459
+ cursor: i ? "not-allowed" : "grab",
449
460
  width: "100%",
450
461
  height: "100%",
451
462
  padding: "10px",
452
463
  boxSizing: "border-box",
453
464
  overflow: "hidden",
454
- border: o === "choice" || o === "target" ? `1px solid ${e.palette.grey[400]}` : "1px solid transparent",
455
- backgroundColor: o === "choice" || o === "target" ? O.background() : "transparent",
456
- transition: o === "choice" || o === "target" ? "background-color 150ms ease, border-color 150ms ease, opacity 150ms ease" : "none",
465
+ border: s === "choice" || s === "target" ? `1px solid ${w.border()}` : "1px solid transparent",
466
+ backgroundColor: s === "choice" || s === "target" ? w.background() : "transparent",
467
+ transition: s === "choice" || s === "target" ? "background-color 150ms ease, border-color 150ms ease, opacity 150ms ease" : "none",
457
468
  pointerEvents: "none",
458
469
  userSelect: "none",
459
- ...(o === "choice" || o === "target") && { "&:hover": {
460
- backgroundColor: r ? O.background() : O.secondary(),
461
- borderColor: r ? e.palette.grey[400] : e.palette.primary.main,
462
- transform: r ? "none" : "scale(1.02)"
470
+ ...(s === "choice" || s === "target") && { "&:hover": {
471
+ backgroundColor: i ? w.background() : w.secondary(),
472
+ borderColor: i ? w.disabled() : e.palette.primary.main,
473
+ transform: i ? "none" : "scale(1.02)"
463
474
  } },
464
- ...(o === "choice" || o === "target") && n && !r && {
475
+ ...(s === "choice" || s === "target") && r && !i && {
465
476
  opacity: .4,
466
- backgroundColor: O.primaryLight(),
477
+ backgroundColor: w.primaryLight(),
467
478
  borderColor: e.palette.primary.main,
468
479
  borderStyle: "dashed",
469
480
  transform: "scale(1.05)"
470
481
  },
471
- ...(o === "choice" || o === "target") && t && !r && {
482
+ ...(s === "choice" || s === "target") && (t || n) && !i && {
472
483
  opacity: .6,
473
- backgroundColor: O.secondaryLight(),
484
+ backgroundColor: w.secondaryLight(),
474
485
  transform: "scale(1.05) rotate(2deg)",
475
486
  boxShadow: "0 8px 16px rgba(0,0,0,0.2)",
476
487
  cursor: "grabbing"
477
488
  },
478
- ...(o === "choice" || o === "target") && r && {
489
+ ...(s === "choice" || s === "target") && i && {
479
490
  cursor: "not-allowed",
480
491
  "&:hover": {
481
- backgroundColor: O.background(),
492
+ backgroundColor: w.background(),
482
493
  transform: "none"
483
494
  }
484
495
  },
485
- ...(o === "choice" || o === "target") && i === "incorrect" && { border: `1px solid ${O.incorrect()}` },
486
- ...(o === "choice" || o === "target") && i === "correct" && { border: `1px solid ${O.correct()}` },
487
- ...!a && {
496
+ ...(s === "choice" || s === "target") && a === "incorrect" && { border: `1px solid ${w.incorrect()}` },
497
+ ...(s === "choice" || s === "target") && a === "correct" && { border: `1px solid ${w.correct()}` },
498
+ ...!o && {
488
499
  border: "none",
489
500
  "&:hover": { backgroundColor: "unset" }
490
501
  }
491
- })), Le = (e) => {
492
- let { type: t, isDragging: n, empty: r, isOver: i, label: a, disabled: o, outcome: s, guideIndex: c } = e;
493
- return r ? /* @__PURE__ */ A(U, {
502
+ })), De = (e) => {
503
+ let { type: t, isDragging: n, isSelected: r, empty: i, isOver: a, label: o, disabled: s, outcome: c, guideIndex: l } = e;
504
+ return i ? /* @__PURE__ */ P(Te, {
494
505
  type: t,
495
- index: c,
496
- isOver: i,
497
- disabled: o
498
- }) : /* @__PURE__ */ A(Ie, {
506
+ index: l,
507
+ isOver: a,
508
+ disabled: s
509
+ }) : /* @__PURE__ */ P(Ee, {
499
510
  type: t,
500
511
  isDragging: n,
501
- isOver: i,
502
- disabled: o,
503
- outcome: s,
504
- label: a,
505
- dangerouslySetInnerHTML: { __html: a }
512
+ isSelected: r,
513
+ isOver: a,
514
+ disabled: s,
515
+ outcome: c,
516
+ label: o,
517
+ dangerouslySetInnerHTML: { __html: o }
506
518
  });
507
519
  }, W = (e) => {
508
- let { label: t, type: n, id: r, empty: i, disabled: a, outcome: o, index: s, guideIndex: c, instanceId: l, draggable: u, tileIndex: d } = e, f = `tile-${n}-${r ?? "empty"}-${d}-${l}`, p = `drop-${n}-${r ?? "empty"}-${d}-${l}`, { attributes: m, listeners: h, setNodeRef: g, transform: _, isDragging: v } = S({
509
- id: f,
510
- data: {
511
- id: r,
512
- type: n,
513
- instanceId: l,
514
- value: t,
515
- index: s
516
- },
520
+ let { label: t, type: n, id: r, empty: i, disabled: a, outcome: o, index: s, guideIndex: c, instanceId: l, draggable: u, tileIndex: d, selectedChoice: f, onChoiceClick: p, onPlacementClick: m } = e, h = `tile-${n}-${r ?? "empty"}-${d}-${l}`, v = `drop-${n}-${r ?? "empty"}-${d}-${l}`, y = {
521
+ id: r,
522
+ type: n,
523
+ instanceId: l,
524
+ value: t,
525
+ index: s
526
+ }, { attributes: b, listeners: x, setNodeRef: S, transform: C, isDragging: w } = g({
527
+ id: h,
528
+ data: y,
517
529
  disabled: !u || a
518
- }), { setNodeRef: y, isOver: b } = E({
519
- id: p,
520
- data: {
521
- id: r,
522
- type: n,
523
- instanceId: l,
524
- value: t,
525
- index: s
526
- },
527
- disabled: v
528
- }), x = k.useRef(null);
530
+ }), { setNodeRef: ee, isOver: T } = _({
531
+ id: v,
532
+ data: y,
533
+ disabled: w
534
+ }), E = !!f && f.type === y.type && f.id === y.id && f.index === y.index, [D, O] = k.useState(!1), A = !!f && !a, j = T || n === "target" && A && D, M = () => {
535
+ a || (n === "choice" ? f?.type === "target" ? m?.(y) : u && p?.(y) : n === "target" && (E ? p?.(y) : f ? m?.(y) : u && p?.(y)));
536
+ }, N = !(u && !a) && !a, F = (e) => {
537
+ (e.code === "Space" || e.code === "Enter") && (e.preventDefault(), M());
538
+ }, I = k.useRef(null);
529
539
  return k.useEffect(() => {
530
- let e = x.current, t = (e) => {
540
+ let e = I.current, t = (e) => {
531
541
  e.preventDefault();
532
542
  };
533
543
  return e && e.addEventListener("touchstart", t, { passive: !1 }), () => {
534
544
  e && e.removeEventListener("touchstart", t);
535
545
  };
536
- }, []), Pe("[render], props: ", e), /* @__PURE__ */ A("div", {
546
+ }, []), Ce("[render], props: ", e), /* @__PURE__ */ P("div", {
537
547
  ref: (e) => {
538
- x.current = e, g(e), y(e);
548
+ I.current = e, S(e), ee(e);
539
549
  },
540
550
  style: {
541
- transform: _ ? `translate3d(${_.x}px, ${_.y}px, 0)` : void 0,
551
+ transform: C ? `translate3d(${C.x}px, ${C.y}px, 0)` : void 0,
542
552
  boxSizing: "border-box",
543
553
  overflow: "visible",
544
554
  padding: 0,
545
555
  margin: 0,
546
556
  textAlign: "center",
547
557
  pointerEvents: "auto",
548
- cursor: a ? "not-allowed" : v ? "grabbing" : "grab",
549
- zIndex: v ? 1e3 : "auto",
550
- willChange: v ? "transform" : "auto"
558
+ cursor: a ? "not-allowed" : n === "target" && A ? "pointer" : w ? "grabbing" : "grab",
559
+ zIndex: w ? 1e3 : "auto",
560
+ willChange: w ? "transform" : "auto"
551
561
  },
562
+ role: N ? "button" : void 0,
563
+ tabIndex: N ? 0 : void 0,
564
+ onKeyDown: N ? F : void 0,
565
+ onClick: M,
566
+ onMouseEnter: () => O(!0),
567
+ onMouseLeave: () => O(!1),
552
568
  ...u && !a ? {
553
- ...h,
554
- ...m
569
+ ...x,
570
+ ...b
555
571
  } : {},
556
- children: /* @__PURE__ */ A(Le, {
572
+ children: /* @__PURE__ */ P(De, {
557
573
  label: t,
558
574
  id: r,
559
575
  empty: i,
560
576
  index: s,
561
577
  guideIndex: c,
562
- isOver: b,
563
- isDragging: v,
578
+ isOver: j,
579
+ isDragging: w,
580
+ isSelected: E,
564
581
  disabled: a,
565
582
  outcome: o,
566
583
  type: n
@@ -568,125 +585,131 @@ var Ie = C("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i
568
585
  });
569
586
  };
570
587
  W.propTypes = {
571
- id: P.default.any,
572
- label: P.default.string,
573
- isOver: P.default.bool,
574
- type: P.default.string,
575
- empty: P.default.bool,
576
- disabled: P.default.bool,
577
- outcome: P.default.string,
578
- index: P.default.number,
579
- guideIndex: P.default.number,
580
- instanceId: P.default.any,
581
- draggable: P.default.bool,
582
- tileIndex: P.default.number
588
+ id: L.default.any,
589
+ label: L.default.string,
590
+ isOver: L.default.bool,
591
+ type: L.default.string,
592
+ empty: L.default.bool,
593
+ disabled: L.default.bool,
594
+ outcome: L.default.string,
595
+ index: L.default.number,
596
+ guideIndex: L.default.number,
597
+ instanceId: L.default.any,
598
+ draggable: L.default.bool,
599
+ tileIndex: L.default.number,
600
+ selectedChoice: L.default.object,
601
+ onChoiceClick: L.default.func,
602
+ onPlacementClick: L.default.func
583
603
  };
584
604
  //#endregion
585
605
  //#region src/delivery/tiler.tsx
586
606
  var G = {
587
- choiceLabel: P.default.string,
588
- targetLabel: P.default.string,
589
- disabled: P.default.bool,
590
- tiles: P.default.array.isRequired,
591
- tileSize: P.default.string,
592
- addGuide: P.default.bool
593
- }, Re = {
607
+ choiceLabel: L.default.string,
608
+ targetLabel: L.default.string,
609
+ disabled: L.default.bool,
610
+ tiles: L.default.array.isRequired,
611
+ tileSize: L.default.string,
612
+ addGuide: L.default.bool,
613
+ selectedChoice: L.default.object,
614
+ onChoiceClick: L.default.func,
615
+ onPlacementClick: L.default.func
616
+ }, Oe = {
594
617
  tileSize: "1fr",
595
618
  disabled: !1,
596
619
  addGuide: !1
597
- }, ze = (e) => {
598
- let t = (t, n) => (t.instanceId = e.instanceId, t.disabled = e.disabled, t.guideIndex = e.addGuide ? t.index + 1 : void 0, t.tileIndex = n, e.includeTargets || t.type === "choice" ? /* @__PURE__ */ le(W, {
620
+ }, ke = (e) => {
621
+ let t = (t, n) => (t.instanceId = e.instanceId, t.disabled = e.disabled, t.guideIndex = e.addGuide ? t.index + 1 : void 0, t.tileIndex = n, t.selectedChoice = e.selectedChoice, t.onChoiceClick = e.onChoiceClick, t.onPlacementClick = e.onPlacementClick, e.includeTargets || t.type === "choice" ? /* @__PURE__ */ A(W, {
599
622
  ...t,
600
623
  key: n
601
- }) : /* @__PURE__ */ le(W, {
624
+ }) : /* @__PURE__ */ A(W, {
602
625
  ...t,
603
626
  label: "",
604
627
  key: n
605
628
  }));
606
629
  return t.propTypes = { ...G }, t;
607
- }, Be = C("div")(({ theme: e, includeTargets: t }) => ({
630
+ }, Ae = b("div")(({ theme: e, includeTargets: t }) => ({
608
631
  display: "grid",
609
632
  paddingBottom: e.spacing(2),
610
633
  ...t && { gridGap: "10px" }
611
- })), Ve = C("div")({ textAlign: "center" }), He = C("div")({
634
+ })), je = b("div")({ textAlign: "center" }), Me = b("div")({
612
635
  textAlign: "center",
613
636
  gridRow: "3/4"
614
- }), Ue = C("div")(({ includeTargets: e }) => ({
637
+ }), Ne = b("div")(({ includeTargets: e }) => ({
615
638
  gridAutoFlow: "column",
616
639
  display: "grid",
617
640
  ...e && { gridGap: "10px" }
618
- })), We = C("div")({
641
+ })), Pe = b("div")({
619
642
  gridColumn: "1/2",
620
643
  textAlign: "center"
621
- }), Ge = C("div")({
644
+ }), Fe = b("div")({
622
645
  gridColumn: "2/3",
623
646
  textAlign: "center"
624
- }), Ke = class extends k.Component {
647
+ }), Ie = class extends k.Component {
625
648
  static propTypes = { ...G };
626
- static defaultProps = { ...Re };
649
+ static defaultProps = { ...Oe };
627
650
  render() {
628
651
  let { includeTargets: e, choiceLabelEnabled: t, choiceLabel: n, targetLabel: r, tiles: i, tileSize: a } = this.props, o = e ? `auto ${a} auto ${a}` : `auto ${a} auto`, s = e ? i.length / 2 : i.length, c = {
629
652
  gridTemplateColumns: e ? `repeat(${s}, ${a})` : `auto repeat(${Math.floor(s / 2) - 1}, ${a} 10px) ${a} auto`,
630
653
  gridTemplateRows: o
631
654
  }, l = { gridColumn: `1/${s + 1}` };
632
- return /* @__PURE__ */ j(Be, {
655
+ return /* @__PURE__ */ F(Ae, {
633
656
  includeTargets: e,
634
657
  style: c,
635
658
  children: [
636
- /* @__PURE__ */ A(Ve, {
659
+ /* @__PURE__ */ P(je, {
637
660
  style: l,
638
661
  dangerouslySetInnerHTML: { __html: t ? n : "" }
639
662
  }),
640
- e && /* @__PURE__ */ A(He, {
663
+ e && /* @__PURE__ */ P(Me, {
641
664
  style: l,
642
665
  dangerouslySetInnerHTML: { __html: r }
643
666
  }),
644
- i.map(ze(this.props))
667
+ i.map(ke(this.props))
645
668
  ]
646
669
  });
647
670
  }
648
- }, qe = class extends k.Component {
671
+ }, Le = class extends k.Component {
649
672
  static propTypes = { ...G };
650
- static defaultProps = { ...Re };
673
+ static defaultProps = { ...Oe };
651
674
  render() {
652
675
  let { includeTargets: e, choiceLabelEnabled: t, choiceLabel: n, targetLabel: r, tiles: i, tileSize: a } = this.props, o = e ? 2 : 1, s = e ? i.length / 2 : i.length;
653
- return /* @__PURE__ */ j(Ue, {
676
+ return /* @__PURE__ */ F(Ne, {
654
677
  includeTargets: e,
655
678
  style: {
656
679
  gridTemplateColumns: `repeat(${o}, ${a})`,
657
680
  gridTemplateRows: e ? `auto repeat(${s}, ${a})` : `auto auto repeat(${Math.floor(s / 2) - 1}, ${a} 10px) ${a} auto`
658
681
  },
659
682
  children: [
660
- /* @__PURE__ */ A(We, { dangerouslySetInnerHTML: { __html: t ? n : "" } }),
661
- e && /* @__PURE__ */ A(Ge, { dangerouslySetInnerHTML: { __html: r } }),
662
- i.map(ze(this.props))
683
+ /* @__PURE__ */ P(Pe, { dangerouslySetInnerHTML: { __html: t ? n : "" } }),
684
+ e && /* @__PURE__ */ P(Fe, { dangerouslySetInnerHTML: { __html: r } }),
685
+ i.map(ke(this.props))
663
686
  ]
664
687
  });
665
688
  }
666
- }, K = (0, N.default)("pie-elements:placement-ordering:ordering"), Je = (e, t, n) => {
689
+ }, K = (0, I.default)("pie-elements:placement-ordering:ordering"), Re = (e, t, n) => {
667
690
  let r = e.find((e, n) => n === t), i = e.filter((e, n) => n !== t);
668
691
  return [
669
692
  ...i.slice(0, n),
670
693
  r,
671
694
  ...i.slice(n)
672
695
  ];
673
- }, Ye = (e, t, n) => {
674
- if (K("[swap]", e, t, n), !e || e.length <= 1 || t === void 0 || n === void 0) throw Error(`swap requires a non-empty array, fromIndex, toIndex: ${e}, ${t} ${n}`);
675
- let r = h(e), i = e[n];
676
- return r[n] = r[t], r[t] = i, r;
696
+ }, ze = (e, n, r) => {
697
+ if (K("[swap]", e, n, r), !e || e.length <= 1 || n === void 0 || r === void 0) throw Error(`swap requires a non-empty array, fromIndex, toIndex: ${e}, ${n} ${r}`);
698
+ let i = t(e), a = e[r];
699
+ return i[r] = i[n], i[n] = a, i;
677
700
  };
678
- function Xe(e, t) {
679
- let n = h(e.response);
680
- if (n[t.index] === t.id) n[t.index] = void 0;
681
- else throw Error(`Tried to remove from index: ${t.index}, but the id doesn't match: array: ${n}, target: ${t.id}`);
682
- return n;
701
+ function Be(e, n) {
702
+ let r = t(e.response);
703
+ if (r[n.index] === n.id) r[n.index] = void 0;
704
+ else throw Error(`Tried to remove from index: ${n.index}, but the id doesn't match: array: ${r}, target: ${n.id}`);
705
+ return r;
683
706
  }
684
- function Ze(e, t, n) {
685
- let { response: r, opts: i } = e, a = h(r);
686
- if (i.includeTargets) return t.type === "choice" && n.type === "target" ? (a[n.index] = t.id, a) : t.type === "target" && n.type === "choice" ? (a[t.index] = void 0, a) : t.type === "target" && n.type === "target" ? Ye(r, t.index, n.index) : (K("do nothing to the response"), r);
707
+ function Ve(e, n, r) {
708
+ let { response: i, opts: a } = e, o = t(i);
709
+ if (a.includeTargets) return n.type === "choice" && r.type === "target" ? (o[r.index] = n.id, o) : n.type === "target" && r.type === "choice" ? (o[n.index] = void 0, o) : n.type === "target" && r.type === "target" ? ze(i, n.index, r.index) : (K("do nothing to the response"), i);
687
710
  {
688
- let r = e.response.findIndex((e) => e !== void 0 && e === t.id), i = e.response.findIndex((e) => e !== void 0 && e === n.id);
689
- return K("fromIndex: ", r, "toIndex:", i), Je(e.response, r, i);
711
+ let t = e.response.findIndex((e) => e !== void 0 && e === n.id), i = e.response.findIndex((e) => e !== void 0 && e === r.id);
712
+ return K("fromIndex: ", t, "toIndex:", i), Re(e.response, t, i);
690
713
  }
691
714
  }
692
715
  function q(e, t, n, r) {
@@ -702,6 +725,7 @@ function q(e, t, n, r) {
702
725
  }
703
726
  return e.map((e) => t.indexOf(e.id) !== -1 && !r.allowSameChoiceInTargets ? {
704
727
  type: "choice",
728
+ id: e.id,
705
729
  empty: !0,
706
730
  droppable: !0,
707
731
  draggable: !1
@@ -723,26 +747,26 @@ function q(e, t, n, r) {
723
747
  return i === 0 && t.push(a), t.push(o, a), t;
724
748
  }, []);
725
749
  }
726
- function Qe(e, t, n, r) {
727
- return r = me({ includeTargets: !0 }, r), n ||= [], t = !t || c(t) ? r.includeTargets ? Array(e.length) : oe(e, (e) => e.id) : t, {
750
+ function He(e, t, r, i) {
751
+ return i = n({ includeTargets: !0 }, i), r ||= [], t = !t || a(t) ? i.includeTargets ? Array(e.length) : c(e, (e) => e.id) : t, {
728
752
  choices: e,
729
753
  response: t,
730
- opts: r,
731
- outcomes: n,
732
- tiles: q(e, t, n, r)
754
+ opts: i,
755
+ outcomes: r,
756
+ tiles: q(e, t, r, i)
733
757
  };
734
758
  }
735
- function $e(e, t) {
759
+ function Ue(e, t) {
736
760
  switch (e.type) {
737
761
  case "move": {
738
- let { from: n, to: r } = e, i = Ze(t, n, r), a = q(t.choices, i, t.outcomes, t.opts);
762
+ let { from: n, to: r } = e, i = Ve(t, n, r), a = q(t.choices, i, t.outcomes, t.opts);
739
763
  return Object.assign({}, t, {
740
764
  response: i,
741
765
  tiles: a
742
766
  });
743
767
  }
744
768
  case "remove": {
745
- let { target: n } = e, r = Xe(t, n), i = q(t.choices, r, t.outcomes, t.opts);
769
+ let { target: n } = e, r = Be(t, n), i = q(t.choices, r, t.outcomes, t.opts);
746
770
  return Object.assign({}, t, {
747
771
  response: r,
748
772
  tiles: i
@@ -753,11 +777,57 @@ function $e(e, t) {
753
777
  }
754
778
  //#endregion
755
779
  //#region src/delivery/utils.ts
756
- var et = (e, t) => {
780
+ var We = (e, t) => {
757
781
  if (!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) return !1;
758
782
  let n = (e) => e.map((e) => JSON.stringify(e)).sort(), r = n(e), i = n(t), a = r.every((e, t) => e === i[t]), o = e.every((e, n) => JSON.stringify(e) === JSON.stringify(t[n]));
759
783
  return a && !o;
760
- };
784
+ }, Ge = (e, { active: t, context: n, currentCoordinates: r }) => {
785
+ let { code: i } = e, a = i === "Tab", o = i === h.Down || i === h.Up || i === h.Left || i === h.Right;
786
+ if (!a && !o) return;
787
+ if (o) return y(e, {
788
+ context: n,
789
+ currentCoordinates: r
790
+ });
791
+ e.preventDefault();
792
+ let { droppableRects: s, droppableContainers: c, collisionRect: l, draggableNodes: u, active: d } = n;
793
+ if (!s || s.size === 0) return r;
794
+ let f = {
795
+ x: (l?.width || 0) / 2,
796
+ y: (l?.height || 0) / 2
797
+ }, p = {
798
+ x: r.x + f.x,
799
+ y: r.y + f.y
800
+ }, m = u?.get(t)?.data?.current?.id, g = d?.rect?.current?.initial, _ = typeof t == "string" ? t.replace(/^tile-/, "drop-") : void 0, v = [], b;
801
+ for (let [e, t] of c) {
802
+ let n = t?.data?.current, r = e === _;
803
+ if (t?.disabled && !r) continue;
804
+ let i = n?.type === "choice" && n?.id === m;
805
+ if (n?.type === "choice" && !i) continue;
806
+ let a = (r ? g : null) || s.get(e);
807
+ if (!a) continue;
808
+ let o = {
809
+ x: a.left + a.width / 2,
810
+ y: a.top + a.height / 2
811
+ }, c = {
812
+ id: e,
813
+ dropPosition: {
814
+ x: a.left,
815
+ y: a.top + a.height / 2 - f.y
816
+ },
817
+ center: o
818
+ };
819
+ i ? b = c : v.push(c);
820
+ }
821
+ if (v.length === 0 && !b) return r;
822
+ let x = e.shiftKey;
823
+ v.sort((e, t) => Math.abs(e.center.y - t.center.y) > 10 ? e.center.y - t.center.y : e.center.x - t.center.x), b && v.push(b);
824
+ let S = 0, C = Infinity;
825
+ for (let e = 0; e < v.length; e++) {
826
+ let t = Ke(p, v[e].center);
827
+ t < C && (C = t, S = e);
828
+ }
829
+ return v[x ? (S - 1 + v.length) % v.length : (S + 1) % v.length].dropPosition;
830
+ }, Ke = (e, t) => Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
761
831
  //#endregion
762
832
  //#region src/delivery/placement-ordering.tsx
763
833
  function J(e) {
@@ -766,71 +836,95 @@ function J(e) {
766
836
  function Y(e, t) {
767
837
  return !e || J(e) ? e : J(e.default) ? e.default : t && J(e[t]) ? e[t] : t && J(e[t]?.default) ? e[t].default : e;
768
838
  }
769
- var tt = Y(ae, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(x, "PreviewPrompt") || Y(Q.PreviewPrompt, "PreviewPrompt"), nt = Y(b, "Feedback") || Y(Q.Feedback, "Feedback"), rt = Y(d, "Collapsible") || Y(Q.Collapsible, "Collapsible"), it = D, Z = it.default, Q = Z && typeof Z == "object" ? Z : it, { translator: at } = ce, ot = (0, N.default)("pie-elements:placement-ordering"), st = C("div")({
770
- color: O.text(),
771
- backgroundColor: O.background(),
839
+ var qe = Y(D, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(T, "PreviewPrompt") || Y(Q.PreviewPrompt, "PreviewPrompt"), Je = Y(p, "Feedback") || Y(Q.Feedback, "Feedback"), Ye = Y(f, "Collapsible") || Y(Q.Collapsible, "Collapsible"), Xe = x, Z = Xe.default, Q = Z && typeof Z == "object" ? Z : Xe, Ze = 250, Qe = (e, t) => {
840
+ if (!e || !t) return !1;
841
+ let n = t.left + t.width / 2, r = t.top + t.height / 2;
842
+ return n >= e.left && n <= e.right && r >= e.top && r <= e.bottom;
843
+ }, $e = (e) => e ? {
844
+ keyboardCoordinateGetter: Ge,
845
+ keyboardCodes: {
846
+ start: ["Space", "Enter"],
847
+ cancel: ["Escape"],
848
+ end: ["Space", "Enter"]
849
+ },
850
+ accessibility: { screenReaderInstructions: { draggable: "Press Space or Enter to pick up this answer choice. Once picked up, use Tab or Shift+Tab to cycle through response areas, or use arrow keys to move it freely. Press Space or Enter to drop, or Escape to cancel." } }
851
+ } : {}, { translator: et } = O, tt = (0, I.default)("pie-elements:placement-ordering"), nt = b("div")({
852
+ color: w.text(),
853
+ backgroundColor: w.background(),
772
854
  display: "flex",
773
855
  flexDirection: "column",
774
856
  alignItems: "center",
775
857
  boxSizing: "border-box"
776
- }), ct = C("div")(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), lt = C("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), ut = C(Ae)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), dt = C(rt)(({ theme: e }) => ({
858
+ }), rt = b("div")({
859
+ alignSelf: "stretch",
860
+ maxWidth: "100%",
861
+ overflowX: "auto",
862
+ overflowY: "hidden"
863
+ }), it = b("div")({
864
+ display: "flex",
865
+ justifyContent: "center",
866
+ minWidth: "min-content"
867
+ }), at = b("div")(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), ot = b("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), st = b(ve)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), ct = b(Ye)(({ theme: e }) => ({
777
868
  marginBottom: e.spacing(2),
778
869
  alignSelf: "flex-start"
779
- })), ft = (e) => {
870
+ })), lt = (e) => {
780
871
  let { tiler: t, ordering: n, onDropChoice: r, onRemoveChoice: i, ...a } = e;
781
- return /* @__PURE__ */ A(t, {
872
+ return /* @__PURE__ */ P(t, {
782
873
  ...a,
783
874
  tiles: n.tiles,
784
875
  onDropChoice: (e, t) => r(e, t, n),
785
876
  onRemoveChoice: (e) => i(e, n)
786
877
  });
787
878
  };
788
- ft.propTypes = {
789
- tiler: P.default.func,
790
- ordering: P.default.any,
791
- onDropChoice: P.default.func,
792
- onRemoveChoice: P.default.func
879
+ lt.propTypes = {
880
+ tiler: L.default.func,
881
+ ordering: L.default.any,
882
+ onDropChoice: L.default.func,
883
+ onRemoveChoice: L.default.func
793
884
  };
794
- var pt = class extends k.Component {
885
+ var ut = class extends k.Component {
795
886
  static propTypes = {
796
- onSessionChange: P.default.func.isRequired,
797
- model: P.default.object.isRequired,
798
- session: P.default.oneOfType([P.default.array.isRequired, P.default.object.isRequired])
887
+ onSessionChange: L.default.func.isRequired,
888
+ model: L.default.object.isRequired,
889
+ session: L.default.oneOfType([L.default.array.isRequired, L.default.object.isRequired])
799
890
  };
800
891
  constructor(e) {
801
- super(e), this.instanceId = ge();
892
+ super(e), this.instanceId = r();
802
893
  let { value: t, needsReset: n } = this.validateSession(e);
803
- this.state = { showingCorrect: !1 };
804
- let { model: r } = e || {}, { env: i } = r || {}, { mode: a } = i || {};
805
- n && a === "gather" && this.props.onSessionChange({
894
+ this.state = {
895
+ showingCorrect: !1,
896
+ selectedChoice: null
897
+ }, this.lastDragEndAt = 0;
898
+ let { model: i } = e || {}, { env: a } = i || {}, { mode: o } = a || {};
899
+ n && o === "gather" && this.props.onSessionChange({
806
900
  ...e.session,
807
901
  value: t
808
902
  });
809
903
  }
810
904
  toggleCorrect = (e) => this.setState({ showingCorrect: e });
811
905
  componentDidUpdate() {
812
- _(fe.findDOMNode(this));
906
+ d(N.findDOMNode(this));
813
907
  }
814
908
  validateSession = ({ model: e, session: t }, n = !1) => {
815
- let { config: r, choices: i } = e || {}, { includeTargets: a } = r || {}, s = i.map((e) => e.id), { value: c } = t || {}, l;
816
- if (a) c && c.length !== s.length && (l = !0, c = c.length < s.length ? c.concat(Array(s.length - c.length)) : c.filter((e) => s.includes(e)));
909
+ let { config: r, choices: i } = e || {}, { includeTargets: a } = r || {}, s = i.map((e) => e.id), { value: c } = t || {}, u;
910
+ if (a) c && c.length !== s.length && (u = !0, c = c.length < s.length ? c.concat(Array(s.length - c.length)) : c.filter((e) => s.includes(e)));
817
911
  else {
818
912
  if (!c || !c.length || n) c = s;
819
913
  else {
820
- let e = M(s, c), t = M(c, s);
914
+ let e = l(s, c), t = l(c, s);
821
915
  (e.length || t.length) && (c = s);
822
916
  }
823
- l = !o(t.value, c);
917
+ u = !o(t.value, c);
824
918
  }
825
- return l && console.warn("This session is not valid anymore. It will be reset."), {
919
+ return u && console.warn("This session is not valid anymore. It will be reset."), {
826
920
  value: c,
827
- needsReset: l
921
+ needsReset: u
828
922
  };
829
923
  };
830
924
  UNSAFE_componentWillReceiveProps(e) {
831
- let { model: t = {} } = e || {}, { model: n = {} } = this.props || {}, { correctResponse: r, config: i, choices: a = [], env: o } = t, { includeTargets: s } = i || {}, c = {}, l = n.language && n.language !== t.language, u = n.note && n.note === at.t("common:commonCorrectAnswerWithAlternates", { lng: n.language });
832
- l && u && (n.note = at.t("common:commonCorrectAnswerWithAlternates", { lng: t.language })), r || (c.showingCorrect = !1);
833
- let d = et(a, n.choices), { value: f, needsReset: p } = this.validateSession(e, d), m = {
925
+ let { model: t = {} } = e || {}, { model: n = {} } = this.props || {}, { correctResponse: r, config: i, choices: a = [], env: o } = t, { includeTargets: s } = i || {}, c = {}, l = n.language && n.language !== t.language, u = n.note && n.note === et.t("common:commonCorrectAnswerWithAlternates", { lng: n.language });
926
+ l && u && (n.note = et.t("common:commonCorrectAnswerWithAlternates", { lng: t.language })), r || (c.showingCorrect = !1);
927
+ let d = We(a, n.choices), { value: f, needsReset: p } = this.validateSession(e, d), m = {
834
928
  ...e.session,
835
929
  value: f
836
930
  }, h = n.config?.includeTargets !== s;
@@ -841,8 +935,8 @@ var pt = class extends k.Component {
841
935
  }
842
936
  onDropChoice = (e, t, n) => {
843
937
  let { onSessionChange: r, session: i } = this.props, a = n.tiles.find((e) => e.id === t.id && e.type === t.type && e.index === t.index), o = e;
844
- ot("[onDropChoice] ", a, o);
845
- let s = $e({
938
+ tt("[onDropChoice] ", a, o);
939
+ let s = Ue({
846
940
  type: "move",
847
941
  from: a,
848
942
  to: o
@@ -851,8 +945,8 @@ var pt = class extends k.Component {
851
945
  };
852
946
  onRemoveChoice = (e, t) => {
853
947
  let { onSessionChange: n, session: r } = this.props;
854
- ot("[onRemoveChoice]", e);
855
- let i = $e({
948
+ tt("[onRemoveChoice]", e);
949
+ let i = Ue({
856
950
  type: "remove",
857
951
  target: e
858
952
  }, t);
@@ -863,20 +957,20 @@ var pt = class extends k.Component {
863
957
  orientation: "vertical",
864
958
  includeTargets: !0
865
959
  };
866
- return n ? Qe(e.choices, e.correctResponse, e.correctResponse.map((e) => ({
960
+ return n ? He(e.choices, e.correctResponse, e.correctResponse.map((e) => ({
867
961
  id: e,
868
962
  outcome: "correct"
869
963
  })), {
870
964
  includeTargets: r,
871
965
  allowSameChoiceInTargets: e.config.allowSameChoiceInTargets
872
- }) : Qe(e.choices, t.value, e.outcomes, {
966
+ }) : He(e.choices, t.value, e.outcomes, {
873
967
  includeTargets: r,
874
968
  allowSameChoiceInTargets: e.config.allowSameChoiceInTargets
875
969
  });
876
970
  };
877
971
  onDragEnd = (e) => {
878
972
  let { over: t, active: n } = e, r = this.createOrdering();
879
- if (t && n) {
973
+ if (this.cancelSelection(), this.lastDragEndAt = Date.now(), t && n) {
880
974
  let e = n.data.current, i = t.data.current;
881
975
  if (e && i && i.type === "target") {
882
976
  this.onDropChoice(i, e, r);
@@ -884,67 +978,113 @@ var pt = class extends k.Component {
884
978
  }
885
979
  e && i && this.onDropChoice(i, e, r);
886
980
  } else if (!t && n) {
887
- let e = n.data.current;
888
- e && e.type === "target" && this.onRemoveChoice(e, r);
981
+ let e = n.data.current, t = Qe(n.rect?.current?.initial, n.rect?.current?.translated);
982
+ e && e.type === "target" && !t && this.onRemoveChoice(e, r);
889
983
  }
890
984
  };
985
+ onDragStart = (e) => {
986
+ let { active: t } = e;
987
+ t?.data?.current && this.selectChoice(t.data.current);
988
+ };
989
+ onDragCancel = () => {
990
+ this.cancelSelection(), this.lastDragEndAt = Date.now();
991
+ };
992
+ isSameChoice = (e, t) => !!e && !!t && e.type === t.type && e.id === t.id && e.index === t.index;
993
+ selectChoice = (e) => {
994
+ this.setState({ selectedChoice: e });
995
+ };
996
+ toggleChoiceSelection = (e) => {
997
+ this.setState((t) => ({ selectedChoice: this.isSameChoice(t.selectedChoice, e) ? null : e }));
998
+ };
999
+ cancelSelection = () => {
1000
+ this.setState({ selectedChoice: null });
1001
+ };
1002
+ endAnyLiveKeyboardDrag = () => {
1003
+ document.dispatchEvent(new KeyboardEvent("keydown", {
1004
+ code: "Escape",
1005
+ bubbles: !0,
1006
+ cancelable: !0
1007
+ }));
1008
+ };
1009
+ placeSelectedChoice = (e) => {
1010
+ let { selectedChoice: t } = this.state;
1011
+ if (!t) return;
1012
+ let n = this.createOrdering();
1013
+ this.onDropChoice(e, t, n), this.cancelSelection(), this.endAnyLiveKeyboardDrag(), this.lastDragEndAt = Date.now();
1014
+ };
1015
+ isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt < Ze;
1016
+ onChoiceClick = (e) => {
1017
+ this.isClickSoonAfterDragEnd() || this.toggleChoiceSelection(e);
1018
+ };
1019
+ onPlacementClick = (e) => {
1020
+ this.isClickSoonAfterDragEnd() || this.placeSelectedChoice(e);
1021
+ };
891
1022
  render() {
892
- let { model: e } = this.props, { correctResponse: t, correctness: n, extraCSSRules: r, prompt: i, rationale: a, feedback: o, config: s, note: c, showNote: l, env: u, disabled: d, teacherInstructions: f, language: p } = e, m = t && t.length > 0, { showingCorrect: h } = this.state, g = s || {
1023
+ let { model: e } = this.props, { correctResponse: t, correctness: n, extraCSSRules: r, prompt: i, rationale: a, feedback: o, config: s, note: c, showNote: l, env: u, disabled: d, teacherInstructions: f, language: p } = e, h = t && t.length > 0, { showingCorrect: g } = this.state, _ = s || {
893
1024
  orientation: "vertical",
894
1025
  includeTargets: !0
895
- }, { orientation: _, includeTargets: v } = g, b = _ === "vertical", x = this.createOrdering(), { mode: S, role: C } = u || {}, w = b ? qe : Ke, T = (h || S === "view" && C === "instructor") && l && c, E = a && (te(a) || y(a)), ne = f && (te(f) || y(f)), D = {
896
- color: O.text(),
897
- backgroundColor: O.background(),
1026
+ }, { orientation: v, includeTargets: y } = _, b = v === "vertical", x = this.createOrdering(), { mode: S, role: T } = u || {}, D = b ? Le : Ie, O = (g || S === "view" && T === "instructor") && l && c, k = a && (m(a) || C(a)), A = f && (m(f) || C(f)), j = {
1027
+ color: w.text(),
1028
+ backgroundColor: w.background(),
898
1029
  display: "flex",
899
1030
  flexDirection: "column",
900
1031
  alignItems: "center",
901
- boxSizing: "border-box"
902
- };
903
- return /* @__PURE__ */ A(re, {
904
- onDragStart: () => {},
1032
+ boxSizing: "border-box",
1033
+ width: "100%"
1034
+ }, M = y ? {
1035
+ selectedChoice: this.state.selectedChoice,
1036
+ onChoiceClick: this.onChoiceClick,
1037
+ onPlacementClick: this.onPlacementClick
1038
+ } : {};
1039
+ return /* @__PURE__ */ P(ee, {
1040
+ onDragStart: this.onDragStart,
905
1041
  onDragEnd: this.onDragEnd,
906
- collisionDetection: ee,
907
- children: /* @__PURE__ */ A(st, { children: /* @__PURE__ */ j(tt, {
1042
+ onDragCancel: this.onDragCancel,
1043
+ collisionDetection: E,
1044
+ modifiers: [re],
1045
+ ...$e(y),
1046
+ children: /* @__PURE__ */ P(nt, { children: /* @__PURE__ */ F(qe, {
908
1047
  extraCSSRules: r,
909
- style: D,
1048
+ style: j,
910
1049
  children: [
911
- ne && /* @__PURE__ */ A(dt, {
1050
+ A && /* @__PURE__ */ P(ct, {
912
1051
  labels: {
913
1052
  hidden: "Show Teacher Instructions",
914
1053
  visible: "Hide Teacher Instructions"
915
1054
  },
916
1055
  className: "collapsible",
917
- children: /* @__PURE__ */ A(X, { prompt: f })
1056
+ children: /* @__PURE__ */ P(X, { prompt: f })
918
1057
  }),
919
- /* @__PURE__ */ A(ct, { children: /* @__PURE__ */ A(X, { prompt: i }) }),
920
- /* @__PURE__ */ A(ut, {
921
- show: m,
922
- toggled: h,
1058
+ /* @__PURE__ */ P(at, { children: /* @__PURE__ */ P(X, { prompt: i }) }),
1059
+ /* @__PURE__ */ P(st, {
1060
+ show: h,
1061
+ toggled: g,
923
1062
  onToggle: this.toggleCorrect,
924
1063
  language: p
925
1064
  }),
926
- /* @__PURE__ */ A(ft, {
1065
+ /* @__PURE__ */ P(rt, { children: /* @__PURE__ */ P(it, { children: /* @__PURE__ */ P(lt, {
927
1066
  instanceId: this.instanceId,
928
- choiceLabel: g.choiceLabel,
929
- targetLabel: g.targetLabel,
1067
+ choiceLabel: _.choiceLabel,
1068
+ targetLabel: _.targetLabel,
930
1069
  ordering: x,
931
- tiler: w,
1070
+ tiler: D,
932
1071
  disabled: d,
933
- addGuide: g.showOrdering,
934
- tileSize: g.tileSize,
935
- includeTargets: v,
936
- choiceLabelEnabled: e.config && e.config.choiceLabelEnabled
937
- }),
938
- T && /* @__PURE__ */ A(lt, { dangerouslySetInnerHTML: { __html: c } }),
939
- E && /* @__PURE__ */ A(dt, {
1072
+ addGuide: _.showOrdering,
1073
+ tileSize: _.tileSize,
1074
+ includeTargets: y,
1075
+ choiceLabelEnabled: e.config && e.config.choiceLabelEnabled,
1076
+ ...M
1077
+ }) }) }),
1078
+ O && /* @__PURE__ */ P(ot, { dangerouslySetInnerHTML: { __html: c } }),
1079
+ k && /* @__PURE__ */ P(ct, {
940
1080
  labels: {
941
1081
  hidden: "Show Rationale",
942
1082
  visible: "Hide Rationale"
943
1083
  },
944
1084
  className: "collapsible",
945
- children: /* @__PURE__ */ A(X, { prompt: a })
1085
+ children: /* @__PURE__ */ P(X, { prompt: a })
946
1086
  }),
947
- !h && /* @__PURE__ */ A(nt, {
1087
+ !g && /* @__PURE__ */ P(Je, {
948
1088
  correctness: n,
949
1089
  feedback: o
950
1090
  })
@@ -952,30 +1092,30 @@ var pt = class extends k.Component {
952
1092
  }) })
953
1093
  });
954
1094
  }
955
- }, mt = class extends k.Component {
1095
+ }, dt = class extends k.Component {
956
1096
  static propTypes = {
957
- model: P.default.object.isRequired,
958
- session: P.default.oneOfType([P.default.array.isRequired, P.default.object.isRequired]),
959
- onSessionChange: P.default.func.isRequired
1097
+ model: L.default.object.isRequired,
1098
+ session: L.default.oneOfType([L.default.array.isRequired, L.default.object.isRequired]),
1099
+ onSessionChange: L.default.func.isRequired
960
1100
  };
961
1101
  render() {
962
1102
  let { model: e, session: t, onSessionChange: n } = this.props;
963
- return /* @__PURE__ */ A(pt, {
1103
+ return /* @__PURE__ */ P(ut, {
964
1104
  model: e,
965
1105
  session: t,
966
1106
  onSessionChange: n
967
1107
  });
968
1108
  }
969
- }, $ = (0, N.default)("pie-elements:placement-ordering"), ht = ({ model: e, session: t }) => {
970
- let { config: n } = e, r = (t && p(t.value) || []).length === e.choices.length;
971
- return n.includeTargets || r;
972
- }, gt = class extends HTMLElement {
1109
+ }, $ = (0, I.default)("pie-elements:placement-ordering"), ft = ({ model: t, session: n }) => {
1110
+ let { config: r } = t, i = (n && e(n.value) || []).length === t.choices.length;
1111
+ return r.includeTargets || i;
1112
+ }, pt = class extends HTMLElement {
973
1113
  constructor() {
974
1114
  super(), this._root = null, this._mathObserver = null, this._mathRenderPending = !1;
975
1115
  }
976
1116
  _scheduleMathRender = () => {
977
1117
  this._mathRenderPending || (this._mathRenderPending = !0, requestAnimationFrame(() => {
978
- this._mathObserver && this._mathObserver.disconnect(), _(this), this._mathRenderPending = !1, setTimeout(() => {
1118
+ this._mathObserver && this._mathObserver.disconnect(), d(this), this._mathRenderPending = !1, setTimeout(() => {
979
1119
  this._mathObserver && this._mathObserver.observe(this, {
980
1120
  childList: !0,
981
1121
  subtree: !0
@@ -992,9 +1132,9 @@ var pt = class extends k.Component {
992
1132
  _disconnectMathObserver() {
993
1133
  this._mathObserver &&= (this._mathObserver.disconnect(), null);
994
1134
  }
995
- isComplete = (e) => e && p(e).length === this._model.completeLength;
1135
+ isComplete = (t) => t && e(t).length === this._model.completeLength;
996
1136
  sessionChange = (e) => {
997
- this._session.value = e.value, this.render(), this.dispatchEvent(new _e(this.tagName.toLowerCase(), this._session && this.isComplete(this._session.value)));
1137
+ this._session.value = e.value, this.render(), this.dispatchEvent(new te(this.tagName.toLowerCase(), this._session && this.isComplete(this._session.value)));
998
1138
  };
999
1139
  set model(e) {
1000
1140
  this._model = e, this.render(), this.dispatchEvent(new CustomEvent("model-set", {
@@ -1011,22 +1151,22 @@ var pt = class extends k.Component {
1011
1151
  render() {
1012
1152
  if (this._model && this._session) {
1013
1153
  $("[render] session: ", this._session.value), $("[render] model: ", this._model), this._initMathObserver();
1014
- let e = k.createElement(mt, {
1154
+ let e = k.createElement(dt, {
1015
1155
  model: this._model,
1016
1156
  session: this._session,
1017
1157
  onSessionChange: this.sessionChange
1018
1158
  });
1019
- this._root ||= de(this), this._root.render(e);
1159
+ this._root ||= M(this), this._root.render(e);
1020
1160
  }
1021
1161
  }
1022
1162
  connectedCallback() {
1023
- this._initMathObserver();
1163
+ this._initMathObserver(), this.render();
1024
1164
  }
1025
1165
  disconnectedCallback() {
1026
- this._disconnectMathObserver(), this._root && this._root.unmount();
1166
+ this._disconnectMathObserver(), this._root &&= (this._root.unmount(), null);
1027
1167
  }
1028
1168
  };
1029
1169
  //#endregion
1030
- export { gt as default, ht as isValidSession };
1170
+ export { pt as default, ft as isValidSession };
1031
1171
 
1032
1172
  //# sourceMappingURL=index.js.map