@pie-element/graphing-solution-set 6.1.2-next.0 → 6.1.2-next.2

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 (182) hide show
  1. package/dist/author/correct-response.js +67 -67
  2. package/dist/author/graphing-config.js +67 -68
  3. package/dist/author/utils.js +1 -1
  4. package/dist/browser/author/index.js +71 -71
  5. package/dist/browser/author/index.js.map +1 -1
  6. package/dist/browser/browser-pUycHh7Y.js +348 -0
  7. package/dist/browser/browser-pUycHh7Y.js.map +1 -0
  8. package/dist/browser/controller/index.js +52 -79
  9. package/dist/browser/controller/index.js.map +1 -1
  10. package/dist/browser/delivery/index.js +17 -17
  11. package/dist/browser/{dist-SjeWPldT.js → dist-B9B3lIkf.js} +13602 -17635
  12. package/dist/browser/dist-B9B3lIkf.js.map +1 -0
  13. package/dist/controller/index.d.ts +1 -1
  14. package/dist/controller/index.js +40 -42
  15. package/dist/controller/utils.d.ts +2 -2
  16. package/dist/controller/utils.js +1 -4
  17. package/dist/index.iife.js +109 -107
  18. package/dist/runtime-support.d.ts +12 -0
  19. package/dist/runtime-support.js +12 -0
  20. package/package.json +13 -10
  21. package/dist/browser/browser-DpedO01u.js +0 -1218
  22. package/dist/browser/browser-DpedO01u.js.map +0 -1
  23. package/dist/browser/dist-SjeWPldT.js.map +0 -1
  24. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
  25. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
  26. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
  27. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
  28. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
  29. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
  30. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
  31. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
  32. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
  33. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
  34. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
  35. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
  36. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
  37. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
  38. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
  39. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludes.js +0 -7
  40. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludesWith.js +0 -7
  41. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  42. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
  43. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
  44. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseDifference.js +0 -23
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +0 -7
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +0 -13
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIndexOf.js +0 -9
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNaN.js +0 -6
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSet.js +0 -22
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js +0 -27
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js +0 -9
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +0 -10
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_strictIndexOf.js +0 -7
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js +0 -12
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/last.js +0 -7
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/noop.js +0 -4
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/set.js +0 -7
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js +0 -7
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqWith.js +0 -7
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseDifference.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/uniqWith.js","../../../src/controller/defaults.ts","../../../src/controller/utils.ts","../../../src/controller/index.ts"],"sourcesContent":["import SetCache from './_SetCache.js';\nimport arrayIncludes from './_arrayIncludes.js';\nimport arrayIncludesWith from './_arrayIncludesWith.js';\nimport arrayMap from './_arrayMap.js';\nimport baseUnary from './_baseUnary.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseDifference;\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","import baseUniq from './_baseUniq.js';\n\n/**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\nfunction uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n}\n\nexport default uniqWith;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/graphing-solution-set/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\n/*\n * This file contains the default configuration for the Graphing Solution Set Item Type.\n * Model is similar to the one used in graphing item type except for the gssLineData object which handles\n * the configuration for the lines and the solution set.\n *\n * Same model is used in configure/src default.js\n * */\nexport default {\n answers: {\n correctAnswer: {\n name: 'Correct Answer',\n marks: [],\n },\n },\n arrows: {\n left: true,\n right: true,\n up: true,\n down: true,\n },\n marks: [],\n defaultGridConfiguration: 0,\n domain: {\n min: -5,\n max: 5,\n step: 1,\n labelStep: 1,\n axisLabel: 'x',\n },\n graph: {\n width: 500,\n height: 500,\n },\n gssLineData: {\n numberOfLines: 1,\n selectedTool: 'lineA',\n sections: [],\n lineA: {\n lineType: 'Solid',\n },\n },\n includeAxes: true,\n labels: {},\n labelsEnabled: true,\n padding: true,\n prompt: '',\n range: {\n min: -5,\n max: 5,\n step: 1,\n labelStep: 1,\n axisLabel: 'y',\n },\n rationale: '',\n standardGrid: false,\n title: '',\n coordinatesOnHover: false,\n promptEnabled: true,\n rationaleEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/graphing-solution-set/controller/src/utils.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 { isEqual, differenceWith, uniq, uniqWith } from 'lodash-es';\n\n/*\n * Constant to check equal segments\n * @param {Object} segment1 - segment 1\n * @param {Object} segment2 - segment 2\n * */\nexport const equalSegment = (segment1, segment2) => {\n // A.from = B.from, A.to = B.to OR A.from = B.to, A.to = B.from\n // x1 = x3 & y1 = y3 & x2 = x4 & y2 = y4\n return (\n (isEqual(segment1.from, segment2.from) && isEqual(segment1.to, segment2.to)) ||\n (isEqual(segment1.to, segment2.from) && isEqual(segment1.from, segment2.to))\n );\n};\n\n// this function is implemented in configure as well\n/*\n * Constant to get sorted answers\n * @param {Object} answers - answers\n * */\nexport const sortedAnswers = (answers) =>\n Object.keys(answers || {})\n .sort()\n .reduce((result, key) => {\n if (key !== 'correctAnswer') {\n result[key] = answers[key];\n }\n return result;\n }, {});\n\n/*\n * Constant to return line equation coefficients\n * @param {Object} line - line\n * */\nconst returnLineEquationCoefficients = (line) => {\n line = { ...line, to: { ...line.to }, from: { ...line.from } };\n const xA = line.from.x;\n const yA = line.from.y;\n const xB = line.to.x;\n const yB = line.to.y;\n return {\n a: yB - yA,\n b: xA - xB,\n c: xB * yA - xA * yB,\n };\n};\n\n/*\n * Constant to get significant decimals\n * @param {Number} number - number\n * */\nconst getSignificantDecimals = (number) => Math.round(number * 10000) / 10000;\n\n/*\n * Constant to check equal lines\n * @param {Object} line1 - line 1\n * @param {Object} line2 - line 2\n * */\nexport const equalLine = (line1, line2) => {\n // line equation: ax + by + c = 0\n // 2 lines are equal if a1/a2 = b1/b2 = c1/c2, where a, b, c are the coefficients in line equation\n // line equation knowing 2 points: (y - yA) / (yB - yA) = (x - xA) / (xB - xA)\n // extending this equation, we get: x * (yB - yA) + y * (xA - xB) + (xB * yA - xA * yB) = 0\n // where a = yB - yA; b = xA - xB; c = xB * yA - xA * yB\n const { a: a1, b: b1, c: c1 } = returnLineEquationCoefficients(line1);\n const { a: a2, b: b2, c: c2 } = returnLineEquationCoefficients(line2);\n const proportions = [];\n if (a2 !== 0) {\n proportions.push(getSignificantDecimals(a1 / a2));\n } else if (a1 !== a2) {\n return false;\n }\n if (b2 !== 0) {\n proportions.push(getSignificantDecimals(b1 / b2));\n } else if (b1 !== b2) {\n return false;\n }\n if (c2 !== 0) {\n proportions.push(getSignificantDecimals(c1 / c2));\n } else if (c1 !== c2) {\n return false;\n }\n return uniq(proportions).length === 1 && line1.fill === line2.fill;\n // (y2 - y1)/(x2 - x1) = (y4 - y3)/(x4 - x3);\n // return ((Math.abs((line1.to.y - line1.from.y) / (line1.to.x - line1.from.x))) === (Math.abs((line2.to.y - line2.from.y) / (line2.to.x - line2.from.x))));\n};\n\n/*\n * Constant to construct segments from points\n * @param {Array} points - points\n * */\nexport const constructSegmentsFromPoints = (points) => {\n // takes the list of points that represent a polygon and transforms it into a list of segments; eg.:\n // points: A, B, C, D => segments: AB, BC, CD, DA\n return (points || []).map((point, index) => ({ from: point, to: points[(index + 1) % points.length] }));\n};\n\n/*\n * Constant to remove duplicate segments\n * @param {Array} segments - segments\n * */\nexport const removeDuplicateSegments = (segments) => {\n segments = segments || [];\n // removes segments that are duplicates; eg. These segments are the same, so one will be removed:\n // segment1: from: { x: 1, y: 1 }, to: { x: 2, y: 1 }\n // segment2: from: { x: 2, y: 1 }, to: { x: 1, y: 1 }\n return uniqWith(segments, (s1, s2) => equalSegment(s1, s2));\n};\n\n/*\n * Constant to remove invalid segments\n * @param {Array} segments - segments\n * */\nexport const removeInvalidSegments = (segments) => {\n segments = segments || [];\n // removes segments that start in a point and end in the same point (eg.: from: { x: 1, y: 1 }, to: { x: 1, y: 1 })\n return segments.filter((segment) => !isEqual(segment.from, segment.to));\n};\n\n/*\n * Constant to check equal polygons\n * @param {Object} poly1 - polygon 1 points\n * @param {Object} poly2 - polygon 2 points\n * */\nexport const equalPolygon = (poly1, poly2) => {\n const { points: points1 } = poly1;\n const { points: points2 } = poly2;\n // generate segments\n const segments1 = constructSegmentsFromPoints(points1);\n const segments2 = constructSegmentsFromPoints(points2);\n const segments1NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments1));\n const segments2NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments2));\n const differentSegments1 = differenceWith(segments1NoDuplicates, segments2NoDuplicates, equalSegment);\n const differentSegments2 = differenceWith(segments2NoDuplicates, segments1NoDuplicates, equalSegment);\n return (!differentSegments1 || !differentSegments1.length) && (!differentSegments2 || !differentSegments2.length);\n};\n\n/*\n * Constant to compare equal marks\n * */\nexport const equalMarks = {\n line: (sessAnswer, mark) => equalLine(sessAnswer, mark),\n polygon: (sessAnswer, poly) => equalPolygon(sessAnswer, poly),\n};\n\n/*\n * Check if a point is correct and complete\n * @param {Object} point - point object\n * */\nconst completePoint = (point) => point && Number.isFinite(point.x) && Number.isFinite(point.y);\n\n/*\n * Check if a line is complete\n * @param {Object} item - mark object\n * */\nconst completeFromTo = (item) => item && completeMark.point(item.from) && completeMark.point(item.to);\n\n/*\n * Check if a point is correct and complete\n * @param {Object} item - mark object\n * */\nconst completePoints = (item) =>\n item &&\n item.points &&\n item.points.length &&\n (item.points.filter((point) => completePoint(point)) || []).length === item.points.length;\n\n/*\n * Complete mark object for line and point\n * */\nconst completeMark = {\n point: completePoint,\n line: completeFromTo,\n polygon: completePoints,\n};\n\n/*\n * Function to remove invalid answers\n * @param {Array} answers - answers array\n * */\nexport const removeInvalidAnswers = (answers) =>\n answers\n ? (answers || []).filter(({ type, ...answer }) => (completeMark[type] ? completeMark[type](answer) : false))\n : [];\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/graphing-solution-set/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 debug from 'debug';\nimport { cloneDeep, isEmpty, uniqWith } from 'lodash-es';\nimport defaults from './defaults.js';\nimport { equalMarks, sortedAnswers, removeInvalidAnswers } from './utils.js';\n\nconst log = debug('@pie-element:graphing-solution-set:controller');\n\nconst initializeGraphMap = () => ({\n line: [],\n});\n\n/*\n * Function to compare two marks\n * @param {Object} mark1 - first mark\n * @param {Object} mark2 - second mark\n * */\nexport const compareMarks = (mark1, mark2) => {\n // marks can be compared with equalMarks[type] function only if they have the same type;\n // if type is different, they are clearly not equal\n return !!(\n mark1 &&\n mark2 &&\n mark1.type === mark2.type &&\n equalMarks[mark1.type] &&\n equalMarks[mark1.type](mark1, mark2)\n );\n};\n\n/*\n * Function to get the corrected answer\n * @param {Object} sessionAnswers - array of marks from session\n * @param {Object} marks - array of marks from correct answer\n * */\nexport const getAnswerCorrected = ({ sessionAnswers, marks: correctAnswers }) => {\n sessionAnswers = sessionAnswers || [];\n correctAnswers = correctAnswers || [];\n const rez = cloneDeep(sessionAnswers).reduce((correctedAnswer, answer) => {\n const answerIsCorrect = correctAnswers.find((mark) => compareMarks(answer, mark));\n answer.correctness = answerIsCorrect ? 'correct' : 'incorrect';\n return [...correctedAnswer, answer];\n }, []);\n // add missing objects from correct answer\n const missingAnswers = cloneDeep(correctAnswers).reduce((correctedAnswer, answer) => {\n const answerIndex = sessionAnswers.find((mark) => compareMarks(answer, mark));\n if (!answerIndex) {\n // means that corrected answer is missing from session, so we mark it as missing object\n return [...correctedAnswer, { ...answer, correctness: 'missing' }];\n }\n return correctedAnswer;\n }, []);\n return [...rez, ...missingAnswers];\n};\n\n/*\n * Function to get the best answer\n * @param {Object} question - question object\n * @param {Object} session - session object\n * @param {Object} env - env object\n * */\nexport const getBestAnswer = (question, session, env = {}) => {\n // questionPossibleAnswers contains all possible answers (correct response and alternates);\n let { answers: questionPossibleAnswers = {}, scoringType } = question || {};\n let { answer } = session || {};\n // filter the incomplete objects\n Object.entries(questionPossibleAnswers || {}).forEach(\n ([key, value]) =>\n (questionPossibleAnswers[key] = { ...value, marks: value?.marks.filter((mark) => !mark.building) }),\n );\n // initialize answer if no values\n answer = answer || [];\n // initialize one possible answer if no values\n if (isEmpty(questionPossibleAnswers)) {\n questionPossibleAnswers = { correctAnswer: initializeGraphMap() };\n } else {\n questionPossibleAnswers = {\n correctAnswer: questionPossibleAnswers.correctAnswer,\n ...sortedAnswers(questionPossibleAnswers),\n };\n }\n // student's answers without DUPLICATES\n const sessionAnswers = uniqWith(answer, compareMarks);\n // array of possible answers entries\n const possibleAnswers = Object.entries(questionPossibleAnswers);\n return possibleAnswers.reduce(\n (acc, entry) => {\n // iterating each possible answer (main + alternates)\n const possibleAnswerKey = entry[0];\n const possibleAnswer = entry[1] || {};\n let { marks } = possibleAnswer;\n if (!marks || !marks.length) {\n return acc;\n }\n // returns array of marks, each having 'correctness' property\n const correctedAnswer = getAnswerCorrected({ sessionAnswers, marks });\n const correctMarks = correctedAnswer.filter((answer) => answer.correctness === 'correct');\n // filter out missing objects because they do not affect the calculation of the score\n // only correct and incorrect are needed\n const scoredCorrectedAnswer = correctedAnswer.filter((answer) => answer.correctness !== 'missing');\n const maxScore = marks.length;\n let score = correctMarks.length;\n // if extra placements\n if (scoredCorrectedAnswer.length > maxScore) {\n score -= scoredCorrectedAnswer.length - maxScore;\n }\n if (score < 0) {\n score = 0;\n }\n if (score / maxScore > acc.bestScore || !acc.foundOneSolution) {\n acc.bestScore = Math.floor(score / maxScore);\n acc.bestScoreAnswerKey = possibleAnswerKey;\n acc.answersCorrected = correctedAnswer;\n acc.foundOneSolution = true;\n }\n return acc;\n },\n {\n bestScore: 0,\n bestScoreAnswerKey: null,\n // initially we just suppose all the answers are incorrect\n answersCorrected: cloneDeep(sessionAnswers).map((answer) => ({ ...answer, correctness: 'incorrect' })),\n foundOneSolution: false,\n },\n );\n};\n\n/*\n * Constant normalize\n * @param {Object} question - question object\n * */\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/*\n * Function to set model\n * @param {Object} question - question object\n * @param {Object} session - session object\n * @param {Object} env - env object\n * */\nexport function model(question, session, env) {\n return new Promise((resolve) => {\n const normalizedQuestion = normalize(question);\n // ensure removing of invalid answers\n // need this if undo redo was last operation\n session.answer = removeInvalidAnswers(session.answer);\n // console.log('normalizedQuestion', normalizedQuestion);\n const { defaultTool, extraCSSRules, prompt, promptEnabled, graph, answers, toolbarTools, ...questionProps } =\n normalizedQuestion || {};\n let { arrows } = normalizedQuestion;\n const { mode, role } = env || {};\n\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in authoring : packages/graphing/configure/src/configure.jsx - componentDidMount\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = {\n left: true,\n right: true,\n up: true,\n down: true,\n };\n } else {\n arrows = {\n left: false,\n right: false,\n up: false,\n down: false,\n };\n }\n }\n\n const base = {\n ...questionProps,\n answers,\n arrows,\n defaultTool: 'line',\n disabled: env.mode !== 'gather',\n prompt: promptEnabled ? prompt : null,\n rationale: null,\n size: graph,\n showToggle:\n env.mode === 'evaluate' &&\n !isEmpty(answers) &&\n answers.correctAnswer &&\n answers.correctAnswer.marks &&\n !isEmpty(answers.correctAnswer.marks),\n teacherInstructions: null,\n toolbarTools,\n extraCSSRules,\n };\n\n if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {\n const { rationale, rationaleEnabled, teacherInstructions, teacherInstructionsEnabled } = normalizedQuestion || {};\n\n base.rationale = rationaleEnabled ? rationale : null;\n base.teacherInstructions = teacherInstructionsEnabled ? teacherInstructions : null;\n }\n\n if (mode === 'evaluate') {\n if (\n !isEmpty(answers) &&\n answers.correctAnswer &&\n answers.correctAnswer.marks &&\n !isEmpty(answers.correctAnswer.marks)\n ) {\n const { answersCorrected, bestScoreAnswerKey, bestScore } = getBestAnswer(normalizedQuestion, session, env);\n // array of marks from session with 'correctness' property set\n base.answersCorrected = answersCorrected;\n base.correctResponse = bestScoreAnswerKey ? (answers[bestScoreAnswerKey] || {}).marks : [];\n base.showToggle = base.showToggle && bestScore !== 1;\n } else {\n base.answersCorrected = (session && session.answer) || [];\n base.correctResponse = [];\n }\n }\n\n log('base: ', base);\n resolve(base);\n });\n}\n\n/*\n * Function to check the outcome\n * @param {Object} question - question object\n * @param {Object} session - session object\n * @param {Object} env - env object\n * */\nexport function outcome(question, session, env = {}) {\n return new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true });\n }\n if (\n env.mode !== 'evaluate' ||\n isEmpty(question.answers) ||\n (question.answers && question.answers.correctAnswer && isEmpty(question.answers.correctAnswer.marks))\n ) {\n resolve({ score: 0 });\n }\n const { bestScore } = getBestAnswer(question, session, env);\n resolve({ score: bestScore });\n });\n}\n\n/*\n * Constant to create correct response session\n * @param {Object} question - question object\n * @param {Object} env - env object\n * */\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { answers } = question || {};\n let marks = [];\n if (answers && Object.values(answers)) {\n const correctAnswer = answers.correctAnswer || Object.values(answers)[0] || {};\n marks = correctAnswer.marks || [];\n }\n resolve({\n answer: marks,\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n/*\n * Constant to validate model before saving item\n * @param {Object} model - model object\n * */\nexport const validate = (model = {}) => {\n const { answers, gssLineData } = model;\n const errors = {};\n const correctAnswerErrors = {};\n let found = false;\n if (gssLineData.numberOfLines === 1) {\n if (answers.correctAnswer.marks.length < 1) {\n found = true;\n correctAnswerErrors.correctAnswer = 'At least 1 line object should be defined.';\n } else if (answers.correctAnswer.marks.length === 1 && answers.correctAnswer.marks[0].building) {\n found = true;\n correctAnswerErrors.correctAnswer = '1 or more graph object should be correctly defined.';\n }\n } else {\n if (answers.correctAnswer.marks.length < 2) {\n found = true;\n correctAnswerErrors.correctAnswer = 'At least 2 line object should be defined.';\n } else if (answers.correctAnswer.marks.length === 2) {\n if (answers.correctAnswer.marks[0].building || answers.correctAnswer.marks[1].building) {\n found = true;\n correctAnswerErrors.correctAnswer = '1 or more graph object should be correctly defined.';\n }\n }\n }\n let polygon = answers.correctAnswer.marks.find((mark) => mark.type === 'polygon');\n if (!found && (!gssLineData.selectedTool === 'solutionSet' || !polygon)) {\n correctAnswerErrors.correctAnswer = 'Please select a solution set for the graphing solution set item.';\n }\n if (!isEmpty(correctAnswerErrors)) {\n errors.correctAnswerErrors = correctAnswerErrors;\n }\n return errors;\n};\n"],"x_google_ignoreList":[0,1,2],"mappings":";;AAQA,IAAI,IAAmB;AAavB,SAAS,EA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AS,MAAY;CAC9B,IAAI,EAAI,SAAS,cAAc,EAAI,SAAS,cAAc;EACxD,IAAM,EAAE,eAAY,KAAY,CAAC,GAC7B,IAAQ,CAAC;EAKb,AAJI,KAAW,OAAO,OAAO,CAAO,MAElC,KADsB,EAAQ,iBAAiB,OAAO,OAAO,CAAO,EAAE,MAAM,CAAC,GACvD,SAAS,CAAC,IAElC,EAAQ;GACN,QAAQ;GACR,IAAI;EACN,CAAC;CACH,OACE,EAAQ,IAAI;AAEhB,CAAC,GAOU,KAAY,IAAQ,CAAC,MAAM;CACtC,IAAM,EAAE,YAAS,mBAAgB,GAC3B,IAAS,CAAC,GACV,IAAsB,CAAC,GACzB,IAAQ;CACZ,AAAI,EAAY,kBAAkB,IAC5B,EAAQ,cAAc,MAAM,SAAS,KACvC,IAAQ,IACR,EAAoB,gBAAgB,+CAC3B,EAAQ,cAAc,MAAM,WAAW,KAAK,EAAQ,cAAc,MAAM,GAAG,aACpF,IAAQ,IACR,EAAoB,gBAAgB,yDAGlC,EAAQ,cAAc,MAAM,SAAS,KACvC,IAAQ,IACR,EAAoB,gBAAgB,+CAC3B,EAAQ,cAAc,MAAM,WAAW,MAC5C,EAAQ,cAAc,MAAM,GAAG,YAAY,EAAQ,cAAc,MAAM,GAAG,cAC5E,IAAQ,IACR,EAAoB,gBAAgB;CAI1C,IAAI,IAAU,EAAQ,cAAc,MAAM,MAAM,MAAS,EAAK,SAAS,SAAS;CAOhF,OANI,CAAC,MAAU,CAAC,EAAY,iBAAiB,iBAAiB,CAAC,OAC7D,EAAoB,gBAAgB,qEAEjC,EAAQ,CAAmB,MAC9B,EAAO,sBAAsB,IAExB;AACT"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/controller/defaults.ts","../../../src/controller/utils.ts","../../../src/controller/index.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/graphing-solution-set/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\n/*\n * This file contains the default configuration for the Graphing Solution Set Item Type.\n * Model is similar to the one used in graphing item type except for the gssLineData object which handles\n * the configuration for the lines and the solution set.\n *\n * Same model is used in configure/src default.js\n * */\nexport default {\n answers: {\n correctAnswer: {\n name: 'Correct Answer',\n marks: [],\n },\n },\n arrows: {\n left: true,\n right: true,\n up: true,\n down: true,\n },\n marks: [],\n defaultGridConfiguration: 0,\n domain: {\n min: -5,\n max: 5,\n step: 1,\n labelStep: 1,\n axisLabel: 'x',\n },\n graph: {\n width: 500,\n height: 500,\n },\n gssLineData: {\n numberOfLines: 1,\n selectedTool: 'lineA',\n sections: [],\n lineA: {\n lineType: 'Solid',\n },\n },\n includeAxes: true,\n labels: {},\n labelsEnabled: true,\n padding: true,\n prompt: '',\n range: {\n min: -5,\n max: 5,\n step: 1,\n labelStep: 1,\n axisLabel: 'y',\n },\n rationale: '',\n standardGrid: false,\n title: '',\n coordinatesOnHover: false,\n promptEnabled: true,\n rationaleEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/graphing-solution-set/controller/src/utils.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 { isEqual, differenceWith, uniq, uniqWith } from '@pie-element/shared-lodash';\n\n/*\n * Constant to check equal segments\n * @param {Object} segment1 - segment 1\n * @param {Object} segment2 - segment 2\n * */\nexport const equalSegment = (segment1, segment2) => {\n // A.from = B.from, A.to = B.to OR A.from = B.to, A.to = B.from\n // x1 = x3 & y1 = y3 & x2 = x4 & y2 = y4\n return (\n (isEqual(segment1.from, segment2.from) && isEqual(segment1.to, segment2.to)) ||\n (isEqual(segment1.to, segment2.from) && isEqual(segment1.from, segment2.to))\n );\n};\n\n// this function is implemented in configure as well\n/*\n * Constant to get sorted answers\n * @param {Object} answers - answers\n * */\nexport const sortedAnswers = (answers) =>\n Object.keys(answers || {})\n .sort()\n .reduce((result, key) => {\n if (key !== 'correctAnswer') {\n result[key] = answers[key];\n }\n return result;\n }, {});\n\n/*\n * Constant to return line equation coefficients\n * @param {Object} line - line\n * */\nconst returnLineEquationCoefficients = (line) => {\n line = { ...line, to: { ...line.to }, from: { ...line.from } };\n const xA = line.from.x;\n const yA = line.from.y;\n const xB = line.to.x;\n const yB = line.to.y;\n return {\n a: yB - yA,\n b: xA - xB,\n c: xB * yA - xA * yB,\n };\n};\n\n/*\n * Constant to get significant decimals\n * @param {Number} number - number\n * */\nconst getSignificantDecimals = (number) => Math.round(number * 10000) / 10000;\n\n/*\n * Constant to check equal lines\n * @param {Object} line1 - line 1\n * @param {Object} line2 - line 2\n * */\nexport const equalLine = (line1, line2) => {\n // line equation: ax + by + c = 0\n // 2 lines are equal if a1/a2 = b1/b2 = c1/c2, where a, b, c are the coefficients in line equation\n // line equation knowing 2 points: (y - yA) / (yB - yA) = (x - xA) / (xB - xA)\n // extending this equation, we get: x * (yB - yA) + y * (xA - xB) + (xB * yA - xA * yB) = 0\n // where a = yB - yA; b = xA - xB; c = xB * yA - xA * yB\n const { a: a1, b: b1, c: c1 } = returnLineEquationCoefficients(line1);\n const { a: a2, b: b2, c: c2 } = returnLineEquationCoefficients(line2);\n const proportions = [];\n if (a2 !== 0) {\n proportions.push(getSignificantDecimals(a1 / a2));\n } else if (a1 !== a2) {\n return false;\n }\n if (b2 !== 0) {\n proportions.push(getSignificantDecimals(b1 / b2));\n } else if (b1 !== b2) {\n return false;\n }\n if (c2 !== 0) {\n proportions.push(getSignificantDecimals(c1 / c2));\n } else if (c1 !== c2) {\n return false;\n }\n return uniq(proportions).length === 1 && line1.fill === line2.fill;\n // (y2 - y1)/(x2 - x1) = (y4 - y3)/(x4 - x3);\n // return ((Math.abs((line1.to.y - line1.from.y) / (line1.to.x - line1.from.x))) === (Math.abs((line2.to.y - line2.from.y) / (line2.to.x - line2.from.x))));\n};\n\n/*\n * Constant to construct segments from points\n * @param {Array} points - points\n * */\nexport const constructSegmentsFromPoints = (points) => {\n // takes the list of points that represent a polygon and transforms it into a list of segments; eg.:\n // points: A, B, C, D => segments: AB, BC, CD, DA\n return (points || []).map((point, index) => ({ from: point, to: points[(index + 1) % points.length] }));\n};\n\n/*\n * Constant to remove duplicate segments\n * @param {Array} segments - segments\n * */\nexport const removeDuplicateSegments = (segments) => {\n segments = segments || [];\n // removes segments that are duplicates; eg. These segments are the same, so one will be removed:\n // segment1: from: { x: 1, y: 1 }, to: { x: 2, y: 1 }\n // segment2: from: { x: 2, y: 1 }, to: { x: 1, y: 1 }\n return uniqWith(segments, (s1, s2) => equalSegment(s1, s2));\n};\n\n/*\n * Constant to remove invalid segments\n * @param {Array} segments - segments\n * */\nexport const removeInvalidSegments = (segments) => {\n segments = segments || [];\n // removes segments that start in a point and end in the same point (eg.: from: { x: 1, y: 1 }, to: { x: 1, y: 1 })\n return segments.filter((segment) => !isEqual(segment.from, segment.to));\n};\n\n/*\n * Constant to check equal polygons\n * @param {Object} poly1 - polygon 1 points\n * @param {Object} poly2 - polygon 2 points\n * */\nexport const equalPolygon = (poly1, poly2) => {\n const { points: points1 } = poly1;\n const { points: points2 } = poly2;\n // generate segments\n const segments1 = constructSegmentsFromPoints(points1);\n const segments2 = constructSegmentsFromPoints(points2);\n const segments1NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments1));\n const segments2NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments2));\n const differentSegments1 = differenceWith(segments1NoDuplicates, segments2NoDuplicates, equalSegment);\n const differentSegments2 = differenceWith(segments2NoDuplicates, segments1NoDuplicates, equalSegment);\n return (!differentSegments1 || !differentSegments1.length) && (!differentSegments2 || !differentSegments2.length);\n};\n\n/*\n * Constant to compare equal marks\n * */\nexport const equalMarks = {\n line: (sessAnswer, mark) => equalLine(sessAnswer, mark),\n polygon: (sessAnswer, poly) => equalPolygon(sessAnswer, poly),\n};\n\n/*\n * Check if a point is correct and complete\n * @param {Object} point - point object\n * */\nconst completePoint = (point) => point && Number.isFinite(point.x) && Number.isFinite(point.y);\n\n/*\n * Check if a line is complete\n * @param {Object} item - mark object\n * */\nconst completeFromTo = (item) => item && completeMark.point(item.from) && completeMark.point(item.to);\n\n/*\n * Check if a point is correct and complete\n * @param {Object} item - mark object\n * */\nconst completePoints = (item) =>\n item &&\n item.points &&\n item.points.length &&\n (item.points.filter((point) => completePoint(point)) || []).length === item.points.length;\n\n/*\n * Complete mark object for line and point\n * */\nconst completeMark = {\n point: completePoint,\n line: completeFromTo,\n polygon: completePoints,\n};\n\n/*\n * Function to remove invalid answers\n * @param {Array} answers - answers array\n * */\nexport const removeInvalidAnswers = (answers) =>\n answers\n ? (answers || []).filter(({ type, ...answer }) => (completeMark[type] ? completeMark[type](answer) : false))\n : [];\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/graphing-solution-set/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 debug from 'debug';\nimport { cloneDeep, isEmpty, uniqWith } from '@pie-element/shared-lodash';\nimport defaults from './defaults.js';\nimport { equalMarks, sortedAnswers, removeInvalidAnswers } from './utils.js';\n\nconst log = debug('@pie-element:graphing-solution-set:controller');\n\nconst initializeGraphMap = () => ({\n line: [],\n});\n\n/*\n * Function to compare two marks\n * @param {Object} mark1 - first mark\n * @param {Object} mark2 - second mark\n * */\nexport const compareMarks = (mark1, mark2) => {\n // marks can be compared with equalMarks[type] function only if they have the same type;\n // if type is different, they are clearly not equal\n return !!(\n mark1 &&\n mark2 &&\n mark1.type === mark2.type &&\n equalMarks[mark1.type] &&\n equalMarks[mark1.type](mark1, mark2)\n );\n};\n\n/*\n * Function to get the corrected answer\n * @param {Object} sessionAnswers - array of marks from session\n * @param {Object} marks - array of marks from correct answer\n * */\nexport const getAnswerCorrected = ({ sessionAnswers, marks: correctAnswers }) => {\n sessionAnswers = sessionAnswers || [];\n correctAnswers = correctAnswers || [];\n const rez = cloneDeep(sessionAnswers).reduce((correctedAnswer, answer) => {\n const answerIsCorrect = correctAnswers.find((mark) => compareMarks(answer, mark));\n answer.correctness = answerIsCorrect ? 'correct' : 'incorrect';\n return [...correctedAnswer, answer];\n }, []);\n // add missing objects from correct answer\n const missingAnswers = cloneDeep(correctAnswers).reduce((correctedAnswer, answer) => {\n const answerIndex = sessionAnswers.find((mark) => compareMarks(answer, mark));\n if (!answerIndex) {\n // means that corrected answer is missing from session, so we mark it as missing object\n return [...correctedAnswer, { ...answer, correctness: 'missing' }];\n }\n return correctedAnswer;\n }, []);\n return [...rez, ...missingAnswers];\n};\n\n/*\n * Function to get the best answer\n * @param {Object} question - question object\n * @param {Object} session - session object\n * @param {Object} env - env object\n * */\nexport const getBestAnswer = (question, session, env = {}) => {\n // questionPossibleAnswers contains all possible answers (correct response and alternates);\n let { answers: questionPossibleAnswers = {}, scoringType } = question || {};\n let { answer } = session || {};\n // filter the incomplete objects\n Object.entries(questionPossibleAnswers || {}).forEach(\n ([key, value]) =>\n (questionPossibleAnswers[key] = { ...value, marks: value?.marks.filter((mark) => !mark.building) }),\n );\n // initialize answer if no values\n answer = answer || [];\n // initialize one possible answer if no values\n if (isEmpty(questionPossibleAnswers)) {\n questionPossibleAnswers = { correctAnswer: initializeGraphMap() };\n } else {\n questionPossibleAnswers = {\n correctAnswer: questionPossibleAnswers.correctAnswer,\n ...sortedAnswers(questionPossibleAnswers),\n };\n }\n // student's answers without DUPLICATES\n const sessionAnswers = uniqWith(answer, compareMarks);\n // array of possible answers entries\n const possibleAnswers = Object.entries(questionPossibleAnswers);\n return possibleAnswers.reduce(\n (acc, entry) => {\n // iterating each possible answer (main + alternates)\n const possibleAnswerKey = entry[0];\n const possibleAnswer = entry[1] || {};\n let { marks } = possibleAnswer;\n if (!marks || !marks.length) {\n return acc;\n }\n // returns array of marks, each having 'correctness' property\n const correctedAnswer = getAnswerCorrected({ sessionAnswers, marks });\n const correctMarks = correctedAnswer.filter((answer) => answer.correctness === 'correct');\n // filter out missing objects because they do not affect the calculation of the score\n // only correct and incorrect are needed\n const scoredCorrectedAnswer = correctedAnswer.filter((answer) => answer.correctness !== 'missing');\n const maxScore = marks.length;\n let score = correctMarks.length;\n // if extra placements\n if (scoredCorrectedAnswer.length > maxScore) {\n score -= scoredCorrectedAnswer.length - maxScore;\n }\n if (score < 0) {\n score = 0;\n }\n if (score / maxScore > acc.bestScore || !acc.foundOneSolution) {\n acc.bestScore = Math.floor(score / maxScore);\n acc.bestScoreAnswerKey = possibleAnswerKey;\n acc.answersCorrected = correctedAnswer;\n acc.foundOneSolution = true;\n }\n return acc;\n },\n {\n bestScore: 0,\n bestScoreAnswerKey: null,\n // initially we just suppose all the answers are incorrect\n answersCorrected: cloneDeep(sessionAnswers).map((answer) => ({ ...answer, correctness: 'incorrect' })),\n foundOneSolution: false,\n },\n );\n};\n\n/*\n * Constant normalize\n * @param {Object} question - question object\n * */\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/*\n * Function to set model\n * @param {Object} question - question object\n * @param {Object} session - session object\n * @param {Object} env - env object\n * */\nexport function model(question, session, env) {\n return new Promise((resolve) => {\n const normalizedQuestion = normalize(question);\n // ensure removing of invalid answers\n // need this if undo redo was last operation\n session.answer = removeInvalidAnswers(session.answer);\n // console.log('normalizedQuestion', normalizedQuestion);\n const { defaultTool, extraCSSRules, prompt, promptEnabled, graph, answers, toolbarTools, ...questionProps } =\n normalizedQuestion || {};\n let { arrows } = normalizedQuestion;\n const { mode, role } = env || {};\n\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in authoring : packages/graphing/configure/src/configure.jsx - componentDidMount\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = {\n left: true,\n right: true,\n up: true,\n down: true,\n };\n } else {\n arrows = {\n left: false,\n right: false,\n up: false,\n down: false,\n };\n }\n }\n\n const base = {\n ...questionProps,\n answers,\n arrows,\n defaultTool: 'line',\n disabled: env.mode !== 'gather',\n prompt: promptEnabled ? prompt : null,\n rationale: null,\n size: graph,\n showToggle:\n env.mode === 'evaluate' &&\n !isEmpty(answers) &&\n answers.correctAnswer &&\n answers.correctAnswer.marks &&\n !isEmpty(answers.correctAnswer.marks),\n teacherInstructions: null,\n toolbarTools,\n extraCSSRules,\n };\n\n if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {\n const { rationale, rationaleEnabled, teacherInstructions, teacherInstructionsEnabled } = normalizedQuestion || {};\n\n base.rationale = rationaleEnabled ? rationale : null;\n base.teacherInstructions = teacherInstructionsEnabled ? teacherInstructions : null;\n }\n\n if (mode === 'evaluate') {\n if (\n !isEmpty(answers) &&\n answers.correctAnswer &&\n answers.correctAnswer.marks &&\n !isEmpty(answers.correctAnswer.marks)\n ) {\n const { answersCorrected, bestScoreAnswerKey, bestScore } = getBestAnswer(normalizedQuestion, session, env);\n // array of marks from session with 'correctness' property set\n base.answersCorrected = answersCorrected;\n base.correctResponse = bestScoreAnswerKey ? (answers[bestScoreAnswerKey] || {}).marks : [];\n base.showToggle = base.showToggle && bestScore !== 1;\n } else {\n base.answersCorrected = (session && session.answer) || [];\n base.correctResponse = [];\n }\n }\n\n log('base: ', base);\n resolve(base);\n });\n}\n\n/*\n * Function to check the outcome\n * @param {Object} question - question object\n * @param {Object} session - session object\n * @param {Object} env - env object\n * */\nexport function outcome(question, session, env = {}) {\n return new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true });\n }\n if (\n env.mode !== 'evaluate' ||\n isEmpty(question.answers) ||\n (question.answers && question.answers.correctAnswer && isEmpty(question.answers.correctAnswer.marks))\n ) {\n resolve({ score: 0 });\n }\n const { bestScore } = getBestAnswer(question, session, env);\n resolve({ score: bestScore });\n });\n}\n\n/*\n * Constant to create correct response session\n * @param {Object} question - question object\n * @param {Object} env - env object\n * */\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { answers } = question || {};\n let marks = [];\n if (answers && Object.values(answers)) {\n const correctAnswer = answers.correctAnswer || Object.values(answers)[0] || {};\n marks = correctAnswer.marks || [];\n }\n resolve({\n answer: marks,\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n/*\n * Constant to validate model before saving item\n * @param {Object} model - model object\n * */\nexport const validate = (model = {}) => {\n const { answers, gssLineData } = model;\n const errors = {};\n const correctAnswerErrors = {};\n let found = false;\n if (gssLineData.numberOfLines === 1) {\n if (answers.correctAnswer.marks.length < 1) {\n found = true;\n correctAnswerErrors.correctAnswer = 'At least 1 line object should be defined.';\n } else if (answers.correctAnswer.marks.length === 1 && answers.correctAnswer.marks[0].building) {\n found = true;\n correctAnswerErrors.correctAnswer = '1 or more graph object should be correctly defined.';\n }\n } else {\n if (answers.correctAnswer.marks.length < 2) {\n found = true;\n correctAnswerErrors.correctAnswer = 'At least 2 line object should be defined.';\n } else if (answers.correctAnswer.marks.length === 2) {\n if (answers.correctAnswer.marks[0].building || answers.correctAnswer.marks[1].building) {\n found = true;\n correctAnswerErrors.correctAnswer = '1 or more graph object should be correctly defined.';\n }\n }\n }\n let polygon = answers.correctAnswer.marks.find((mark) => mark.type === 'polygon');\n if (!found && (!gssLineData.selectedTool === 'solutionSet' || !polygon)) {\n correctAnswerErrors.correctAnswer = 'Please select a solution set for the graphing solution set item.';\n }\n if (!isEmpty(correctAnswerErrors)) {\n errors.correctAnswerErrors = correctAnswerErrors;\n }\n return errors;\n};\n"],"mappings":";;mCAiBA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,GCtDa,KAAgB,GAAU,MAIlC,EAAQ,EAAS,MAAM,EAAS,IAAI,KAAK,EAAQ,EAAS,IAAI,EAAS,EAAE,KACzE,EAAQ,EAAS,IAAI,EAAS,IAAI,KAAK,EAAQ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S,cAAc;EACxD,IAAM,EAAE,eAAY,KAAY,CAAC,GAC7B,IAAQ,CAAC;EAKb,AAJI,KAAW,OAAO,OAAO,CAAO,MAElC,KADsB,EAAQ,iBAAiB,OAAO,OAAO,CAAO,EAAE,MAAM,CAAC,GACvD,SAAS,CAAC,IAElC,EAAQ;GACN,QAAQ;GACR,IAAI;EACN,CAAC;CACH,OACE,EAAQ,IAAI;AAEhB,CAAC,GAOU,KAAY,IAAQ,CAAC,MAAM;CACtC,IAAM,EAAE,YAAS,mBAAgB,GAC3B,IAAS,CAAC,GACV,IAAsB,CAAC,GACzB,IAAQ;CACZ,AAAI,EAAY,kBAAkB,IAC5B,EAAQ,cAAc,MAAM,SAAS,KACvC,IAAQ,IACR,EAAoB,gBAAgB,+CAC3B,EAAQ,cAAc,MAAM,WAAW,KAAK,EAAQ,cAAc,MAAM,GAAG,aACpF,IAAQ,IACR,EAAoB,gBAAgB,yDAGlC,EAAQ,cAAc,MAAM,SAAS,KACvC,IAAQ,IACR,EAAoB,gBAAgB,+CAC3B,EAAQ,cAAc,MAAM,WAAW,MAC5C,EAAQ,cAAc,MAAM,GAAG,YAAY,EAAQ,cAAc,MAAM,GAAG,cAC5E,IAAQ,IACR,EAAoB,gBAAgB;CAI1C,IAAI,IAAU,EAAQ,cAAc,MAAM,MAAM,MAAS,EAAK,SAAS,SAAS;CAOhF,OANI,CAAC,MAAU,CAAC,EAAY,iBAAiB,iBAAiB,CAAC,OAC7D,EAAoB,gBAAgB,qEAEjC,EAAQ,CAAmB,MAC9B,EAAO,sBAAsB,IAExB;AACT"}
@@ -1,5 +1,5 @@
1
- import { V as e } from "../browser-DpedO01u.js";
2
- import { A as t, C as n, F as r, I as i, R as a, S as o, T as s, U as c, W as l, k as u, l as d, o as ee, s as f, w as p, x as m } from "../dist-SjeWPldT.js";
1
+ import { E as e } from "../browser-pUycHh7Y.js";
2
+ import { A as t, C as n, F as r, H as i, I as a, L as o, S as s, T as c, U as l, k as u, l as d, o as ee, s as f, w as p, x as m } from "../dist-B9B3lIkf.js";
3
3
  import h, { useRef as g } from "react";
