@pie-element/categorize 13.1.1-next.11 → 13.1.2-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/defaults.d.ts +223 -0
  4. package/dist/author/defaults.js +170 -0
  5. package/dist/author/design/builder.d.ts +10 -0
  6. package/dist/author/design/builder.js +24 -0
  7. package/dist/author/design/buttons.d.ts +28 -0
  8. package/dist/author/design/buttons.js +36 -0
  9. package/dist/author/design/categories/RowLabel.d.ts +23 -0
  10. package/dist/author/design/categories/RowLabel.js +47 -0
  11. package/dist/author/design/categories/alternateResponses.d.ts +31 -0
  12. package/dist/author/design/categories/alternateResponses.js +62 -0
  13. package/dist/author/design/categories/category.d.ts +44 -0
  14. package/dist/author/design/categories/category.js +98 -0
  15. package/dist/author/design/categories/choice-preview.d.ts +25 -0
  16. package/dist/author/design/categories/choice-preview.js +60 -0
  17. package/dist/author/design/categories/droppable-placeholder.d.ts +11 -0
  18. package/dist/author/design/categories/droppable-placeholder.js +71 -0
  19. package/dist/author/design/categories/index.d.ts +41 -0
  20. package/dist/author/design/categories/index.js +146 -0
  21. package/dist/author/design/choices/choice.d.ts +11 -0
  22. package/dist/author/design/choices/choice.js +129 -0
  23. package/dist/author/design/choices/config.d.ts +21 -0
  24. package/dist/author/design/choices/config.js +33 -0
  25. package/dist/author/design/choices/index.d.ts +41 -0
  26. package/dist/author/design/choices/index.js +110 -0
  27. package/dist/author/design/header.d.ts +24 -0
  28. package/dist/author/design/header.js +49 -0
  29. package/dist/author/design/index.d.ts +52 -0
  30. package/dist/author/design/index.js +417 -0
  31. package/dist/author/design/input-header.d.ts +39 -0
  32. package/dist/author/design/input-header.js +69 -0
  33. package/dist/author/design/utils.d.ts +9 -0
  34. package/dist/author/design/utils.js +7 -0
  35. package/dist/author/index.d.ts +51 -0
  36. package/dist/author/index.js +87 -0
  37. package/dist/author/main.d.ts +23 -0
  38. package/dist/author/main.js +30 -0
  39. package/dist/author/utils.d.ts +16 -0
  40. package/dist/author/utils.js +17 -0
  41. package/dist/browser/author/index.js +2047 -0
  42. package/dist/browser/author/index.js.map +1 -0
  43. package/dist/browser/categorize.css +2 -0
  44. package/dist/browser/controller/index.js +299 -0
  45. package/dist/browser/controller/index.js.map +1 -0
  46. package/dist/browser/delivery/index.js +1051 -0
  47. package/dist/browser/delivery/index.js.map +1 -0
  48. package/dist/browser/dist-BaJrqHFp.js +50183 -0
  49. package/dist/browser/dist-BaJrqHFp.js.map +1 -0
  50. package/dist/browser/dist-BsrA0RFp.js +2938 -0
  51. package/dist/browser/dist-BsrA0RFp.js.map +1 -0
  52. package/dist/controller/defaults.d.ts +34 -0
  53. package/dist/controller/defaults.js +29 -0
  54. package/dist/controller/index.d.ts +61 -0
  55. package/dist/controller/index.js +155 -0
  56. package/dist/controller/utils.d.ts +20 -0
  57. package/dist/controller/utils.js +35 -0
  58. package/dist/delivery/categorize/categories.d.ts +34 -0
  59. package/dist/delivery/categorize/categories.js +66 -0
  60. package/dist/delivery/categorize/category.d.ts +28 -0
  61. package/dist/delivery/categorize/category.js +48 -0
  62. package/dist/delivery/categorize/choice.d.ts +27 -0
  63. package/dist/delivery/categorize/choice.js +94 -0
  64. package/dist/delivery/categorize/choices.d.ts +39 -0
  65. package/dist/delivery/categorize/choices.js +51 -0
  66. package/dist/delivery/categorize/droppable-placeholder.d.ts +32 -0
  67. package/dist/delivery/categorize/droppable-placeholder.js +64 -0
  68. package/dist/delivery/categorize/grid-content.d.ts +25 -0
  69. package/dist/delivery/categorize/grid-content.js +39 -0
  70. package/dist/delivery/categorize/index.d.ts +57 -0
  71. package/dist/delivery/categorize/index.js +260 -0
  72. package/dist/delivery/index.d.ts +27 -0
  73. package/dist/delivery/index.js +152 -0
  74. package/dist/index.d.ts +1 -0
  75. package/dist/index.iife.d.ts +8 -0
  76. package/dist/index.iife.js +152 -0
  77. package/dist/index.js +2 -0
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +6 -0
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +16 -0
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +16 -0
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +6 -0
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +16 -0
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +6 -0
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +6 -0
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +14 -0
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +5 -0
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +6 -0
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +7 -0
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +10 -0
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +7 -0
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +10 -0
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +8 -0
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +8 -0
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +8 -0
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +12 -0
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +57 -0
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +14 -0
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +9 -0
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +9 -0
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +12 -0
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +10 -0
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +8 -0
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +8 -0
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +8 -0
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +8 -0
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +14 -0
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +8 -0
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +9 -0
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +8 -0
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +5 -0
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +10 -0
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +23 -0
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +7 -0
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +7 -0
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +13 -0
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +9 -0
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +9 -0
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +8 -0
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +33 -0
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +9 -0
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +7 -0
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +6 -0
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +9 -0
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +8 -0
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +7 -0
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +8 -0
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +13 -0
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +7 -0
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +7 -0
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +8 -0
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +5 -0
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +5 -0
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +8 -0
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +7 -0
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +7 -0
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +6 -0
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +6 -0
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +16 -0
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +8 -0
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +21 -0
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +7 -0
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +7 -0
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +9 -0
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +6 -0
  186. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
  187. package/package.json +79 -19
  188. package/CHANGELOG.json +0 -1637
  189. package/CHANGELOG.md +0 -2532
  190. package/LICENSE.md +0 -5
  191. package/README.md +0 -5
  192. package/configure/CHANGELOG.json +0 -1202
  193. package/configure/CHANGELOG.md +0 -2115
  194. package/configure/lib/defaults.js +0 -222
  195. package/configure/lib/defaults.js.map +0 -1
  196. package/configure/lib/design/builder.js +0 -55
  197. package/configure/lib/design/builder.js.map +0 -1
  198. package/configure/lib/design/buttons.js +0 -59
  199. package/configure/lib/design/buttons.js.map +0 -1
  200. package/configure/lib/design/categories/RowLabel.js +0 -66
  201. package/configure/lib/design/categories/RowLabel.js.map +0 -1
  202. package/configure/lib/design/categories/alternateResponses.js +0 -116
  203. package/configure/lib/design/categories/alternateResponses.js.map +0 -1
  204. package/configure/lib/design/categories/category.js +0 -153
  205. package/configure/lib/design/categories/category.js.map +0 -1
  206. package/configure/lib/design/categories/choice-preview.js +0 -79
  207. package/configure/lib/design/categories/choice-preview.js.map +0 -1
  208. package/configure/lib/design/categories/droppable-placeholder.js +0 -93
  209. package/configure/lib/design/categories/droppable-placeholder.js.map +0 -1
  210. package/configure/lib/design/categories/index.js +0 -256
  211. package/configure/lib/design/categories/index.js.map +0 -1
  212. package/configure/lib/design/choices/choice.js +0 -187
  213. package/configure/lib/design/choices/choice.js.map +0 -1
  214. package/configure/lib/design/choices/config.js +0 -58
  215. package/configure/lib/design/choices/config.js.map +0 -1
  216. package/configure/lib/design/choices/index.js +0 -197
  217. package/configure/lib/design/choices/index.js.map +0 -1
  218. package/configure/lib/design/header.js +0 -71
  219. package/configure/lib/design/header.js.map +0 -1
  220. package/configure/lib/design/index.js +0 -727
  221. package/configure/lib/design/index.js.map +0 -1
  222. package/configure/lib/design/input-header.js +0 -105
  223. package/configure/lib/design/input-header.js.map +0 -1
  224. package/configure/lib/design/utils.js +0 -12
  225. package/configure/lib/design/utils.js.map +0 -1
  226. package/configure/lib/index.js +0 -147
  227. package/configure/lib/index.js.map +0 -1
  228. package/configure/lib/main.js +0 -44
  229. package/configure/lib/main.js.map +0 -1
  230. package/configure/lib/utils.js +0 -43
  231. package/configure/lib/utils.js.map +0 -1
  232. package/configure/package.json +0 -32
  233. package/controller/CHANGELOG.json +0 -452
  234. package/controller/CHANGELOG.md +0 -1373
  235. package/controller/lib/defaults.js +0 -33
  236. package/controller/lib/defaults.js.map +0 -1
  237. package/controller/lib/index.js +0 -479
  238. package/controller/lib/index.js.map +0 -1
  239. package/controller/lib/utils.js +0 -69
  240. package/controller/lib/utils.js.map +0 -1
  241. package/controller/package.json +0 -18
  242. package/docs/config-schema.json +0 -2897
  243. package/docs/config-schema.json.md +0 -2138
  244. package/docs/demo/config.js +0 -8
  245. package/docs/demo/generate.js +0 -357
  246. package/docs/demo/index.html +0 -1
  247. package/docs/demo/session.js +0 -12
  248. package/docs/pie-schema.json +0 -1784
  249. package/docs/pie-schema.json.md +0 -1046
  250. package/lib/categorize/categories.js +0 -135
  251. package/lib/categorize/categories.js.map +0 -1
  252. package/lib/categorize/category.js +0 -67
  253. package/lib/categorize/category.js.map +0 -1
  254. package/lib/categorize/choice.js +0 -140
  255. package/lib/categorize/choice.js.map +0 -1
  256. package/lib/categorize/choices.js +0 -99
  257. package/lib/categorize/choices.js.map +0 -1
  258. package/lib/categorize/droppable-placeholder.js +0 -84
  259. package/lib/categorize/droppable-placeholder.js.map +0 -1
  260. package/lib/categorize/grid-content.js +0 -55
  261. package/lib/categorize/grid-content.js.map +0 -1
  262. package/lib/categorize/index.js +0 -450
  263. package/lib/categorize/index.js.map +0 -1
  264. package/lib/index.js +0 -316
  265. package/lib/index.js.map +0 -1
@@ -0,0 +1,2047 @@
1
+ import { $ as e, a as t, c as n, d as r, et as i, g as a, i as o, it as s, l as c, n as l, o as u, r as d, s as f, u as p } from "../dist-BsrA0RFp.js";
2
+ import { $ as m, A as h, B as g, D as _, E as v, F as y, H as b, I as ee, J as te, L as x, M as S, N as ne, P as C, Q as w, R as T, U as E, V as re, W as ie, X as ae, Y as oe, Z as se, _ as ce, a as le, b as D, c as O, d as k, et as ue, f as A, g as de, h as fe, i as pe, k as j, l as M, m as N, n as P, nt as me, o as he, p as ge, q as F, r as I, rt as L, s as R, t as z, tt as _e, u as ve, v as ye, y as B, z as be } from "../dist-BaJrqHFp.js";
3
+ import * as V from "react";
4
+ import H from "react";
5
+ import { createRoot as U } from "react-dom/client";
6
+ import { jsx as W, jsxs as G } from "react/jsx-runtime";
7
+ //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js
8
+ var xe = 1, Se = 4;
9
+ function Ce(e) {
10
+ return a(e, xe | Se);
11
+ }
12
+ //#endregion
13
+ //#region ../../lib-react/drag/dist/draggable-choice.js
14
+ var K = /* @__PURE__ */ s(ue(), 1), we = F("div")(({ theme: e }) => ({
15
+ backgroundColor: e.palette.background.paper,
16
+ border: `solid 1px ${me[400]}`,
17
+ padding: e.spacing(1),
18
+ minHeight: "30px",
19
+ minWidth: e.spacing(20),
20
+ maxWidth: e.spacing(75),
21
+ cursor: "grab",
22
+ "& p": { margin: 0 },
23
+ "& p *": { margin: 0 },
24
+ "&:active": { cursor: "grabbing" }
25
+ }));
26
+ function Te({ choice: e, children: t, className: n, disabled: r, category: i, alternateResponseIndex: a, choiceIndex: o, onRemoveChoice: s, type: c, id: l }) {
27
+ let { attributes: u, listeners: d, setNodeRef: f, isDragging: p } = ye({
28
+ id: l || e.id,
29
+ disabled: r,
30
+ categoryId: i?.id,
31
+ alternateResponseIndex: a,
32
+ data: {
33
+ id: e.id,
34
+ value: e.value,
35
+ choiceId: e.id,
36
+ from: i?.id,
37
+ categoryId: i?.id,
38
+ alternateResponseIndex: a,
39
+ choiceIndex: o,
40
+ onRemoveChoice: s,
41
+ type: c
42
+ }
43
+ });
44
+ return /* @__PURE__ */ W(we, {
45
+ ref: f,
46
+ className: n,
47
+ isDragging: p,
48
+ ...u,
49
+ ...d,
50
+ children: t
51
+ });
52
+ }
53
+ Te.propTypes = {
54
+ choice: K.default.shape({
55
+ id: K.default.oneOfType([K.default.string, K.default.number]).isRequired,
56
+ value: K.default.any
57
+ }).isRequired,
58
+ children: K.default.oneOfType([K.default.arrayOf(K.default.node), K.default.node]),
59
+ className: K.default.string,
60
+ disabled: K.default.bool,
61
+ category: K.default.shape({ id: K.default.oneOfType([K.default.string, K.default.number]) }),
62
+ alternateResponseIndex: K.default.number,
63
+ choiceIndex: K.default.number,
64
+ onRemoveChoice: K.default.func,
65
+ type: K.default.string,
66
+ id: K.default.string
67
+ };
68
+ //#endregion
69
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/CardActions/cardActionsClasses.js
70
+ function Ee(e) {
71
+ return w("MuiCardActions", e);
72
+ }
73
+ se("MuiCardActions", ["root", "spacing"]);
74
+ //#endregion
75
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/CardActions/CardActions.js
76
+ var De = (e) => {
77
+ let { classes: t, disableSpacing: n } = e;
78
+ return oe({ root: ["root", !n && "spacing"] }, Ee, t);
79
+ }, Oe = F("div", {
80
+ name: "MuiCardActions",
81
+ slot: "Root",
82
+ overridesResolver: (e, t) => {
83
+ let { ownerState: n } = e;
84
+ return [t.root, !n.disableSpacing && t.spacing];
85
+ }
86
+ })({
87
+ display: "flex",
88
+ alignItems: "center",
89
+ padding: 8,
90
+ variants: [{
91
+ props: { disableSpacing: !1 },
92
+ style: { "& > :not(style) ~ :not(style)": { marginLeft: 8 } }
93
+ }]
94
+ }), ke = /*#__PURE__*/ V.forwardRef(function(e, t) {
95
+ let n = ie({
96
+ props: e,
97
+ name: "MuiCardActions"
98
+ }), { disableSpacing: r = !1, className: i, ...a } = n, o = {
99
+ ...n,
100
+ disableSpacing: r
101
+ };
102
+ return /*#__PURE__*/ W(Oe, {
103
+ className: m(De(o).root, i),
104
+ ownerState: o,
105
+ ref: t,
106
+ ...a
107
+ });
108
+ });
109
+ //#endregion
110
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Tooltip/tooltipClasses.js
111
+ function Ae(e) {
112
+ return w("MuiTooltip", e);
113
+ }
114
+ var q = se("MuiTooltip", [
115
+ "popper",
116
+ "popperInteractive",
117
+ "popperArrow",
118
+ "popperClose",
119
+ "tooltip",
120
+ "tooltipArrow",
121
+ "touch",
122
+ "tooltipPlacementLeft",
123
+ "tooltipPlacementRight",
124
+ "tooltipPlacementTop",
125
+ "tooltipPlacementBottom",
126
+ "arrow"
127
+ ]);
128
+ //#endregion
129
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Tooltip/Tooltip.js
130
+ function je(e) {
131
+ return Math.round(e * 1e5) / 1e5;
132
+ }
133
+ var Me = (e) => {
134
+ let { classes: t, disableInteractive: n, arrow: r, touch: i, placement: a } = e;
135
+ return oe({
136
+ popper: [
137
+ "popper",
138
+ !n && "popperInteractive",
139
+ r && "popperArrow"
140
+ ],
141
+ tooltip: [
142
+ "tooltip",
143
+ r && "tooltipArrow",
144
+ i && "touch",
145
+ `tooltipPlacement${ee(a.split("-")[0])}`
146
+ ],
147
+ arrow: ["arrow"]
148
+ }, Ae, t);
149
+ }, Ne = F(k, {
150
+ name: "MuiTooltip",
151
+ slot: "Popper",
152
+ overridesResolver: (e, t) => {
153
+ let { ownerState: n } = e;
154
+ return [
155
+ t.popper,
156
+ !n.disableInteractive && t.popperInteractive,
157
+ n.arrow && t.popperArrow,
158
+ !n.open && t.popperClose
159
+ ];
160
+ }
161
+ })(T(({ theme: e }) => ({
162
+ zIndex: (e.vars || e).zIndex.tooltip,
163
+ pointerEvents: "none",
164
+ variants: [
165
+ {
166
+ props: ({ ownerState: e }) => !e.disableInteractive,
167
+ style: { pointerEvents: "auto" }
168
+ },
169
+ {
170
+ props: ({ open: e }) => !e,
171
+ style: { pointerEvents: "none" }
172
+ },
173
+ {
174
+ props: ({ ownerState: e }) => e.arrow,
175
+ style: {
176
+ [`&[data-popper-placement*="bottom"] .${q.arrow}`]: {
177
+ top: 0,
178
+ marginTop: "-0.71em",
179
+ "&::before": { transformOrigin: "0 100%" }
180
+ },
181
+ [`&[data-popper-placement*="top"] .${q.arrow}`]: {
182
+ bottom: 0,
183
+ marginBottom: "-0.71em",
184
+ "&::before": { transformOrigin: "100% 0" }
185
+ },
186
+ [`&[data-popper-placement*="right"] .${q.arrow}`]: {
187
+ height: "1em",
188
+ width: "0.71em",
189
+ "&::before": { transformOrigin: "100% 100%" }
190
+ },
191
+ [`&[data-popper-placement*="left"] .${q.arrow}`]: {
192
+ height: "1em",
193
+ width: "0.71em",
194
+ "&::before": { transformOrigin: "0 0" }
195
+ }
196
+ }
197
+ },
198
+ {
199
+ props: ({ ownerState: e }) => e.arrow && !e.isRtl,
200
+ style: { [`&[data-popper-placement*="right"] .${q.arrow}`]: {
201
+ left: 0,
202
+ marginLeft: "-0.71em"
203
+ } }
204
+ },
205
+ {
206
+ props: ({ ownerState: e }) => e.arrow && !!e.isRtl,
207
+ style: { [`&[data-popper-placement*="right"] .${q.arrow}`]: {
208
+ right: 0,
209
+ marginRight: "-0.71em"
210
+ } }
211
+ },
212
+ {
213
+ props: ({ ownerState: e }) => e.arrow && !e.isRtl,
214
+ style: { [`&[data-popper-placement*="left"] .${q.arrow}`]: {
215
+ right: 0,
216
+ marginRight: "-0.71em"
217
+ } }
218
+ },
219
+ {
220
+ props: ({ ownerState: e }) => e.arrow && !!e.isRtl,
221
+ style: { [`&[data-popper-placement*="left"] .${q.arrow}`]: {
222
+ left: 0,
223
+ marginLeft: "-0.71em"
224
+ } }
225
+ }
226
+ ]
227
+ }))), Pe = F("div", {
228
+ name: "MuiTooltip",
229
+ slot: "Tooltip",
230
+ overridesResolver: (e, t) => {
231
+ let { ownerState: n } = e;
232
+ return [
233
+ t.tooltip,
234
+ n.touch && t.touch,
235
+ n.arrow && t.tooltipArrow,
236
+ t[`tooltipPlacement${ee(n.placement.split("-")[0])}`]
237
+ ];
238
+ }
239
+ })(T(({ theme: e }) => ({
240
+ backgroundColor: e.vars ? e.vars.palette.Tooltip.bg : e.alpha(e.palette.grey[700], .92),
241
+ borderRadius: (e.vars || e).shape.borderRadius,
242
+ color: (e.vars || e).palette.common.white,
243
+ fontFamily: e.typography.fontFamily,
244
+ padding: "4px 8px",
245
+ fontSize: e.typography.pxToRem(11),
246
+ maxWidth: 300,
247
+ margin: 2,
248
+ wordWrap: "break-word",
249
+ fontWeight: e.typography.fontWeightMedium,
250
+ [`.${q.popper}[data-popper-placement*="left"] &`]: { transformOrigin: "right center" },
251
+ [`.${q.popper}[data-popper-placement*="right"] &`]: { transformOrigin: "left center" },
252
+ [`.${q.popper}[data-popper-placement*="top"] &`]: {
253
+ transformOrigin: "center bottom",
254
+ marginBottom: "14px"
255
+ },
256
+ [`.${q.popper}[data-popper-placement*="bottom"] &`]: {
257
+ transformOrigin: "center top",
258
+ marginTop: "14px"
259
+ },
260
+ variants: [
261
+ {
262
+ props: ({ ownerState: e }) => e.arrow,
263
+ style: {
264
+ position: "relative",
265
+ margin: 0
266
+ }
267
+ },
268
+ {
269
+ props: ({ ownerState: e }) => e.touch,
270
+ style: {
271
+ padding: "8px 16px",
272
+ fontSize: e.typography.pxToRem(14),
273
+ lineHeight: `${je(16 / 14)}em`,
274
+ fontWeight: e.typography.fontWeightRegular
275
+ }
276
+ },
277
+ {
278
+ props: ({ ownerState: e }) => !e.isRtl,
279
+ style: {
280
+ [`.${q.popper}[data-popper-placement*="left"] &`]: { marginRight: "14px" },
281
+ [`.${q.popper}[data-popper-placement*="right"] &`]: { marginLeft: "14px" }
282
+ }
283
+ },
284
+ {
285
+ props: ({ ownerState: e }) => !e.isRtl && e.touch,
286
+ style: {
287
+ [`.${q.popper}[data-popper-placement*="left"] &`]: { marginRight: "24px" },
288
+ [`.${q.popper}[data-popper-placement*="right"] &`]: { marginLeft: "24px" }
289
+ }
290
+ },
291
+ {
292
+ props: ({ ownerState: e }) => !!e.isRtl,
293
+ style: {
294
+ [`.${q.popper}[data-popper-placement*="left"] &`]: { marginLeft: "14px" },
295
+ [`.${q.popper}[data-popper-placement*="right"] &`]: { marginRight: "14px" }
296
+ }
297
+ },
298
+ {
299
+ props: ({ ownerState: e }) => !!e.isRtl && e.touch,
300
+ style: {
301
+ [`.${q.popper}[data-popper-placement*="left"] &`]: { marginLeft: "24px" },
302
+ [`.${q.popper}[data-popper-placement*="right"] &`]: { marginRight: "24px" }
303
+ }
304
+ },
305
+ {
306
+ props: ({ ownerState: e }) => e.touch,
307
+ style: { [`.${q.popper}[data-popper-placement*="top"] &`]: { marginBottom: "24px" } }
308
+ },
309
+ {
310
+ props: ({ ownerState: e }) => e.touch,
311
+ style: { [`.${q.popper}[data-popper-placement*="bottom"] &`]: { marginTop: "24px" } }
312
+ }
313
+ ]
314
+ }))), Fe = F("span", {
315
+ name: "MuiTooltip",
316
+ slot: "Arrow"
317
+ })(T(({ theme: e }) => ({
318
+ overflow: "hidden",
319
+ position: "absolute",
320
+ width: "1em",
321
+ height: "0.71em",
322
+ boxSizing: "border-box",
323
+ color: e.vars ? e.vars.palette.Tooltip.bg : e.alpha(e.palette.grey[700], .9),
324
+ "&::before": {
325
+ content: "\"\"",
326
+ margin: "auto",
327
+ display: "block",
328
+ width: "100%",
329
+ height: "100%",
330
+ backgroundColor: "currentColor",
331
+ transform: "rotate(45deg)"
332
+ }
333
+ }))), Ie = !1, Le = new b(), Re = {
334
+ x: 0,
335
+ y: 0
336
+ };
337
+ function ze(e, t) {
338
+ return (n, ...r) => {
339
+ t && t(n, ...r), e(n, ...r);
340
+ };
341
+ }
342
+ var Be = /*#__PURE__*/ V.forwardRef(function(e, t) {
343
+ let n = ie({
344
+ props: e,
345
+ name: "MuiTooltip"
346
+ }), { arrow: r = !1, children: i, classes: a, components: o = {}, componentsProps: s = {}, describeChild: c = !1, disableFocusListener: l = !1, disableHoverListener: u = !1, disableInteractive: d = !1, disableTouchListener: f = !1, enterDelay: p = 100, enterNextDelay: _ = 0, enterTouchDelay: v = 700, followCursor: y = !1, id: b, leaveDelay: ee = 0, leaveTouchDelay: w = 1500, onClose: T, onOpen: oe, open: se, placement: ce = "bottom", PopperComponent: le, PopperProps: D = {}, slotProps: O = {}, slots: ue = {}, title: A, TransitionComponent: de, TransitionProps: fe, ...pe } = n, j = /*#__PURE__*/ V.isValidElement(i) ? i : /*#__PURE__*/ W("span", { children: i }), M = te(), N = ae(), [P, me] = V.useState(), [he, ge] = V.useState(null), F = V.useRef(!1), I = d || y, L = E(), R = E(), z = E(), _e = E(), [ve, ye] = ne({
347
+ controlled: se,
348
+ default: !1,
349
+ name: "Tooltip",
350
+ state: "open"
351
+ }), B = ve, H = C(b), U = V.useRef(), xe = S(() => {
352
+ U.current !== void 0 && (document.body.style.WebkitUserSelect = U.current, U.current = void 0), _e.clear();
353
+ });
354
+ V.useEffect(() => xe, [xe]);
355
+ let Se = (e) => {
356
+ Le.clear(), Ie = !0, ye(!0), oe && !B && oe(e);
357
+ }, Ce = S((e) => {
358
+ Le.start(800 + ee, () => {
359
+ Ie = !1;
360
+ }), ye(!1), T && B && T(e), L.start(M.transitions.duration.shortest, () => {
361
+ F.current = !1;
362
+ });
363
+ }), K = (e) => {
364
+ F.current && e.type !== "touchstart" || (P && P.removeAttribute("title"), R.clear(), z.clear(), p || Ie && _ ? R.start(Ie ? _ : p, () => {
365
+ Se(e);
366
+ }) : Se(e));
367
+ }, we = (e) => {
368
+ R.clear(), z.start(ee, () => {
369
+ Ce(e);
370
+ });
371
+ }, [, Te] = V.useState(!1), Ee = (e) => {
372
+ let t = e?.target ?? P;
373
+ if (!t || !h(t)) {
374
+ Te(!1);
375
+ let n = e ?? new Event("blur");
376
+ !e && t && (Object.defineProperty(n, "target", { value: t }), Object.defineProperty(n, "currentTarget", { value: t })), we(n);
377
+ }
378
+ }, De = (e) => {
379
+ P || me(e.currentTarget), h(e.target) && (Te(!0), K(e));
380
+ }, Oe = (e) => {
381
+ F.current = !0;
382
+ let t = j.props;
383
+ t.onTouchStart && t.onTouchStart(e);
384
+ }, ke = (e) => {
385
+ Oe(e), z.clear(), L.clear(), xe(), U.current = document.body.style.WebkitUserSelect, document.body.style.WebkitUserSelect = "none", _e.start(v, () => {
386
+ document.body.style.WebkitUserSelect = U.current, K(e);
387
+ });
388
+ }, Ae = (e) => {
389
+ j.props.onTouchEnd && j.props.onTouchEnd(e), xe(), z.start(w, () => {
390
+ Ce(e);
391
+ });
392
+ };
393
+ V.useEffect(() => {
394
+ if (!B) return;
395
+ function e(e) {
396
+ e.key === "Escape" && Ce(e);
397
+ }
398
+ return document.addEventListener("keydown", e), () => {
399
+ document.removeEventListener("keydown", e);
400
+ };
401
+ }, [Ce, B]);
402
+ let q = g(re(j), me, t);
403
+ !A && A !== 0 && (B = !1);
404
+ let je = V.useRef(), Be = (e) => {
405
+ let t = j.props;
406
+ t.onMouseMove && t.onMouseMove(e), Re = {
407
+ x: e.clientX,
408
+ y: e.clientY
409
+ }, je.current && je.current.update();
410
+ }, J = {}, Ve = typeof A == "string";
411
+ c ? (J.title = !B && Ve && !u ? A : null, J["aria-describedby"] = B ? H : null) : (J["aria-label"] = Ve ? A : null, J["aria-labelledby"] = B && !Ve ? H : null);
412
+ let Y = {
413
+ ...J,
414
+ ...pe,
415
+ ...j.props,
416
+ className: m(pe.className, j.props.className),
417
+ onTouchStart: Oe,
418
+ ref: q,
419
+ ...y ? { onMouseMove: Be } : {}
420
+ }, He = {};
421
+ f || (Y.onTouchStart = ke, Y.onTouchEnd = Ae), u || (Y.onMouseOver = ze(K, Y.onMouseOver), Y.onMouseLeave = ze(we, Y.onMouseLeave), I || (He.onMouseOver = K, He.onMouseLeave = we)), l || (Y.onFocus = ze(De, Y.onFocus), Y.onBlur = ze(Ee, Y.onBlur), I || (He.onFocus = De, He.onBlur = Ee));
422
+ let X = {
423
+ ...n,
424
+ isRtl: N,
425
+ arrow: r,
426
+ disableInteractive: I,
427
+ placement: ce,
428
+ PopperComponentProp: le,
429
+ touch: F.current
430
+ }, Z = typeof O.popper == "function" ? O.popper(X) : O.popper, Ue = V.useMemo(() => {
431
+ let e = [{
432
+ name: "arrow",
433
+ enabled: !!he,
434
+ options: {
435
+ element: he,
436
+ padding: 4
437
+ }
438
+ }];
439
+ return D.popperOptions?.modifiers && (e = e.concat(D.popperOptions.modifiers)), Z?.popperOptions?.modifiers && (e = e.concat(Z.popperOptions.modifiers)), {
440
+ ...D.popperOptions,
441
+ ...Z?.popperOptions,
442
+ modifiers: e
443
+ };
444
+ }, [
445
+ he,
446
+ D.popperOptions,
447
+ Z?.popperOptions
448
+ ]), We = Me(X), Ge = typeof O.transition == "function" ? O.transition(X) : O.transition, Ke = {
449
+ slots: {
450
+ popper: o.Popper,
451
+ transition: o.Transition ?? de,
452
+ tooltip: o.Tooltip,
453
+ arrow: o.Arrow,
454
+ ...ue
455
+ },
456
+ slotProps: {
457
+ arrow: O.arrow ?? s.arrow,
458
+ popper: {
459
+ ...D,
460
+ ...Z ?? s.popper
461
+ },
462
+ tooltip: O.tooltip ?? s.tooltip,
463
+ transition: {
464
+ ...fe,
465
+ ...Ge ?? s.transition
466
+ }
467
+ }
468
+ }, [qe, Je] = x("popper", {
469
+ elementType: Ne,
470
+ externalForwardedProps: Ke,
471
+ ownerState: X,
472
+ className: m(We.popper, D?.className)
473
+ }), [Ye, Xe] = x("transition", {
474
+ elementType: be,
475
+ externalForwardedProps: Ke,
476
+ ownerState: X
477
+ }), [Ze, Qe] = x("tooltip", {
478
+ elementType: Pe,
479
+ className: We.tooltip,
480
+ externalForwardedProps: Ke,
481
+ ownerState: X
482
+ }), [$e, et] = x("arrow", {
483
+ elementType: Fe,
484
+ className: We.arrow,
485
+ externalForwardedProps: Ke,
486
+ ownerState: X,
487
+ ref: ge
488
+ });
489
+ return /*#__PURE__*/ G(V.Fragment, { children: [/*#__PURE__*/ V.cloneElement(j, Y), /*#__PURE__*/ W(qe, {
490
+ as: le ?? k,
491
+ placement: ce,
492
+ anchorEl: y ? { getBoundingClientRect: () => ({
493
+ top: Re.y,
494
+ left: Re.x,
495
+ right: Re.x,
496
+ bottom: Re.y,
497
+ width: 0,
498
+ height: 0
499
+ }) } : P,
500
+ popperRef: je,
501
+ open: P ? B : !1,
502
+ id: H,
503
+ transition: !0,
504
+ ...He,
505
+ ...Je,
506
+ popperOptions: Ue,
507
+ children: ({ TransitionProps: e }) => /*#__PURE__*/ W(Ye, {
508
+ timeout: M.transitions.duration.shorter,
509
+ ...e,
510
+ ...Xe,
511
+ children: /*#__PURE__*/ G(Ze, {
512
+ ...Qe,
513
+ children: [A, r ? /*#__PURE__*/ W($e, { ...et }) : null]
514
+ })
515
+ })
516
+ })] });
517
+ }), J = class e extends CustomEvent {
518
+ static {
519
+ this.TYPE = "model.updated";
520
+ }
521
+ constructor(t, n = !1) {
522
+ super(e.TYPE, {
523
+ bubbles: !0,
524
+ detail: {
525
+ update: t,
526
+ reset: n
527
+ }
528
+ }), this.update = t, this.reset = n;
529
+ }
530
+ }, Ve = class e extends CustomEvent {
531
+ static {
532
+ this.TYPE = "delete.image";
533
+ }
534
+ constructor(t, n) {
535
+ super(e.TYPE, {
536
+ bubbles: !0,
537
+ detail: {
538
+ src: t,
539
+ done: n
540
+ }
541
+ }), this.src = t, this.done = n;
542
+ }
543
+ }, Y = class e extends CustomEvent {
544
+ static {
545
+ this.TYPE = "insert.image";
546
+ }
547
+ constructor(t) {
548
+ super(e.TYPE, {
549
+ bubbles: !0,
550
+ detail: t
551
+ }), this.handler = t;
552
+ }
553
+ }, He = class e extends CustomEvent {
554
+ static {
555
+ this.TYPE = "delete.sound";
556
+ }
557
+ constructor(t, n) {
558
+ super(e.TYPE, {
559
+ bubbles: !0,
560
+ detail: {
561
+ src: t,
562
+ done: n
563
+ }
564
+ }), this.src = t, this.done = n;
565
+ }
566
+ }, X = class e extends CustomEvent {
567
+ static {
568
+ this.TYPE = "insert.sound";
569
+ }
570
+ constructor(t) {
571
+ super(e.TYPE, {
572
+ bubbles: !0,
573
+ detail: t
574
+ }), this.handler = t;
575
+ }
576
+ }, Z = (e = {}, t = {}) => ({
577
+ ...t,
578
+ ...e
579
+ }), Ue = y(/*#__PURE__*/ W("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z" }), "Info"), We = F(R)({
580
+ flex: "1",
581
+ maxWidth: "100%"
582
+ }), Ge = F("div")(({ theme: e }) => ({
583
+ display: "flex",
584
+ justifyContent: "space-between",
585
+ paddingBottom: e.spacing(1)
586
+ })), Ke = class extends H.Component {
587
+ static propTypes = {
588
+ configuration: K.default.object.isRequired,
589
+ deleteFocusedEl: K.default.func,
590
+ disabled: K.default.bool,
591
+ focusedEl: K.default.number,
592
+ index: K.default.number,
593
+ label: K.default.string,
594
+ maxImageWidth: K.default.object,
595
+ maxImageHeight: K.default.object,
596
+ onChange: K.default.func,
597
+ onDelete: K.default.func,
598
+ imageSupport: K.default.shape({
599
+ add: K.default.func.isRequired,
600
+ delete: K.default.func.isRequired
601
+ }),
602
+ uploadSoundSupport: K.default.shape({
603
+ add: K.default.func.isRequired,
604
+ delete: K.default.func.isRequired
605
+ }),
606
+ toolbarOpts: K.default.object,
607
+ error: K.default.string,
608
+ spellCheck: K.default.bool
609
+ };
610
+ static defaultProps = {};
611
+ constructor(e) {
612
+ super(e);
613
+ }
614
+ render() {
615
+ let { onChange: e, configuration: t, label: n, deleteFocusedEl: r, disabled: i, imageSupport: a, toolbarOpts: o, spellCheck: s, error: c, maxImageWidth: l, maxImageHeight: u, uploadSoundSupport: d, mathMlOptions: f = {}, focusedEl: p, index: m } = this.props, { headers: h, baseInputConfiguration: g } = t;
616
+ return /* @__PURE__ */ W(Ge, { children: /* @__PURE__ */ W(We, {
617
+ imageSupport: a,
618
+ disabled: i,
619
+ autoFocus: p != null && p === m,
620
+ autoWidthToolbar: !0,
621
+ label: "label",
622
+ markup: n,
623
+ onChange: e,
624
+ pluginProps: Z(h?.inputConfiguration, g),
625
+ toolbarOpts: o,
626
+ spellCheck: s,
627
+ error: c,
628
+ maxImageWidth: l,
629
+ maxImageHeight: u,
630
+ uploadSoundSupport: d,
631
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
632
+ onDone: () => {
633
+ r && r();
634
+ },
635
+ mathMlOptions: f
636
+ }) });
637
+ }
638
+ }, qe = F(j)(({ theme: e }) => ({ height: e.spacing(4) })), Je = class extends H.Component {
639
+ static propTypes = {
640
+ label: K.default.string,
641
+ onClick: K.default.func,
642
+ disabled: K.default.bool
643
+ };
644
+ static defaultProps = { label: "Add" };
645
+ render() {
646
+ let { label: e, onClick: t, disabled: n } = this.props;
647
+ return /* @__PURE__ */ W(qe, {
648
+ onClick: t,
649
+ disabled: n,
650
+ size: "small",
651
+ variant: "contained",
652
+ color: "primary",
653
+ children: e
654
+ });
655
+ }
656
+ }, Ye = F(j)({
657
+ margin: 0,
658
+ padding: 0
659
+ }), Xe = ({ label: e, onClick: t, disabled: n }) => /* @__PURE__ */ W(Ye, {
660
+ onClick: t,
661
+ size: "small",
662
+ color: "primary",
663
+ disabled: n,
664
+ children: e
665
+ }), Ze = y(/*#__PURE__*/ W("path", { d: "M7 11v2h10v-2zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8" }), "RemoveCircleOutline");
666
+ //#endregion
667
+ //#region src/author/design/categories/choice-preview.tsx
668
+ function Qe(e) {
669
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
670
+ }
671
+ function $e(e, t) {
672
+ return !e || Qe(e) ? e : Qe(e.default) ? e.default : t && Qe(e[t]) ? e[t] : t && Qe(e[t]?.default) ? e[t].default : e;
673
+ }
674
+ var et = $e(_, "HtmlAndMath") || $e(rt.HtmlAndMath, "HtmlAndMath"), tt = D, nt = tt.default, rt = nt && typeof nt == "object" ? nt : tt, it = F("div")({
675
+ position: "relative",
676
+ overflow: "auto",
677
+ touchAction: "none"
678
+ }), at = F(ge)({
679
+ position: "absolute",
680
+ right: 0,
681
+ top: 0,
682
+ color: `${_e.tertiary()} !important`
683
+ }), ot = class extends H.Component {
684
+ static propTypes = {
685
+ alternateResponseIndex: K.default.number,
686
+ category: K.default.object,
687
+ choice: K.default.object.isRequired,
688
+ choiceIndex: K.default.number,
689
+ onDelete: K.default.func
690
+ };
691
+ static defaultProps = { onDelete: () => {} };
692
+ delete = () => {
693
+ let { onDelete: e, choice: t } = this.props;
694
+ e(t);
695
+ };
696
+ render() {
697
+ let { alternateResponseIndex: e, category: t, choice: n, choiceIndex: r } = this.props, i = t && t.id, a = e === void 0 ? `${n.id}-${i}-${r}` : `${n.id}-${i}-${r}-alt-${e}`;
698
+ return /* @__PURE__ */ G(it, { children: [n ? /* @__PURE__ */ W(Te, {
699
+ alternateResponseIndex: e,
700
+ category: t,
701
+ choice: n,
702
+ choiceIndex: r,
703
+ onRemoveChoice: this.delete,
704
+ type: "choice-preview",
705
+ id: a,
706
+ categoryId: i,
707
+ children: /* @__PURE__ */ W(et, { html: n?.content })
708
+ }) : null, /* @__PURE__ */ W(at, {
709
+ "aria-label": "delete",
710
+ onClick: this.delete,
711
+ size: "large",
712
+ children: /* @__PURE__ */ W(Ze, {})
713
+ })] });
714
+ }
715
+ }, st = /* @__PURE__ */ s(i(), 1);
716
+ (0, st.default)("@pie-element:categorize:configure");
717
+ var ct = F("div")(({ theme: e }) => ({
718
+ display: "flex",
719
+ alignItems: "center",
720
+ justifyContent: "center",
721
+ fontSize: e.typography.fontSize - 2,
722
+ color: `rgba(${e.palette.common.black}, 0.4)`,
723
+ width: "100%",
724
+ height: "100%"
725
+ })), lt = () => /* @__PURE__ */ W(ct, { children: "Drag your correct answers here" }), ut = ({ alternateResponseIndex: e, category: t, choices: n, onDeleteChoice: r }) => /* @__PURE__ */ W(H.Fragment, { children: (n || []).map((n, i) => n && /* @__PURE__ */ W(ot, {
726
+ alternateResponseIndex: e,
727
+ category: t,
728
+ choice: n,
729
+ choiceIndex: i,
730
+ onDelete: (e) => r(e, i)
731
+ }, i)) });
732
+ ut.propTypes = {
733
+ alternateResponseIndex: K.default.number,
734
+ category: K.default.object,
735
+ choices: K.default.array,
736
+ onDeleteChoice: K.default.func
737
+ };
738
+ var dt = ({ alternateResponseIndex: e, category: t, choices: n, onDeleteChoice: r, categoryId: i, isAlternate: a }) => {
739
+ let { setNodeRef: o, isOver: s } = B({
740
+ id: `${i}-${a ? "alternate" : "standard"}`,
741
+ data: {
742
+ accepts: ["choice", "choice-preview"],
743
+ alternateResponseIndex: e,
744
+ categoryId: i,
745
+ type: a ? "category-alternate" : "category",
746
+ id: i
747
+ }
748
+ });
749
+ return /* @__PURE__ */ W("div", {
750
+ ref: o,
751
+ children: /* @__PURE__ */ W(de, {
752
+ isOver: s,
753
+ extraStyles: {
754
+ width: "100%",
755
+ minHeight: "100px",
756
+ height: "auto"
757
+ },
758
+ children: (n || []).length === 0 ? /* @__PURE__ */ W(lt, {}) : /* @__PURE__ */ W(ut, {
759
+ alternateResponseIndex: e,
760
+ category: t,
761
+ choices: n,
762
+ onDeleteChoice: r
763
+ })
764
+ })
765
+ });
766
+ };
767
+ dt.propTypes = {
768
+ alternateResponseIndex: K.default.number,
769
+ category: K.default.object,
770
+ choices: K.default.array,
771
+ onDeleteChoice: K.default.func,
772
+ categoryId: K.default.string.isRequired,
773
+ isAlternate: K.default.bool
774
+ };
775
+ var ft = N.withUid(dt), pt = F(ve, { shouldForwardProp: (e) => e !== "isDuplicated" })(({ theme: e, isDuplicated: t }) => ({
776
+ minWidth: "196px",
777
+ padding: e.spacing(1),
778
+ overflow: "visible",
779
+ ...t && { border: "1px solid red" }
780
+ })), mt = F(ke)(({ theme: e }) => ({ padding: `${e.spacing(1)} 0 0` })), ht = F("div")(({ theme: e }) => ({
781
+ padding: e.spacing(2),
782
+ "& p": { margin: 0 }
783
+ })), gt = F("div")(({ theme: e }) => ({
784
+ fontSize: e.typography.fontSize - 2,
785
+ color: e.palette.error.main,
786
+ paddingBottom: e.spacing(1)
787
+ })), _t = class extends H.Component {
788
+ static propTypes = {
789
+ alternateResponseIndex: K.default.number,
790
+ category: K.default.object.isRequired,
791
+ configuration: K.default.object.isRequired,
792
+ defaultImageMaxHeight: K.default.number,
793
+ defaultImageMaxWidth: K.default.number,
794
+ deleteFocusedEl: K.default.func,
795
+ focusedEl: K.default.number,
796
+ index: K.default.number,
797
+ error: K.default.string,
798
+ isDuplicated: K.default.bool,
799
+ maxImageWidth: K.default.object,
800
+ maxImageHeight: K.default.object,
801
+ onChange: K.default.func,
802
+ onDelete: K.default.func,
803
+ onDeleteChoice: K.default.func,
804
+ imageSupport: K.default.shape({
805
+ add: K.default.func.isRequired,
806
+ delete: K.default.func.isRequired
807
+ }),
808
+ toolbarOpts: K.default.object,
809
+ spellCheck: K.default.bool,
810
+ uploadSoundSupport: K.default.shape({
811
+ add: K.default.func.isRequired,
812
+ delete: K.default.func.isRequired
813
+ }),
814
+ isAlternate: K.default.bool
815
+ };
816
+ static defaultProps = {};
817
+ changeLabel = (e) => {
818
+ let { category: t, onChange: n } = this.props;
819
+ t.label = e, n(t);
820
+ };
821
+ render() {
822
+ let { alternateResponseIndex: e, category: t, configuration: n, deleteFocusedEl: r, focusedEl: i, index: a, error: o, isDuplicated: s, onDelete: c, onDeleteChoice: l, imageSupport: u, spellCheck: d, toolbarOpts: f, maxImageWidth: p, maxImageHeight: m, uploadSoundSupport: h, mathMlOptions: g = {} } = this.props;
823
+ return /* @__PURE__ */ G(pt, {
824
+ isDuplicated: s,
825
+ children: [
826
+ /* @__PURE__ */ G("span", { children: [e || e === 0 ? /* @__PURE__ */ W(ht, { dangerouslySetInnerHTML: { __html: t.label } }) : /* @__PURE__ */ W(Ke, {
827
+ label: t.label,
828
+ focusedEl: i,
829
+ deleteFocusedEl: r,
830
+ index: a,
831
+ disabled: !!e || e === 0,
832
+ error: o,
833
+ onChange: this.changeLabel,
834
+ onDelete: c,
835
+ imageSupport: u,
836
+ toolbarOpts: f,
837
+ spellCheck: d,
838
+ maxImageWidth: p,
839
+ maxImageHeight: m,
840
+ uploadSoundSupport: h,
841
+ mathMlOptions: g,
842
+ configuration: n
843
+ }), o && /* @__PURE__ */ W(gt, { children: o })] }),
844
+ /* @__PURE__ */ W(ft, {
845
+ alternateResponseIndex: e,
846
+ category: t,
847
+ choices: t.choices,
848
+ onDeleteChoice: l,
849
+ categoryId: t.id,
850
+ extraStyles: { minHeight: "100px" },
851
+ isAlternate: this.props.isAlternate
852
+ }),
853
+ c && /* @__PURE__ */ W(mt, { children: /* @__PURE__ */ W(Xe, {
854
+ label: "delete",
855
+ onClick: c
856
+ }) })
857
+ ]
858
+ });
859
+ }
860
+ }, vt = F("div")(({ theme: e }) => ({
861
+ display: "flex",
862
+ justifyContent: "space-between",
863
+ marginBottom: e.spacing(1)
864
+ })), yt = F("div")({
865
+ display: "flex",
866
+ alignItems: "center"
867
+ }), bt = F(Be)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
868
+ fontSize: e.typography.fontSize - 2,
869
+ whiteSpace: "pre",
870
+ maxWidth: "500px"
871
+ } })), xt = class extends H.Component {
872
+ static propTypes = {
873
+ buttonLabel: K.default.string,
874
+ onAdd: K.default.func.isRequired,
875
+ label: K.default.string.isRequired,
876
+ info: K.default.any,
877
+ buttonDisabled: K.default.bool,
878
+ variant: K.default.string,
879
+ tooltip: K.default.string
880
+ };
881
+ static defaultProps = {};
882
+ render() {
883
+ let { onAdd: e, label: t, buttonLabel: n, info: r, buttonDisabled: i, variant: a, tooltip: o } = this.props;
884
+ return /* @__PURE__ */ G(vt, { children: [/* @__PURE__ */ G(yt, { children: [/* @__PURE__ */ W(A, {
885
+ variant: a || "title",
886
+ children: t
887
+ }), r] }), /* @__PURE__ */ W(bt, {
888
+ title: o || "",
889
+ enterTouchDelay: 50,
890
+ leaveTouchDelay: 3e3,
891
+ children: /* @__PURE__ */ W("span", { children: /* @__PURE__ */ W(Je, {
892
+ onClick: e,
893
+ label: n,
894
+ disabled: i
895
+ }) })
896
+ })] });
897
+ }
898
+ }, St = (e) => {
899
+ let { minChoices: t, maxChoices: n, maxCategories: r } = e || {};
900
+ return t ||= 1, "Validation requirements:" + ("\nThe choices content should not be empty and should be unique.\nThere should be at least 1 " + (r ? `and at most ${r} ` : "") + "category" + (r ? "s" : "") + " defined." + (t ? `\nThere should be at least ${t} choices defined.` : "") + (n ? `\nNo more than ${n} choices should be defined.` : "") + "\nAt least one token should be assigned to at least one category.");
901
+ }, Q = {
902
+ enabled: "Yes",
903
+ disabled: "No",
904
+ perChoice: "Set Per Choice"
905
+ }, Ct = (e) => (e || []).reduce((e, t) => Math.max(e, t.length), 0), wt = (e) => {
906
+ let { correctResponse: t = [] } = e || {};
907
+ return t.reduce((e, t) => {
908
+ let n = t?.choices?.length || 0, r = t?.alternateResponses || [], i = Math.max(n, Ct(r));
909
+ return i > e ? i : e;
910
+ }, 0);
911
+ };
912
+ //#endregion
913
+ //#region src/author/design/categories/RowLabel.tsx
914
+ function Tt(e) {
915
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
916
+ }
917
+ function Et(e, t) {
918
+ return !e || Tt(e) ? e : Tt(e.default) ? e.default : t && Tt(e[t]) ? e[t] : t && Tt(e[t]?.default) ? e[t].default : e;
919
+ }
920
+ var Dt = Et(v, "InputContainer") || Et(At.InputContainer, "InputContainer"), Ot = D, kt = Ot.default, At = kt && typeof kt == "object" ? kt : Ot, jt = F(Dt)(({ theme: e }) => ({
921
+ width: "100%",
922
+ paddingTop: e.spacing(1),
923
+ marginTop: e.spacing(1)
924
+ })), Mt = ({ categoriesPerRow: e, configuration: t, disabled: n, markup: r, imageSupport: i, onChange: a, toolbarOpts: o, spellCheck: s, maxImageWidth: c, maxImageHeight: l, uploadSoundSupport: u, mathMlOptions: d = {} }) => {
925
+ let { rowLabels: f, baseInputConfiguration: p } = t;
926
+ return /* @__PURE__ */ W("div", {
927
+ style: {
928
+ gridColumn: `1/${e + 1}`,
929
+ width: "100%"
930
+ },
931
+ children: /* @__PURE__ */ W(jt, {
932
+ label: "Row Label",
933
+ children: /* @__PURE__ */ W(R, {
934
+ disabled: n,
935
+ markup: r,
936
+ onChange: a,
937
+ imageSupport: i,
938
+ nonEmpty: !1,
939
+ toolbarOpts: o,
940
+ pluginProps: Z(f?.inputConfiguration, p),
941
+ spellCheck: s,
942
+ maxImageWidth: c,
943
+ maxImageHeight: l,
944
+ uploadSoundSupport: u,
945
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
946
+ mathMlOptions: d
947
+ })
948
+ })
949
+ });
950
+ }, Nt = F("div")(({ theme: e }) => ({ marginBottom: e.spacing(3) })), Pt = F("div")(({ theme: e }) => ({
951
+ display: "grid",
952
+ gridRowGap: e.spacing(1),
953
+ gridColumnGap: e.spacing(1)
954
+ })), Ft = F(Be)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
955
+ fontSize: e.typography.fontSize - 2,
956
+ whiteSpace: "pre",
957
+ maxWidth: "500px"
958
+ } })), It = F("div")(({ theme: e }) => ({
959
+ fontSize: e.typography.fontSize - 2,
960
+ color: e.palette.error.main,
961
+ paddingTop: e.spacing(.5)
962
+ })), Lt = class extends H.Component {
963
+ static propTypes = {
964
+ defaultImageMaxHeight: K.default.number,
965
+ defaultImageMaxWidth: K.default.number,
966
+ imageSupport: K.default.shape({
967
+ add: K.default.func.isRequired,
968
+ delete: K.default.func.isRequired
969
+ }),
970
+ uploadSoundSupport: K.default.shape({
971
+ add: K.default.func.isRequired,
972
+ delete: K.default.func.isRequired
973
+ }),
974
+ categories: K.default.array,
975
+ onModelChanged: K.default.func,
976
+ model: K.default.object.isRequired,
977
+ configuration: K.default.object.isRequired,
978
+ toolbarOpts: K.default.object,
979
+ spellCheck: K.default.bool
980
+ };
981
+ state = { focusedEl: null };
982
+ add = () => {
983
+ let { model: e, categories: t } = this.props, { categoriesPerRow: n, correctResponse: r, allowAlternateEnabled: i } = e, a = I.firstAvailableIndex(e.categories.map((e) => e.id), 1), o = {
984
+ id: a,
985
+ label: "Category " + a
986
+ }, s = e.categories.length % n === 0, c = [...e.rowLabels];
987
+ s && c.push(""), this.setState({ focusedEl: t.length }, () => {
988
+ this.props.onModelChanged({
989
+ rowLabels: c,
990
+ categories: e.categories.concat([o]),
991
+ correctResponse: i ? [...r, {
992
+ category: a,
993
+ choices: [],
994
+ alternateResponses: []
995
+ }] : r
996
+ });
997
+ });
998
+ };
999
+ deleteFocusedEl = () => {
1000
+ this.setState({ focusedEl: null });
1001
+ };
1002
+ delete = (e) => {
1003
+ let { model: t, onModelChanged: n } = this.props, r = t.categories.findIndex((t) => t.id === e.id);
1004
+ r !== -1 && (t.categories.splice(r, 1), t.correctResponse = f(e.id, t.correctResponse), n(t));
1005
+ };
1006
+ change = (e) => {
1007
+ let { categories: t } = this.props, n = t.findIndex((t) => t.id === e.id);
1008
+ n !== -1 && (t.splice(n, 1, e), this.props.onModelChanged({ categories: t }));
1009
+ };
1010
+ deleteChoiceFromCategory = (e, t, n) => {
1011
+ let { model: r, onModelChanged: i } = this.props;
1012
+ i({ correctResponse: c(t.id, e.id, n, r.correctResponse) });
1013
+ };
1014
+ changeRowLabel = (e, t) => {
1015
+ let { model: n } = this.props, { rowLabels: r } = n, i = [...r];
1016
+ i.length < t ? i.push(e) : i[t] = e, this.props.onModelChanged({ rowLabels: i });
1017
+ };
1018
+ render() {
1019
+ let { model: e, categories: t, imageSupport: n, uploadSoundSupport: r, toolbarOpts: i, spellCheck: a, configuration: o, defaultImageMaxHeight: s, defaultImageMaxWidth: c, mathMlOptions: l = {} } = this.props, { categoriesPerRow: u, rowLabels: d, errors: f } = e, { associationError: p, categoriesError: m, categoriesErrors: h } = f || {}, { maxCategories: g, maxImageWidth: _ = {}, maxImageHeight: v = {} } = o || {}, y = { gridTemplateColumns: `repeat(${u}, 1fr)` }, b = St(o);
1020
+ return /* @__PURE__ */ G(Nt, { children: [
1021
+ /* @__PURE__ */ W(xt, {
1022
+ label: "Categories",
1023
+ buttonLabel: "ADD A CATEGORY",
1024
+ onAdd: this.add,
1025
+ info: /* @__PURE__ */ W(Ft, {
1026
+ disableFocusListener: !0,
1027
+ disableTouchListener: !0,
1028
+ placement: "right",
1029
+ title: b,
1030
+ children: /* @__PURE__ */ W(Ue, {
1031
+ fontSize: "small",
1032
+ color: "primary",
1033
+ style: { marginLeft: "5px" }
1034
+ })
1035
+ }),
1036
+ buttonDisabled: g && t && g === t.length
1037
+ }),
1038
+ /* @__PURE__ */ W(Pt, {
1039
+ style: y,
1040
+ children: t.map((e, t) => {
1041
+ let f = t % u === 0, p = t / u;
1042
+ return /* @__PURE__ */ G(H.Fragment, { children: [f && /* @__PURE__ */ W(Mt, {
1043
+ categoriesPerRow: u,
1044
+ disabled: !1,
1045
+ rowIndex: p,
1046
+ markup: d[p] || "",
1047
+ onChange: (e) => this.changeRowLabel(e, p),
1048
+ imageSupport: n,
1049
+ toolbarOpts: i,
1050
+ spellCheck: a,
1051
+ maxImageWidth: _ && _.rowLabel || c,
1052
+ maxImageHeight: v && v.rowLabel || s,
1053
+ uploadSoundSupport: r,
1054
+ mathMlOptions: l,
1055
+ configuration: o
1056
+ }), /* @__PURE__ */ W(_t, {
1057
+ imageSupport: n,
1058
+ focusedEl: this.state.focusedEl,
1059
+ deleteFocusedEl: this.deleteFocusedEl,
1060
+ index: t,
1061
+ category: e,
1062
+ error: h && h[e.id],
1063
+ onChange: this.change,
1064
+ onDelete: () => this.delete(e),
1065
+ toolbarOpts: i,
1066
+ spellCheck: a,
1067
+ onDeleteChoice: (t, n) => this.deleteChoiceFromCategory(e, t, n),
1068
+ maxImageWidth: _ && _.categoryLabel || c,
1069
+ maxImageHeight: v && v.categoryLabel || s,
1070
+ uploadSoundSupport: r,
1071
+ configuration: o,
1072
+ alternateResponseIndex: void 0
1073
+ })] }, t);
1074
+ })
1075
+ }),
1076
+ p && /* @__PURE__ */ W(It, { children: p }),
1077
+ m && /* @__PURE__ */ W(It, { children: m })
1078
+ ] });
1079
+ }
1080
+ }, Rt = F("div")(({ theme: e }) => ({ marginBottom: e.spacing(2.5) })), zt = F("div")(({ theme: e }) => ({
1081
+ display: "grid",
1082
+ gridRowGap: e.spacing(1),
1083
+ gridColumnGap: e.spacing(1)
1084
+ })), Bt = F("div")({ gridColumn: "1 / 3" }), Vt = class extends H.Component {
1085
+ static propTypes = {
1086
+ altIndex: K.default.number.isRequired,
1087
+ configuration: K.default.object,
1088
+ imageSupport: K.default.shape({
1089
+ add: K.default.func.isRequired,
1090
+ delete: K.default.func.isRequired
1091
+ }),
1092
+ categories: K.default.array,
1093
+ onModelChanged: K.default.func,
1094
+ model: K.default.object.isRequired,
1095
+ uploadSoundSupport: K.default.shape({
1096
+ add: K.default.func.isRequired,
1097
+ delete: K.default.func.isRequired
1098
+ }),
1099
+ spellCheck: K.default.bool
1100
+ };
1101
+ deleteChoiceFromCategory = (e, t, n) => {
1102
+ let { model: i, altIndex: a, onModelChanged: o } = this.props;
1103
+ o({ correctResponse: r(t.id, e.id, n, a, i.correctResponse) });
1104
+ };
1105
+ render() {
1106
+ let { altIndex: e, model: t, configuration: n, categories: r, imageSupport: i, spellCheck: a, uploadSoundSupport: o, mathMlOptions: s = {} } = this.props, { categoriesPerRow: c, errors: l, rowLabels: u } = t, { duplicateAlternate: d } = l || {}, f = { gridTemplateColumns: `repeat(${c}, 1fr)` }, p = d ? d.index === e : !1;
1107
+ return /* @__PURE__ */ W(Rt, { children: /* @__PURE__ */ W(zt, {
1108
+ style: f,
1109
+ children: r.map((t, r) => {
1110
+ let l = r % c === 0, f = r / c;
1111
+ return /* @__PURE__ */ G(H.Fragment, { children: [l && /* @__PURE__ */ W(Bt, {
1112
+ style: {
1113
+ gridColumn: `1/${c + 1}`,
1114
+ width: "100%"
1115
+ },
1116
+ dangerouslySetInnerHTML: { __html: u[f] || "" }
1117
+ }), /* @__PURE__ */ W(_t, {
1118
+ alternateResponseIndex: e,
1119
+ imageSupport: i,
1120
+ isDuplicated: p && d.category === t.id,
1121
+ category: t,
1122
+ spellCheck: a,
1123
+ onDeleteChoice: (e, n) => this.deleteChoiceFromCategory(t, e, n),
1124
+ uploadSoundSupport: o,
1125
+ mathMlOptions: s,
1126
+ configuration: n,
1127
+ isAlternate: !0
1128
+ }, r)] }, r);
1129
+ })
1130
+ }) });
1131
+ }
1132
+ }, Ht = y(/*#__PURE__*/ W("path", { d: "M20 9H4v2h16zM4 15h16v-2H4z" }), "DragHandle");
1133
+ //#endregion
1134
+ //#region src/author/design/choices/choice.tsx
1135
+ (0, st.default)("@pie-element:categorize:configure:choice");
1136
+ var Ut = (e) => {
1137
+ if (e.lockChoiceOrder) return !0;
1138
+ let t = e.choice.categoryCount || 0;
1139
+ return t === 0 ? !0 : e.correctResponseCount < t;
1140
+ }, Wt = F(ve)(({ theme: e }) => ({
1141
+ minWidth: "196px",
1142
+ padding: e.spacing(1),
1143
+ overflow: "visible"
1144
+ })), Gt = F(ke)({
1145
+ padding: 0,
1146
+ justifyContent: "space-between"
1147
+ }), Kt = F("span", { shouldForwardProp: (e) => e !== "draggable" })(({ draggable: e }) => ({
1148
+ cursor: e ? "move" : "inherit",
1149
+ touchAction: "none"
1150
+ })), qt = F("div")(({ theme: e }) => ({
1151
+ fontSize: e.typography.fontSize - 2,
1152
+ color: e.palette.error.main,
1153
+ paddingBottom: e.spacing(1)
1154
+ })), Jt = ({ allowMultiplePlacements: e, configuration: t, choice: n, deleteFocusedEl: r, focusedEl: i, index: a, onDelete: o, onChange: s, correctResponseCount: c, lockChoiceOrder: l, imageSupport: u, spellCheck: d, toolbarOpts: f, error: p, maxImageWidth: m, maxImageHeight: h, uploadSoundSupport: g }) => {
1155
+ let _ = Ut({
1156
+ choice: n,
1157
+ correctResponseCount: c,
1158
+ lockChoiceOrder: l
1159
+ }), { attributes: v, listeners: y, setNodeRef: b, isDragging: ee } = ye({
1160
+ id: `choice-${n.id}`,
1161
+ data: {
1162
+ id: n.id,
1163
+ index: a,
1164
+ type: "choice"
1165
+ },
1166
+ disabled: !_
1167
+ }), { setNodeRef: te } = B({
1168
+ id: `choice-drop-${n.id}`,
1169
+ data: {
1170
+ id: n.id,
1171
+ index: a,
1172
+ type: "choice"
1173
+ }
1174
+ }), x = (e) => {
1175
+ n.content = e, s(n);
1176
+ }, S = () => {
1177
+ n.categoryCount === 1 ? n.categoryCount = 0 : n.categoryCount = 1, s(n);
1178
+ }, ne = ((e) => e === Q.perChoice)(e);
1179
+ return /* @__PURE__ */ G(Wt, {
1180
+ ref: (e) => {
1181
+ b(e), te(e);
1182
+ },
1183
+ style: { opacity: ee ? .5 : 1 },
1184
+ children: [
1185
+ /* @__PURE__ */ W(Gt, { children: /* @__PURE__ */ W(Kt, {
1186
+ draggable: _,
1187
+ ...v,
1188
+ ...y,
1189
+ children: /* @__PURE__ */ W(Ht, { color: _ ? "primary" : "disabled" })
1190
+ }) }),
1191
+ /* @__PURE__ */ W(Ke, {
1192
+ imageSupport: u,
1193
+ focusedEl: i,
1194
+ deleteFocusedEl: r,
1195
+ index: a,
1196
+ label: n.content,
1197
+ onChange: x,
1198
+ onDelete: o,
1199
+ toolbarOpts: f,
1200
+ spellCheck: d,
1201
+ error: p,
1202
+ maxImageWidth: m,
1203
+ maxImageHeight: h,
1204
+ uploadSoundSupport: g,
1205
+ configuration: t
1206
+ }),
1207
+ p && /* @__PURE__ */ W(qt, { children: p }),
1208
+ /* @__PURE__ */ G(Gt, { children: [/* @__PURE__ */ W(Xe, {
1209
+ label: "delete",
1210
+ onClick: o
1211
+ }), ne && /* @__PURE__ */ W(le, {
1212
+ mini: !0,
1213
+ label: "Remove after placing",
1214
+ checked: n.categoryCount === 1,
1215
+ onChange: S
1216
+ })] })
1217
+ ]
1218
+ });
1219
+ };
1220
+ Jt.propTypes = {
1221
+ allowMultiplePlacements: K.default.string,
1222
+ configuration: K.default.object.isRequired,
1223
+ choice: K.default.object.isRequired,
1224
+ deleteFocusedEl: K.default.func,
1225
+ focusedEl: K.default.number,
1226
+ index: K.default.number,
1227
+ lockChoiceOrder: K.default.bool,
1228
+ maxImageHeight: K.default.object,
1229
+ maxImageWidth: K.default.object,
1230
+ onChange: K.default.func.isRequired,
1231
+ onDelete: K.default.func.isRequired,
1232
+ correctResponseCount: K.default.number.isRequired,
1233
+ imageSupport: K.default.shape({
1234
+ add: K.default.func.isRequired,
1235
+ delete: K.default.func.isRequired
1236
+ }),
1237
+ toolbarOpts: K.default.object,
1238
+ error: K.default.string,
1239
+ uploadSoundSupport: K.default.shape({
1240
+ add: K.default.func.isRequired,
1241
+ delete: K.default.func.isRequired
1242
+ }),
1243
+ spellCheck: K.default.bool,
1244
+ rearrangeChoices: K.default.func
1245
+ };
1246
+ var Yt = N.withUid(Jt), Xt = F("div")(({ theme: e }) => ({
1247
+ paddingTop: e.spacing(1),
1248
+ marginBottom: e.spacing(1)
1249
+ })), Zt = F(M)({ width: "100%" }), Qt = class extends H.Component {
1250
+ static propTypes = {
1251
+ config: K.default.object,
1252
+ onModelChanged: K.default.func,
1253
+ spellCheck: K.default.bool
1254
+ };
1255
+ static defaultProps = {};
1256
+ changeLabel = ({ target: e }) => {
1257
+ this.props.onModelChanged({ choicesLabel: e.value });
1258
+ };
1259
+ render() {
1260
+ let { config: e, spellCheck: t } = this.props;
1261
+ return /* @__PURE__ */ W(Xt, { children: /* @__PURE__ */ W(Zt, {
1262
+ InputLabelProps: { shrink: !0 },
1263
+ variant: "outlined",
1264
+ label: "Label",
1265
+ value: e.choicesLabel,
1266
+ onChange: this.changeLabel,
1267
+ spellCheck: t
1268
+ }) });
1269
+ }
1270
+ }, $t = F("div")(({ theme: e }) => ({ marginBottom: e.spacing(2.5) })), en = F("div")(({ theme: e }) => ({
1271
+ paddingTop: e.spacing(1),
1272
+ paddingBottom: e.spacing(1),
1273
+ display: "grid",
1274
+ gridRowGap: e.spacing(1),
1275
+ gridColumnGap: e.spacing(1)
1276
+ })), tn = F("div")(({ theme: e }) => ({
1277
+ fontSize: e.typography.fontSize - 2,
1278
+ color: e.palette.error.main,
1279
+ paddingTop: e.spacing(.5)
1280
+ })), nn = class extends H.Component {
1281
+ static propTypes = {
1282
+ model: K.default.object.isRequired,
1283
+ configuration: K.default.object.isRequired,
1284
+ choices: K.default.array.isRequired,
1285
+ defaultImageMaxWidth: K.default.number,
1286
+ defaultImageMaxHeight: K.default.number,
1287
+ onModelChanged: K.default.func.isRequired,
1288
+ imageSupport: K.default.shape({
1289
+ add: K.default.func.isRequired,
1290
+ delete: K.default.func.isRequired
1291
+ }),
1292
+ uploadSoundSupport: K.default.shape({
1293
+ add: K.default.func.isRequired,
1294
+ delete: K.default.func.isRequired
1295
+ }),
1296
+ toolbarOpts: K.default.object,
1297
+ spellCheck: K.default.bool
1298
+ };
1299
+ static defaultProps = {};
1300
+ state = { focusedEl: null };
1301
+ changeChoice = (e) => {
1302
+ let { choices: t, onModelChanged: n } = this.props, r = t.findIndex((t) => t.id === e.id);
1303
+ r !== -1 && (t.splice(r, 1, e), n({ choices: t }));
1304
+ };
1305
+ allChoicesHaveCount = (e) => {
1306
+ let { choices: t } = this.props;
1307
+ return Array.isArray(t) && t.every((t) => t.categoryCount === e);
1308
+ };
1309
+ addChoice = () => {
1310
+ let { onModelChanged: e, model: t, choices: n } = this.props, { maxAnswerChoices: r } = t || {};
1311
+ if (r && t.choices?.length >= r) return;
1312
+ let i = I.firstAvailableIndex(t.choices.map((e) => e.id), 1), a = {
1313
+ id: i,
1314
+ content: "Choice " + i
1315
+ };
1316
+ this.setState({ focusedEl: n.length }, () => {
1317
+ e({ choices: t.choices.concat([a]) });
1318
+ });
1319
+ };
1320
+ deleteFocusedEl = () => {
1321
+ this.setState({ focusedEl: null });
1322
+ };
1323
+ deleteChoice = (e) => {
1324
+ let { model: n, onModelChanged: r } = this.props, i = n.choices.findIndex((t) => t.id === e.id);
1325
+ i !== -1 && (n.choices.splice(i, 1), n.correctResponse = t(e.id, n.correctResponse), r(n));
1326
+ };
1327
+ render() {
1328
+ let { focusedEl: e } = this.state, { choices: t, model: n, imageSupport: r, uploadSoundSupport: i, onModelChanged: a, spellCheck: o, toolbarOpts: s, configuration: c, defaultImageMaxWidth: l, defaultImageMaxHeight: u } = this.props, { errors: d, allowMultiplePlacementsEnabled: f, lockChoiceOrder: p, maxAnswerChoices: m } = n, { choicesError: h, choicesErrors: g } = d || {}, { maxImageWidth: _ = {}, maxImageHeight: v = {} } = c || {}, y = { gridTemplateColumns: `repeat(${n.categoriesPerRow}, 1fr)` }, b = m && t?.length >= m ? `Only ${m} allowed maximum` : "";
1329
+ return /* @__PURE__ */ G($t, { children: [
1330
+ /* @__PURE__ */ W(xt, {
1331
+ label: "Choices",
1332
+ buttonLabel: "ADD A CHOICE",
1333
+ onAdd: this.addChoice,
1334
+ buttonDisabled: m && t && t?.length >= m,
1335
+ tooltip: b
1336
+ }),
1337
+ /* @__PURE__ */ W(Qt, {
1338
+ config: n,
1339
+ onModelChanged: a,
1340
+ spellCheck: o
1341
+ }),
1342
+ /* @__PURE__ */ W(en, {
1343
+ style: y,
1344
+ children: t.map((t, n) => /* @__PURE__ */ W(Yt, {
1345
+ choice: t,
1346
+ focusedEl: e,
1347
+ deleteFocusedEl: this.deleteFocusedEl,
1348
+ correctResponseCount: t.correctResponseCount,
1349
+ allowMultiplePlacements: f,
1350
+ lockChoiceOrder: p,
1351
+ index: n,
1352
+ imageSupport: r,
1353
+ onChange: this.changeChoice,
1354
+ onDelete: () => this.deleteChoice(t),
1355
+ toolbarOpts: s,
1356
+ spellCheck: o,
1357
+ error: g && g[t.id],
1358
+ maxImageWidth: _ && _.choice || l,
1359
+ maxImageHeight: v && v.choice || u,
1360
+ uploadSoundSupport: i,
1361
+ configuration: c
1362
+ }, t.id))
1363
+ }),
1364
+ h && /* @__PURE__ */ W(tn, { children: h })
1365
+ ] });
1366
+ }
1367
+ }, rn = (e, t, n) => Ce(e).map((e) => {
1368
+ let r = n.find((t) => t.category === e.id);
1369
+ return r && (e.choices = (r.choices || []).map((e) => {
1370
+ let n = t.find((t) => t.id === e);
1371
+ if (n) return Object.assign({}, {
1372
+ id: n.id,
1373
+ content: n.content
1374
+ });
1375
+ })), e;
1376
+ }), an = (e, t, n) => !e.alternateResponses || e.alternateResponses.length === 0 ? [] : (e.alternateResponses[n] || []).map((e) => t.find((t) => t.id === e)), on = (e, t, n) => {
1377
+ let r = n.reduce((e, t) => t.alternateResponses && t.alternateResponses.length >= e ? t.alternateResponses.length : e, 0);
1378
+ return Array(r).fill(0).map((r, i) => n.map((n, r) => {
1379
+ let a = e[r];
1380
+ return {
1381
+ id: a.id,
1382
+ label: a.label,
1383
+ choices: an(n, t, i)
1384
+ };
1385
+ }));
1386
+ }, { translator: sn } = e, { dropdown: cn, Panel: ln, toggle: $, radio: un, numberField: dn } = P, { Provider: fn } = N, pn = class extends H.Component {
1387
+ containerRef = H.createRef();
1388
+ componentDidMount() {
1389
+ this.containerRef.current && setTimeout(() => L(this.containerRef.current), 0);
1390
+ }
1391
+ render() {
1392
+ return /* @__PURE__ */ W("div", {
1393
+ ref: this.containerRef,
1394
+ children: this.props.children
1395
+ });
1396
+ }
1397
+ }, mn = F(xt)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), hn = F(z)(({ theme: e }) => ({
1398
+ width: "100%",
1399
+ paddingTop: e.spacing(1),
1400
+ marginTop: e.spacing(1),
1401
+ marginBottom: e.spacing(2)
1402
+ })), gn = F("div")(({ theme: e }) => ({
1403
+ fontSize: e.typography.fontSize - 2,
1404
+ color: e.palette.error.main,
1405
+ paddingTop: e.spacing(1)
1406
+ })), _n = class extends H.Component {
1407
+ static propTypes = {
1408
+ configuration: K.default.object,
1409
+ className: K.default.string,
1410
+ onConfigurationChanged: K.default.func,
1411
+ model: K.default.object.isRequired,
1412
+ onChange: K.default.func.isRequired,
1413
+ uid: K.default.string,
1414
+ imageSupport: K.default.shape({
1415
+ add: K.default.func.isRequired,
1416
+ delete: K.default.func.isRequired
1417
+ }),
1418
+ uploadSoundSupport: K.default.shape({
1419
+ add: K.default.func.isRequired,
1420
+ delete: K.default.func.isRequired
1421
+ })
1422
+ };
1423
+ constructor(e) {
1424
+ super(e), this.uid = e.uid || N.generateId(), this.state = { activeDragItem: null };
1425
+ }
1426
+ updateModel = (e) => {
1427
+ let { model: t, onChange: r } = this.props, i = {
1428
+ ...t,
1429
+ ...e
1430
+ };
1431
+ i.choices = i.choices.map((e) => ({
1432
+ ...e,
1433
+ categoryCount: this.checkAllowMultiplePlacements(i.allowMultiplePlacementsEnabled, e)
1434
+ })), i.correctResponse = u(i.correctResponse || [], i.choices), i.correctResponse = n(i.correctResponse || [], i.choices), i.categories = i.categories.map((e) => ({
1435
+ id: e.id,
1436
+ label: e.label
1437
+ })), i.choices = i.choices.map((e) => ({
1438
+ id: e.id,
1439
+ content: e.content,
1440
+ categoryCount: e.categoryCount
1441
+ })), i.maxChoicesPerCategory = i.allowMaxChoicesPerCategory ? i.maxChoicesPerCategory : 0, r(i);
1442
+ };
1443
+ changeRationale = (e) => {
1444
+ let { model: t, onChange: n } = this.props;
1445
+ n({
1446
+ ...t,
1447
+ rationale: e
1448
+ });
1449
+ };
1450
+ changeTeacherInstructions = (e) => {
1451
+ let { model: t, onChange: n } = this.props;
1452
+ n({
1453
+ ...t,
1454
+ teacherInstructions: e
1455
+ });
1456
+ };
1457
+ changeFeedback = (e) => {
1458
+ this.updateModel({ feedback: e });
1459
+ };
1460
+ onAddAlternateResponse = () => {
1461
+ let { model: { correctResponse: e } } = this.props;
1462
+ this.updateModel({ correctResponse: (e || []).map((e) => ({
1463
+ ...e,
1464
+ alternateResponses: [...e.alternateResponses || [], []]
1465
+ })) });
1466
+ };
1467
+ onPromptChanged = (e) => this.updateModel({ prompt: e });
1468
+ onRemoveAlternateResponse = (e) => {
1469
+ let { model: { correctResponse: t } } = this.props;
1470
+ this.updateModel({ correctResponse: (t || []).map((t) => ({
1471
+ ...t,
1472
+ alternateResponses: (t.alternateResponses || []).filter((t, n) => n !== e)
1473
+ })) });
1474
+ };
1475
+ countChoiceInCorrectResponse = (e) => {
1476
+ let { model: t } = this.props;
1477
+ return o(e.id, t.correctResponse);
1478
+ };
1479
+ checkAllowMultiplePlacements = (e, t) => e === Q.enabled ? 0 : e === Q.disabled ? 1 : t.categoryCount || 0;
1480
+ isAlertModalOpened = () => {
1481
+ let { model: e } = this.props, { maxChoicesPerCategory: t = 0 } = e || {}, n = wt(e);
1482
+ return t === 0 ? !1 : n > t;
1483
+ };
1484
+ onAlertModalCancel = () => {
1485
+ let { model: e } = this.props, t = wt(e);
1486
+ this.updateModel({ maxChoicesPerCategory: t });
1487
+ };
1488
+ onDragStart = (e) => {
1489
+ let { active: t } = e, n = t.data.current;
1490
+ this.setState({ activeDragItem: n });
1491
+ };
1492
+ onDragEnd = ({ active: e, over: t }) => {
1493
+ let n = window.scrollX, r = window.scrollY;
1494
+ if (this.setState({ activeDragItem: null }), !e) return;
1495
+ requestAnimationFrame(() => {
1496
+ requestAnimationFrame(() => {
1497
+ window.scrollTo(n, r);
1498
+ });
1499
+ });
1500
+ let { model: i } = this.props, { allowAlternateEnabled: a, categories: o = [], choices: s = [] } = i, c = e?.data?.current, l = t?.data?.current;
1501
+ if (!c) return;
1502
+ let u = c.choiceIndex || 0, d = l?.type, f = c.type === "choice-preview", p = c.type === "choice", m = c.choice?.id || (typeof c.id == "string" ? c.id.split("-")[0] : c.id);
1503
+ if (f && (!l || d === "choice")) {
1504
+ this.removeChoiceFromSource(c, u, {
1505
+ allowAlternateEnabled: a,
1506
+ categories: o,
1507
+ choices: s
1508
+ });
1509
+ return;
1510
+ }
1511
+ if (f && d === "category") return this.moveChoice(m, c.categoryId, l.id, u);
1512
+ if (p && d === "category") return this.addChoiceToCategory({ id: c.id }, l.id);
1513
+ if (f && d === "category-alternate") return this.moveChoiceInAlternate(m, c.categoryId, l.id, u, l.alternateResponseIndex);
1514
+ if (a && p && d === "category-alternate") return this.addChoiceToAlternateCategory({ id: c.id }, l.id, l.alternateResponseIndex);
1515
+ };
1516
+ removeChoiceFromSource = (e, t, { allowAlternateEnabled: n, categories: r, choices: i }) => {
1517
+ if (e.alternateResponseIndex === void 0) {
1518
+ this.deleteChoiceFromCategory(e.categoryId, e.choiceId, t);
1519
+ return;
1520
+ }
1521
+ if (!n) return;
1522
+ let a = r?.find((t) => t.id === e.categoryId), o = i?.find((t) => t.id === e.choiceId);
1523
+ a && o && this.deleteChoiceFromAlternateCategory(a, o, t, e.alternateResponseIndex);
1524
+ };
1525
+ addChoiceToCategory = (e, t) => {
1526
+ let { model: n } = this.props, { choices: r = [], correctResponse: i = [], maxChoicesPerCategory: a = 0 } = n || {}, o = (r || []).find((t) => t.id === e.id), s = d(e.id, void 0, t, 0, i);
1527
+ o.categoryCount !== 0 && (s = l(e, t, s));
1528
+ let c = wt(n);
1529
+ this.updateModel({
1530
+ correctResponse: s,
1531
+ maxChoicesPerCategory: a !== 0 && a < c ? a + 1 : a
1532
+ });
1533
+ };
1534
+ deleteChoiceFromCategory = (e, t, n) => {
1535
+ let { model: r } = this.props, i = c(t, e, n, r.correctResponse);
1536
+ this.updateModel({ correctResponse: i });
1537
+ };
1538
+ moveChoice = (e, t, n, r) => {
1539
+ let { model: i } = this.props, { choices: a, correctResponse: o = [], maxChoicesPerCategory: s = 0 } = i || {}, c = (a || []).find((t) => t.id === e);
1540
+ if (n === t || !c) return;
1541
+ c.categoryCount === 0 ? c.categoryCount === 0 && (o = d(c.id, void 0, n, 0, o)) : (o = d(c.id, t, n, r, o), o = l(c, n, o));
1542
+ let u = wt(i);
1543
+ this.updateModel({
1544
+ correctResponse: o,
1545
+ maxChoicesPerCategory: s !== 0 && s < u ? s + 1 : s
1546
+ });
1547
+ };
1548
+ addChoiceToAlternateCategory = (e, t, n) => {
1549
+ let { model: r } = this.props, { correctResponse: i, choices: a, maxChoicesPerCategory: o = 0 } = r, s = a.find((t) => t.id === e.id);
1550
+ i.forEach((r) => r.category === t ? (r.alternateResponses = r.alternateResponses || [], r.alternateResponses[n] === void 0 && (r.alternateResponses[n] = []), r.alternateResponses[n].push(e.id), s.categoryCount && s.categoryCount !== 0 && (r.alternateResponses[n] = r.alternateResponses[n].reduce((e, t) => (t === s.id ? e.findIndex((e) => e === s.id) === -1 && e.push(t) : e.push(t), e), [])), r) : (r.alternateResponses[n] && s.categoryCount !== 0 && (r.alternateResponses[n] = r.alternateResponses[n].filter((t) => t !== e.id)), r));
1551
+ let c = wt(r);
1552
+ this.updateModel({
1553
+ correctResponse: i,
1554
+ maxChoicesPerCategory: o !== 0 && o < c ? o + 1 : o
1555
+ });
1556
+ };
1557
+ moveChoiceInAlternate = (e, t, n, r, i) => {
1558
+ let { model: a } = this.props, { choices: o, correctResponse: s = [], maxChoicesPerCategory: c = 0 } = a || {}, l = (o || []).find((t) => t.id === e);
1559
+ s = p(e, t, n, r, s, i, l?.categoryCount);
1560
+ let u = wt(a);
1561
+ this.updateModel({
1562
+ correctResponse: s,
1563
+ maxChoicesPerCategory: c !== 0 && c < u ? c + 1 : c
1564
+ });
1565
+ };
1566
+ deleteChoiceFromAlternateCategory = (e, t, n, i) => {
1567
+ let { model: a } = this.props, o = r(t.id, e.id, n, i, a.correctResponse);
1568
+ this.updateModel({ correctResponse: o });
1569
+ };
1570
+ renderDragOverlay = () => {
1571
+ let { activeDragItem: e } = this.state, { model: t, configuration: n } = this.props;
1572
+ if (!e) return null;
1573
+ if (e.type === "choice") {
1574
+ let r = t.choices?.find((t) => t.id === e.id);
1575
+ return r ? /* @__PURE__ */ W(Yt, {
1576
+ choice: r,
1577
+ configuration: n
1578
+ }) : null;
1579
+ } else if (e.type === "choice-preview" && e.alternateResponseIndex === void 0) {
1580
+ let n = t.choices?.find((t) => t.id === e.id);
1581
+ return n ? /* @__PURE__ */ W(ot, { choice: n }) : null;
1582
+ } else if (e.type === "choice-preview" && e.alternateResponseIndex !== void 0) {
1583
+ let n = t.choices?.find((t) => t.id === e.id);
1584
+ return n ? /* @__PURE__ */ W(ot, {
1585
+ choice: n,
1586
+ alternateResponseIndex: e.alternateResponseIndex
1587
+ }) : null;
1588
+ }
1589
+ return null;
1590
+ };
1591
+ render() {
1592
+ let { configuration: e, imageSupport: t, model: n, uploadSoundSupport: r, onConfigurationChanged: i } = this.props, { allowAlternate: a = {}, allowMultiplePlacements: o = {}, baseInputConfiguration: s = {}, categoriesPerRow: c = {}, choicesPosition: l = {}, contentDimensions: u = {}, feedback: d = {}, lockChoiceOrder: f = {}, maxImageHeight: p = {}, maxImageWidth: m = {}, maxPlacements: h = {}, minCategoriesPerRow: g = 1, partialScoring: _ = {}, prompt: v = {}, rationale: y = {}, scoringType: b = {}, settingsPanelDisabled: ee, spellCheck: te = {}, studentInstructions: x = {}, teacherInstructions: S = {}, withRubric: ne = {}, mathMlOptions: C = {}, language: w = {}, languageChoices: T = {}, allowMaxAnswerChoices: E = {} } = e || {}, { allowAlternateEnabled: re, allowMaxChoicesPerCategory: ie, errors: ae, feedbackEnabled: oe, maxChoicesPerCategory: se, promptEnabled: le, rationaleEnabled: D, spellCheckEnabled: k, teacherInstructionsEnabled: ue, toolbarEditorPosition: A, extraCSSRules: de } = n || {}, { prompt: j, rationale: M, teacherInstructions: N } = ae || {}, P = { position: A === "top" ? "top" : "bottom" }, me = n.config || {};
1593
+ me.choices = me.choices || {
1594
+ label: "",
1595
+ columns: 2
1596
+ };
1597
+ let ge = rn(n.categories || [], n.choices || [], n.correctResponse || []), F = on(n.categories || [], n.choices || [], n.correctResponse || []), I = n.choices.map((e) => (e.correctResponseCount = this.countChoiceInCorrectResponse(e), e.categoryCount = this.checkAllowMultiplePlacements(n.allowMultiplePlacementsEnabled, e), e)), L = m && m.prompt, z = p && p.prompt, _e = {
1598
+ partialScoring: _.settings && $(_.label),
1599
+ lockChoiceOrder: f.settings && $(f.label),
1600
+ categoriesPerRow: c.settings && dn(c.label, {
1601
+ label: c.label,
1602
+ min: g,
1603
+ max: 6
1604
+ }),
1605
+ choicesPosition: l.settings && un(l.label, [
1606
+ "below",
1607
+ "above",
1608
+ "left",
1609
+ "right"
1610
+ ]),
1611
+ allowMultiplePlacementsEnabled: o.settings && cn(o.label, [
1612
+ Q.enabled,
1613
+ Q.disabled,
1614
+ Q.perChoice
1615
+ ]),
1616
+ maxAnswerChoices: E.settings && dn(E.label, {
1617
+ label: "",
1618
+ min: I?.length || 0,
1619
+ max: 30
1620
+ }),
1621
+ allowMaxChoicesPerCategory: h.settings && $(h.label),
1622
+ maxChoicesPerCategory: ie === !0 && dn(h.label, {
1623
+ label: "",
1624
+ min: 0,
1625
+ max: 30
1626
+ }),
1627
+ promptEnabled: v.settings && $(v.label),
1628
+ feedbackEnabled: d.settings && $(d.label),
1629
+ allowAlternateEnabled: a.settings && $(a.label),
1630
+ "language.enabled": w.settings && $(w.label, !0),
1631
+ language: w.settings && w.enabled && cn(T.label, T.options)
1632
+ }, ve = {
1633
+ teacherInstructionsEnabled: S.settings && $(S.label),
1634
+ studentInstructionsEnabled: x.settings && $(x.label),
1635
+ rationaleEnabled: y.settings && $(y.label),
1636
+ spellCheckEnabled: te.settings && $(te.label),
1637
+ scoringType: b.settings && un(b.label, ["auto", "rubric"]),
1638
+ rubricEnabled: ne?.settings && $(ne?.label)
1639
+ }, ye = this.isAlertModalOpened(), B = sn.t("translation:categorize:maxChoicesPerCategoryRestriction", {
1640
+ lng: n.language,
1641
+ maxChoicesPerCategory: se
1642
+ });
1643
+ return /* @__PURE__ */ W(fe, {
1644
+ onDragStart: this.onDragStart,
1645
+ onDragEnd: this.onDragEnd,
1646
+ children: /* @__PURE__ */ G(fn, {
1647
+ value: this.uid,
1648
+ children: [/* @__PURE__ */ G(pe.ConfigLayout, {
1649
+ extraCSSRules: de,
1650
+ dimensions: u,
1651
+ hideSettings: ee,
1652
+ settings: /* @__PURE__ */ W(ln, {
1653
+ model: n,
1654
+ onChangeModel: this.updateModel,
1655
+ configuration: e,
1656
+ onChangeConfiguration: i,
1657
+ groups: {
1658
+ Settings: _e,
1659
+ Properties: ve
1660
+ },
1661
+ modal: /* @__PURE__ */ W(O, {
1662
+ title: "Warning",
1663
+ text: B,
1664
+ open: ye,
1665
+ onClose: this.onAlertModalCancel
1666
+ })
1667
+ }),
1668
+ children: [
1669
+ ue && /* @__PURE__ */ G(hn, {
1670
+ label: S.label,
1671
+ children: [/* @__PURE__ */ W(R, {
1672
+ markup: n.teacherInstructions || "",
1673
+ onChange: this.changeTeacherInstructions,
1674
+ imageSupport: t,
1675
+ error: N,
1676
+ nonEmpty: !1,
1677
+ toolbarOpts: P,
1678
+ pluginProps: Z(S?.inputConfiguration, s),
1679
+ spellCheck: k,
1680
+ maxImageWidth: m && m.teacherInstructions || L,
1681
+ maxImageHeight: p && p.teacherInstructions || z,
1682
+ uploadSoundSupport: r,
1683
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
1684
+ mathMlOptions: C
1685
+ }), N && /* @__PURE__ */ W(gn, { children: N })]
1686
+ }),
1687
+ le && /* @__PURE__ */ G(hn, {
1688
+ label: v.label,
1689
+ children: [/* @__PURE__ */ W(R, {
1690
+ markup: n.prompt || "",
1691
+ onChange: this.onPromptChanged,
1692
+ imageSupport: t,
1693
+ error: j,
1694
+ nonEmpty: !1,
1695
+ disableUnderline: !0,
1696
+ toolbarOpts: P,
1697
+ pluginProps: Z(v?.inputConfiguration, s),
1698
+ spellCheck: k,
1699
+ maxImageWidth: m && m.prompt,
1700
+ maxImageHeight: p && p.prompt,
1701
+ uploadSoundSupport: r,
1702
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
1703
+ mathMlOptions: C
1704
+ }), j && /* @__PURE__ */ W(gn, { children: j })]
1705
+ }),
1706
+ /* @__PURE__ */ W(Lt, {
1707
+ imageSupport: t,
1708
+ uploadSoundSupport: r,
1709
+ model: n,
1710
+ categories: ge || [],
1711
+ onModelChanged: this.updateModel,
1712
+ toolbarOpts: P,
1713
+ spellCheck: k,
1714
+ configuration: e,
1715
+ defaultImageMaxWidth: L,
1716
+ defaultImageMaxHeight: z,
1717
+ mathMlOptions: C
1718
+ }),
1719
+ /* @__PURE__ */ W(nn, {
1720
+ imageSupport: t,
1721
+ uploadSoundSupport: r,
1722
+ choices: I,
1723
+ model: n,
1724
+ onModelChanged: this.updateModel,
1725
+ toolbarOpts: P,
1726
+ spellCheck: k,
1727
+ configuration: e,
1728
+ defaultImageMaxWidth: L,
1729
+ defaultImageMaxHeight: z
1730
+ }),
1731
+ re && /* @__PURE__ */ W(mn, {
1732
+ label: "Alternate Responses",
1733
+ buttonLabel: "ADD AN ALTERNATE RESPONSE",
1734
+ onAdd: this.onAddAlternateResponse
1735
+ }),
1736
+ re && F.map((i, a) => /* @__PURE__ */ G(H.Fragment, { children: [/* @__PURE__ */ W(mn, {
1737
+ variant: "subtitle1",
1738
+ label: "Alternate Response",
1739
+ buttonLabel: "REMOVE ALTERNATE RESPONSE",
1740
+ onAdd: () => this.onRemoveAlternateResponse(a)
1741
+ }), /* @__PURE__ */ W(Vt, {
1742
+ altIndex: a,
1743
+ imageSupport: t,
1744
+ model: n,
1745
+ configuration: e,
1746
+ categories: i,
1747
+ onModelChanged: this.updateModel,
1748
+ uploadSoundSupport: r,
1749
+ mathMlOptions: C
1750
+ })] }, a)),
1751
+ D && /* @__PURE__ */ G(hn, {
1752
+ label: y.label,
1753
+ children: [/* @__PURE__ */ W(R, {
1754
+ markup: n.rationale || "",
1755
+ onChange: this.changeRationale,
1756
+ imageSupport: t,
1757
+ error: M,
1758
+ nonEmpty: !1,
1759
+ toolbarOpts: P,
1760
+ pluginProps: Z(v?.inputConfiguration, s),
1761
+ spellCheck: k,
1762
+ maxImageWidth: m && m.rationale || L,
1763
+ maxImageHeight: p && p.rationale || z,
1764
+ uploadSoundSupport: r,
1765
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
1766
+ mathMlOptions: C
1767
+ }), M && /* @__PURE__ */ W(gn, { children: M })]
1768
+ }),
1769
+ oe && /* @__PURE__ */ W(he, {
1770
+ feedback: n.feedback,
1771
+ onChange: this.changeFeedback,
1772
+ toolbarOpts: P
1773
+ })
1774
+ ]
1775
+ }), /* @__PURE__ */ W(ce, { children: /* @__PURE__ */ W(pn, { children: this.renderDragOverlay() }) })]
1776
+ })
1777
+ });
1778
+ }
1779
+ }, vn = class extends H.Component {
1780
+ static propTypes = {
1781
+ configuration: K.default.object,
1782
+ onConfigurationChanged: K.default.func,
1783
+ model: K.default.object.isRequired,
1784
+ onModelChanged: K.default.func.isRequired,
1785
+ imageSupport: K.default.object,
1786
+ uploadSoundSupport: K.default.object
1787
+ };
1788
+ static defaultProps = {};
1789
+ render() {
1790
+ let { model: e, onModelChanged: t, configuration: n, onConfigurationChanged: r, imageSupport: i, uploadSoundSupport: a } = this.props;
1791
+ return /* @__PURE__ */ W(_n, {
1792
+ imageSupport: i,
1793
+ uploadSoundSupport: a,
1794
+ title: "Design",
1795
+ model: e,
1796
+ configuration: n,
1797
+ onChange: t,
1798
+ onConfigurationChanged: r
1799
+ });
1800
+ }
1801
+ }, yn = {
1802
+ model: {
1803
+ allowAlternateEnabled: !0,
1804
+ allowMaxChoicesPerCategory: !1,
1805
+ allowMultiplePlacementsEnabled: Q.enabled,
1806
+ alternates: [],
1807
+ categories: [],
1808
+ categoriesPerRow: 2,
1809
+ choices: [],
1810
+ choicesLabel: "",
1811
+ choicesPosition: "below",
1812
+ correctResponse: [],
1813
+ feedbackEnabled: !1,
1814
+ lockChoiceOrder: !0,
1815
+ maxAnswerChoices: 6,
1816
+ maxChoicesPerCategory: 0,
1817
+ partialScoring: !0,
1818
+ promptEnabled: !0,
1819
+ rationaleEnabled: !0,
1820
+ rowLabels: [""],
1821
+ studentInstructionsEnabled: !0,
1822
+ teacherInstructionsEnabled: !0,
1823
+ toolbarEditorPosition: "bottom",
1824
+ minRowHeight: "80px"
1825
+ },
1826
+ configuration: {
1827
+ baseInputConfiguration: {
1828
+ h3: { disabled: !0 },
1829
+ audio: { disabled: !1 },
1830
+ video: { disabled: !1 },
1831
+ image: { disabled: !1 },
1832
+ textAlign: { disabled: !0 },
1833
+ showParagraphs: { disabled: !1 },
1834
+ separateParagraphs: { disabled: !0 }
1835
+ },
1836
+ spellCheck: {
1837
+ label: "Spellcheck",
1838
+ settings: !1,
1839
+ enabled: !0
1840
+ },
1841
+ feedback: {
1842
+ settings: !0,
1843
+ label: "Feedback",
1844
+ enabled: !0
1845
+ },
1846
+ lockChoiceOrder: {
1847
+ settings: !0,
1848
+ label: "Lock Choice Order"
1849
+ },
1850
+ choicesPosition: {
1851
+ settings: !0,
1852
+ label: "Choices Position"
1853
+ },
1854
+ allowMultiplePlacements: {
1855
+ settings: !0,
1856
+ label: "Allow Multiple Placements"
1857
+ },
1858
+ maxPlacements: {
1859
+ settings: !0,
1860
+ label: "Max choices per category"
1861
+ },
1862
+ allowAlternate: {
1863
+ settings: !0,
1864
+ label: "Allow Alternate Correct Answers"
1865
+ },
1866
+ categoriesPerRow: {
1867
+ settings: !0,
1868
+ label: "Categories per row"
1869
+ },
1870
+ partialScoring: {
1871
+ settings: !1,
1872
+ label: "Allow Partial Scoring"
1873
+ },
1874
+ prompt: {
1875
+ settings: !0,
1876
+ label: "Prompt",
1877
+ required: !1,
1878
+ inputConfiguration: {
1879
+ audio: { disabled: !1 },
1880
+ video: { disabled: !1 },
1881
+ image: { disabled: !1 }
1882
+ }
1883
+ },
1884
+ rationale: {
1885
+ settings: !0,
1886
+ label: "Rationale",
1887
+ required: !1,
1888
+ inputConfiguration: {
1889
+ audio: { disabled: !1 },
1890
+ video: { disabled: !1 },
1891
+ image: { disabled: !1 }
1892
+ }
1893
+ },
1894
+ scoringType: {
1895
+ settings: !1,
1896
+ label: "Scoring Type"
1897
+ },
1898
+ settingsPanelDisabled: !1,
1899
+ studentInstructions: {
1900
+ settings: !1,
1901
+ label: "Student Instructions"
1902
+ },
1903
+ teacherInstructions: {
1904
+ settings: !0,
1905
+ label: "Teacher Instructions",
1906
+ required: !1,
1907
+ inputConfiguration: {
1908
+ audio: { disabled: !1 },
1909
+ video: { disabled: !1 },
1910
+ image: { disabled: !1 }
1911
+ }
1912
+ },
1913
+ headers: { inputConfiguration: {
1914
+ audio: { disabled: !0 },
1915
+ video: { disabled: !0 },
1916
+ image: { disabled: !1 }
1917
+ } },
1918
+ rowLabels: { inputConfiguration: {
1919
+ audio: { disabled: !1 },
1920
+ video: { disabled: !1 },
1921
+ image: { disabled: !1 }
1922
+ } },
1923
+ toolbarEditorPosition: {
1924
+ settings: !1,
1925
+ label: "Toolbar Editor Position"
1926
+ },
1927
+ maxImageWidth: {
1928
+ teacherInstructions: 300,
1929
+ prompt: 300,
1930
+ rationale: 300,
1931
+ rowLabel: 200,
1932
+ categoryLabel: 260,
1933
+ choices: 240
1934
+ },
1935
+ maxImageHeight: {
1936
+ teacherInstructions: 300,
1937
+ prompt: 300,
1938
+ rationale: 300,
1939
+ rowLabel: 100,
1940
+ categoryLabel: 100,
1941
+ choices: 150
1942
+ },
1943
+ withRubric: {
1944
+ settings: !1,
1945
+ label: "Add Rubric"
1946
+ },
1947
+ minCategoriesPerRow: 1,
1948
+ allowMaxAnswerChoices: {
1949
+ settings: !0,
1950
+ label: "Max answer choices"
1951
+ },
1952
+ mathMlOptions: {
1953
+ mmlOutput: !1,
1954
+ mmlEditing: !1
1955
+ },
1956
+ language: {
1957
+ settings: !1,
1958
+ label: "Specify Language",
1959
+ enabled: !1
1960
+ },
1961
+ languageChoices: {
1962
+ label: "Language Choices",
1963
+ options: []
1964
+ }
1965
+ }
1966
+ }, bn = class e extends HTMLElement {
1967
+ static createDefaultModel = (e = {}) => ({
1968
+ ...yn.model,
1969
+ ...e
1970
+ });
1971
+ static disableAlternateResponses = (e) => {
1972
+ let { correctResponse: t } = e || {};
1973
+ t ||= [];
1974
+ let n = t.map((e) => {
1975
+ let { alternateResponses: t, ...n } = e;
1976
+ return n;
1977
+ });
1978
+ return {
1979
+ ...e,
1980
+ correctResponse: n,
1981
+ allowAlternateEnabled: !1
1982
+ };
1983
+ };
1984
+ constructor() {
1985
+ super(), this._root = null, this._model = e.createDefaultModel(), this._configuration = yn.configuration;
1986
+ }
1987
+ set model(t) {
1988
+ this._model = e.createDefaultModel(t), t.choices && t.choices.length >= t.maxAnswerChoices && (this._model.maxAnswerChoices = t.choices.length, console.warn("Max Answer Choices can't be less than choices length!")), this.render();
1989
+ }
1990
+ set configuration(e) {
1991
+ let t = {
1992
+ ...yn.configuration,
1993
+ ...e
1994
+ };
1995
+ this._configuration = t, t?.language?.enabled ? t?.languageChoices?.options?.length && (this._model.language = t?.languageChoices.options[0].value) : t.language.settings && this._model.language ? (this._configuration.language.enabled = !0, (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) && (this._configuration.languageChoices.options = []), this._configuration.languageChoices.options.find((e) => e.value === this._model.language) || this._configuration.languageChoices.options.push({
1996
+ value: this._model.language,
1997
+ label: this._model.language
1998
+ })) : delete this._model.language, this.render();
1999
+ }
2000
+ onModelChanged(e) {
2001
+ this._model = e, this.render(), this.dispatchEvent(new J(this._model, !1));
2002
+ }
2003
+ onConfigurationChanged(e) {
2004
+ this._configuration = e, this.render();
2005
+ }
2006
+ connectedCallback() {
2007
+ this.render();
2008
+ }
2009
+ insertImage(e) {
2010
+ this.dispatchEvent(new Y(e));
2011
+ }
2012
+ onDeleteImage(e, t) {
2013
+ this.dispatchEvent(new Ve(e, t));
2014
+ }
2015
+ insertSound(e) {
2016
+ this.dispatchEvent(new X(e));
2017
+ }
2018
+ onDeleteSound(e, t) {
2019
+ this.dispatchEvent(new He(e, t));
2020
+ }
2021
+ render() {
2022
+ let e = H.createElement(vn, {
2023
+ model: this._model,
2024
+ configuration: this._configuration,
2025
+ onModelChanged: this.onModelChanged.bind(this),
2026
+ onConfigurationChanged: this.onConfigurationChanged.bind(this),
2027
+ imageSupport: {
2028
+ add: this.insertImage.bind(this),
2029
+ delete: this.onDeleteImage.bind(this)
2030
+ },
2031
+ uploadSoundSupport: {
2032
+ add: this.insertSound.bind(this),
2033
+ delete: this.onDeleteSound.bind(this)
2034
+ }
2035
+ });
2036
+ this._root ||= U(this), this._root.render(e), setTimeout(() => {
2037
+ L(this);
2038
+ }, 0);
2039
+ }
2040
+ disconnectedCallback() {
2041
+ this._root && this._root.unmount();
2042
+ }
2043
+ };
2044
+ //#endregion
2045
+ export { bn as default };
2046
+
2047
+ //# sourceMappingURL=index.js.map