4
4
  import { createRoot as _ } from "react-dom/client";
5
5
  import { jsx as v, jsxs as y } from "react/jsx-runtime";
@@ -251,7 +251,7 @@ var b = class e extends CustomEvent {
251
251
  if (t.length === 1) return !t[0].building;
252
252
  } else if (t.length !== 2) return !1;
253
253
  else return !t[1].building;
254
- }, ae = (e) => e ? (e || []).filter(({ type: e, ...t }) => x[e] ? x[e](t) : !1) : [], I = /* @__PURE__ */ e(c(), 1), L = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ y("svg", {
254
+ }, ae = (e) => e ? (e || []).filter(({ type: e, ...t }) => x[e] ? x[e](t) : !1) : [], I = /* @__PURE__ */ e(i(), 1), L = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ y("svg", {
255
255
  preserveAspectRatio: "xMinYMin meet",
256
256
  version: "1.1",
257
257
  viewBox: "-283 359 34 35",
@@ -322,7 +322,7 @@ R.propTypes = {
322
322
  fgFill: I.default.string.isRequired,
323
323
  borderFill: I.default.string.isRequired
324
324
  };
325
- var oe = a("div")(({ size: e }) => ({
325
+ var oe = o("div")(({ size: e }) => ({
326
326
  width: e || "25px",
327
327
  height: e || "25px"
328
328
  })), z = ({ open: e, size: t }) => /* @__PURE__ */ v(oe, {
@@ -342,7 +342,7 @@ z.propTypes = {
342
342
  }, z.defaultProps = { open: !1 };
343
343
  //#endregion
344
344
  //#region ../../lib-react/correct-answer-toggle/dist/expander.js
345
- var B = "height ease-in 300ms, opacity ease-in 300ms", se = a("div")(() => ({
345
+ var B = "height ease-in 300ms, opacity ease-in 300ms", se = o("div")(() => ({
346
346
  position: "relative",
347
347
  height: 0,
348
348
  overflow: "hidden",
@@ -417,22 +417,22 @@ var ce = U(p, "Readable") || U(le.Readable, "Readable"), W = m, G = W.default, l
417
417
  MozUserSelect: "none",
418
418
  msUserSelect: "none",
419
419
  userSelect: "none"
420
- }, de = a("div")(() => ({
420
+ }, de = o("div")(() => ({
421
421
  width: "100%",
422
422
  cursor: "pointer"
423
- })), fe = a("div")(() => ({
423
+ })), fe = o("div")(() => ({
424
424
  margin: "0 auto",
425
425
  textAlign: "center",
426
426
  display: "flex"
427
- })), pe = a("div")(() => ({
427
+ })), pe = o("div")(() => ({
428
428
  width: "fit-content",
429
429
  minWidth: "140px",
430
430
  alignSelf: "center",
431
431
  verticalAlign: "middle",
432
- color: `var(--correct-answer-toggle-label-color, ${i.text()})`,
432
+ color: `var(--correct-answer-toggle-label-color, ${a.text()})`,
433
433
  fontWeight: "normal",
434
434
  ...ue
435
- })), q = a("div")(() => ({
435
+ })), q = o("div")(() => ({
436
436
  position: "absolute",
437
437
  width: "25px",
438
438
  "&.enter": { opacity: "0" },
@@ -445,7 +445,7 @@ var ce = U(p, "Readable") || U(le.Readable, "Readable"), W = m, G = W.default, l
445
445
  opacity: "0",
446
446
  transition: "opacity 0.3s ease-in"
447
447
  }
448
- })), me = a("div")(() => ({
448
+ })), me = o("div")(() => ({
449
449
  width: "25px",
450
450
  marginRight: "5px",
451
451
  display: "flex",
@@ -545,10 +545,10 @@ function J(e) {
545
545
  function Y(e, t) {
546
546
  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;
547
547
  }
548
- var ge = Y(u, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(s, "PreviewPrompt") || Y(Q.PreviewPrompt, "PreviewPrompt"), _e = Y(t, "Collapsible") || Y(Q.Collapsible, "Collapsible"), ve = m, Z = ve.default, Q = Z && typeof Z == "object" ? Z : ve, ye = a(ge)({
549
- color: i.text(),
550
- backgroundColor: i.background()
551
- }), be = a(_e)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), xe = a(f)(({ theme: e }) => ({
548
+ var ge = Y(u, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(c, "PreviewPrompt") || Y(Q.PreviewPrompt, "PreviewPrompt"), _e = Y(t, "Collapsible") || Y(Q.Collapsible, "Collapsible"), ve = m, Z = ve.default, Q = Z && typeof Z == "object" ? Z : ve, ye = o(ge)({
549
+ color: a.text(),
550
+ backgroundColor: a.background()
551
+ }), be = o(_e)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), xe = o(f)(({ theme: e }) => ({
552
552
  marginTop: e.spacing(2),
553
553
  marginBottom: e.spacing(2)
554
554
  })), $ = class extends h.Component {
@@ -638,11 +638,11 @@ var ge = Y(u, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(s, "PreviewPrompt"
638
638
  } }), e.selectedTool = "lineB"), n(e, t);
639
639
  };
640
640
  render() {
641
- let { model: e, onAnswersChange: t, session: r } = this.props, { showingCorrect: i, dialog: a } = this.state, { answer: s } = r || {}, { answersCorrected: c, arrows: l, coordinatesOnHover: u, correctResponse: d, defaultTool: f, disabled: p, domain: m, extraCSSRules: h, labels: g, labelsEnabled: _, prompt: b, range: x, rationale: S, size: C, showToggle: w, title: T, titleEnabled: E, teacherInstructions: D, language: O, gssLineData: k, gssData: A } = e || {}, j = c || s || [], M = e.rationale && (n(e.rationale) || o(e.rationale));
641
+ let { model: e, onAnswersChange: t, session: r } = this.props, { showingCorrect: i, dialog: a } = this.state, { answer: o } = r || {}, { answersCorrected: c, arrows: l, coordinatesOnHover: u, correctResponse: d, defaultTool: f, disabled: p, domain: m, extraCSSRules: h, labels: g, labelsEnabled: _, prompt: b, range: x, rationale: S, size: C, showToggle: w, title: T, titleEnabled: E, teacherInstructions: D, language: O, gssLineData: k, gssData: A } = e || {}, j = c || o || [], M = e.rationale && (n(e.rationale) || s(e.rationale));
642
642
  return /* @__PURE__ */ y(ye, {
643
643
  extraCSSRules: h,
644
644
  children: [
645
- e.teacherInstructions && (n(e.teacherInstructions) || o(e.teacherInstructions)) && /* @__PURE__ */ v(be, {
645
+ e.teacherInstructions && (n(e.teacherInstructions) || s(e.teacherInstructions)) && /* @__PURE__ */ v(be, {
646
646
  labels: {
647
647
  hidden: "Show Teacher Instructions",
648
648
  visible: "Hide Teacher Instructions"