@pie-element/categorize 13.2.0-beta.0 → 13.2.0-next.9

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 (202) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/defaults.d.ts +222 -0
  4. package/dist/author/defaults.js +168 -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 +427 -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 +50 -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/alert-dialog-BL9K_lnF.js +11511 -0
  42. package/dist/browser/alert-dialog-BL9K_lnF.js.map +1 -0
  43. package/dist/browser/author/index.js +43156 -0
  44. package/dist/browser/author/index.js.map +1 -0
  45. package/dist/browser/categorize.css +2 -0
  46. package/dist/browser/controller/index.js +372 -0
  47. package/dist/browser/controller/index.js.map +1 -0
  48. package/dist/browser/delivery/index.js +1205 -0
  49. package/dist/browser/delivery/index.js.map +1 -0
  50. package/dist/browser/dist-C11U2GIc.js +1871 -0
  51. package/dist/browser/dist-C11U2GIc.js.map +1 -0
  52. package/dist/browser/rolldown-runtime-CWhphoD1.js +32 -0
  53. package/dist/controller/defaults.d.ts +33 -0
  54. package/dist/controller/defaults.js +27 -0
  55. package/dist/controller/index.d.ts +62 -0
  56. package/dist/controller/index.js +168 -0
  57. package/dist/controller/utils.d.ts +20 -0
  58. package/dist/controller/utils.js +35 -0
  59. package/dist/delivery/categorize/__tests__/categories.test.d.ts +1 -0
  60. package/dist/delivery/categorize/__tests__/category.test.d.ts +1 -0
  61. package/dist/delivery/categorize/__tests__/choice.test.d.ts +1 -0
  62. package/dist/delivery/categorize/__tests__/choices.test.d.ts +1 -0
  63. package/dist/delivery/categorize/__tests__/droppable-placeholder.test.d.ts +1 -0
  64. package/dist/delivery/categorize/__tests__/grid-content.test.d.ts +1 -0
  65. package/dist/delivery/categorize/__tests__/index.test.d.ts +1 -0
  66. package/dist/delivery/categorize/__tests__/keyboard-coordinates.test.d.ts +1 -0
  67. package/dist/delivery/categorize/categories.d.ts +37 -0
  68. package/dist/delivery/categorize/categories.js +72 -0
  69. package/dist/delivery/categorize/category.d.ts +31 -0
  70. package/dist/delivery/categorize/category.js +55 -0
  71. package/dist/delivery/categorize/choice.d.ts +28 -0
  72. package/dist/delivery/categorize/choice.js +114 -0
  73. package/dist/delivery/categorize/choices.d.ts +42 -0
  74. package/dist/delivery/categorize/choices.js +58 -0
  75. package/dist/delivery/categorize/droppable-placeholder.d.ts +36 -0
  76. package/dist/delivery/categorize/droppable-placeholder.js +77 -0
  77. package/dist/delivery/categorize/grid-content.d.ts +25 -0
  78. package/dist/delivery/categorize/grid-content.js +39 -0
  79. package/dist/delivery/categorize/index.d.ts +70 -0
  80. package/dist/delivery/categorize/index.js +317 -0
  81. package/dist/delivery/categorize/keyboard-coordinates.d.ts +22 -0
  82. package/dist/delivery/categorize/keyboard-coordinates.js +49 -0
  83. package/dist/delivery/index.d.ts +27 -0
  84. package/dist/delivery/index.js +152 -0
  85. package/dist/index.d.ts +1 -0
  86. package/dist/index.iife.d.ts +8 -0
  87. package/dist/index.iife.js +152 -0
  88. package/dist/index.js +2 -0
  89. package/dist/runtime-support.d.ts +12 -0
  90. package/dist/runtime-support.js +12 -0
  91. package/package.json +97 -22
  92. package/CHANGELOG.json +0 -1637
  93. package/CHANGELOG.md +0 -2551
  94. package/LICENSE.md +0 -5
  95. package/README.md +0 -5
  96. package/configure/CHANGELOG.json +0 -1202
  97. package/configure/CHANGELOG.md +0 -2130
  98. package/configure/lib/__tests__/main.test.js +0 -100
  99. package/configure/lib/__tests__/utils.js +0 -39
  100. package/configure/lib/defaults.js +0 -220
  101. package/configure/lib/defaults.js.map +0 -1
  102. package/configure/lib/design/__tests__/builder.test.js +0 -34
  103. package/configure/lib/design/__tests__/buttons.test.js +0 -36
  104. package/configure/lib/design/__tests__/header.test.js +0 -37
  105. package/configure/lib/design/__tests__/index.test.js +0 -269
  106. package/configure/lib/design/__tests__/input-header.test.js +0 -41
  107. package/configure/lib/design/builder.js +0 -55
  108. package/configure/lib/design/builder.js.map +0 -1
  109. package/configure/lib/design/buttons.js +0 -59
  110. package/configure/lib/design/buttons.js.map +0 -1
  111. package/configure/lib/design/categories/RowLabel.js +0 -66
  112. package/configure/lib/design/categories/RowLabel.js.map +0 -1
  113. package/configure/lib/design/categories/__tests__/alternateResponses.test.js +0 -93
  114. package/configure/lib/design/categories/__tests__/category.test.js +0 -65
  115. package/configure/lib/design/categories/__tests__/choice-preview.test.js +0 -52
  116. package/configure/lib/design/categories/__tests__/droppable-placeholder.test.js +0 -63
  117. package/configure/lib/design/categories/__tests__/index.test.js +0 -91
  118. package/configure/lib/design/categories/alternateResponses.js +0 -116
  119. package/configure/lib/design/categories/alternateResponses.js.map +0 -1
  120. package/configure/lib/design/categories/category.js +0 -153
  121. package/configure/lib/design/categories/category.js.map +0 -1
  122. package/configure/lib/design/categories/choice-preview.js +0 -79
  123. package/configure/lib/design/categories/choice-preview.js.map +0 -1
  124. package/configure/lib/design/categories/droppable-placeholder.js +0 -93
  125. package/configure/lib/design/categories/droppable-placeholder.js.map +0 -1
  126. package/configure/lib/design/categories/index.js +0 -256
  127. package/configure/lib/design/categories/index.js.map +0 -1
  128. package/configure/lib/design/choices/__tests__/choice.test.js +0 -62
  129. package/configure/lib/design/choices/__tests__/config.test.js +0 -66
  130. package/configure/lib/design/choices/__tests__/index.test.js +0 -70
  131. package/configure/lib/design/choices/choice.js +0 -187
  132. package/configure/lib/design/choices/choice.js.map +0 -1
  133. package/configure/lib/design/choices/config.js +0 -58
  134. package/configure/lib/design/choices/config.js.map +0 -1
  135. package/configure/lib/design/choices/index.js +0 -197
  136. package/configure/lib/design/choices/index.js.map +0 -1
  137. package/configure/lib/design/header.js +0 -71
  138. package/configure/lib/design/header.js.map +0 -1
  139. package/configure/lib/design/index.js +0 -741
  140. package/configure/lib/design/index.js.map +0 -1
  141. package/configure/lib/design/input-header.js +0 -105
  142. package/configure/lib/design/input-header.js.map +0 -1
  143. package/configure/lib/design/utils.js +0 -12
  144. package/configure/lib/design/utils.js.map +0 -1
  145. package/configure/lib/index.js +0 -148
  146. package/configure/lib/index.js.map +0 -1
  147. package/configure/lib/main.js +0 -44
  148. package/configure/lib/main.js.map +0 -1
  149. package/configure/lib/utils.js +0 -43
  150. package/configure/lib/utils.js.map +0 -1
  151. package/configure/package.json +0 -32
  152. package/controller/CHANGELOG.json +0 -452
  153. package/controller/CHANGELOG.md +0 -1384
  154. package/controller/lib/__tests__/index.test.js +0 -526
  155. package/controller/lib/defaults.js +0 -31
  156. package/controller/lib/defaults.js.map +0 -1
  157. package/controller/lib/index.js +0 -506
  158. package/controller/lib/index.js.map +0 -1
  159. package/controller/lib/utils.js +0 -69
  160. package/controller/lib/utils.js.map +0 -1
  161. package/controller/package.json +0 -18
  162. package/docs/config-schema.json +0 -2897
  163. package/docs/config-schema.json.md +0 -2138
  164. package/docs/demo/.pie/.configure/package.json +0 -10
  165. package/docs/demo/.pie/.configure/yarn.lock +0 -2122
  166. package/docs/demo/.pie/.controllers/package.json +0 -10
  167. package/docs/demo/.pie/.controllers/yarn.lock +0 -110
  168. package/docs/demo/.pie/info.entry.js +0 -89
  169. package/docs/demo/.pie/info.webpack.config.js +0 -119
  170. package/docs/demo/.pie/package.json +0 -10
  171. package/docs/demo/.pie/yarn.lock +0 -2137
  172. package/docs/demo/config.js +0 -8
  173. package/docs/demo/generate.js +0 -357
  174. package/docs/demo/index.html +0 -1
  175. package/docs/demo/pie.manifest.json +0 -11
  176. package/docs/demo/session.js +0 -12
  177. package/docs/pie-schema.json +0 -1784
  178. package/docs/pie-schema.json.md +0 -1046
  179. package/lib/__tests__/index.test.js +0 -197
  180. package/lib/categorize/__tests__/categories.test.js +0 -138
  181. package/lib/categorize/__tests__/category.test.js +0 -137
  182. package/lib/categorize/__tests__/choice.test.js +0 -88
  183. package/lib/categorize/__tests__/choices.test.js +0 -118
  184. package/lib/categorize/__tests__/droppable-placeholder.test.js +0 -96
  185. package/lib/categorize/__tests__/grid-content.test.js +0 -48
  186. package/lib/categorize/__tests__/index.test.js +0 -250
  187. package/lib/categorize/categories.js +0 -135
  188. package/lib/categorize/categories.js.map +0 -1
  189. package/lib/categorize/category.js +0 -67
  190. package/lib/categorize/category.js.map +0 -1
  191. package/lib/categorize/choice.js +0 -140
  192. package/lib/categorize/choice.js.map +0 -1
  193. package/lib/categorize/choices.js +0 -99
  194. package/lib/categorize/choices.js.map +0 -1
  195. package/lib/categorize/droppable-placeholder.js +0 -84
  196. package/lib/categorize/droppable-placeholder.js.map +0 -1
  197. package/lib/categorize/grid-content.js +0 -55
  198. package/lib/categorize/grid-content.js.map +0 -1
  199. package/lib/categorize/index.js +0 -450
  200. package/lib/categorize/index.js.map +0 -1
  201. package/lib/index.js +0 -316
  202. package/lib/index.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../lib-react/icons/dist/correct-response-icon.js","../../../../../shared/player-events/dist/index.js","../../../../../lib-react/correct-answer-toggle/dist/expander.js","../../../../../lib-react/correct-answer-toggle/dist/index.js","../../../../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/CardContent/cardContentClasses.js","../../../../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/CardContent/CardContent.js","../../../src/delivery/categorize/choice.tsx","../../../src/delivery/categorize/droppable-placeholder.tsx","../../../src/delivery/categorize/choices.tsx","../../../src/delivery/categorize/grid-content.tsx","../../../src/delivery/categorize/category.tsx","../../../src/delivery/categorize/categories.tsx","../../../src/delivery/categorize/keyboard-coordinates.ts","../../../src/delivery/categorize/index.tsx","../../../src/delivery/index.ts"],"sourcesContent":["import \"react\";\nimport e from \"prop-types\";\nimport { jsx as t, jsxs as n } from \"react/jsx-runtime\";\nimport { styled as r } from \"@mui/material/styles\";\n//#region src/correct-response-icon.tsx\nvar i = ({ bgFill: e, fgFill: r }) => /* @__PURE__ */ n(\"svg\", {\n\tpreserveAspectRatio: \"xMinYMin meet\",\n\tversion: \"1.1\",\n\tviewBox: \"-283 359 34 35\",\n\tstyle: { enableBackground: \"new -283 359 34 35\" },\n\tchildren: [\n\t\t/* @__PURE__ */ t(\"circle\", {\n\t\t\tcx: \"-266\",\n\t\t\tcy: \"375.9\",\n\t\t\tr: \"14\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\td: \"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z\\n M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"polygon\", {\n\t\t\tpoints: \"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6\",\n\t\t\tfill: r\n\t\t})\n\t]\n});\ni.propTypes = {\n\tbgFill: e.string.isRequired,\n\tfgFill: e.string.isRequired\n};\nvar a = ({ bgFill: e, fgFill: r, borderFill: i }) => /* @__PURE__ */ n(\"svg\", {\n\tpreserveAspectRatio: \"xMinYMin meet\",\n\tversion: \"1.1\",\n\tviewBox: \"-129.5 127 34 35\",\n\tstyle: { enableBackground: \"new -129.5 127 34 35\" },\n\tchildren: [\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\tstyle: {\n\t\t\t\tfill: \"#D0CAC5\",\n\t\t\t\tstroke: \"#E6E3E0\",\n\t\t\t\tstrokeWidth: .75,\n\t\t\t\tstrokeMiterlimit: 10\n\t\t\t},\n\t\t\td: \"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5\\n C-97.4,153.5-104.3,160.4-112.9,160.4z\"\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\tstyle: {\n\t\t\t\tfill: \"#B3ABA4\",\n\t\t\t\tstroke: \"#CDC7C2\",\n\t\t\t\tstrokeWidth: .5,\n\t\t\t\tstrokeMiterlimit: 10\n\t\t\t},\n\t\t\td: \"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z\"\n\t\t}),\n\t\t/* @__PURE__ */ t(\"circle\", {\n\t\t\tcx: \"-114.2\",\n\t\t\tcy: \"143.5\",\n\t\t\tr: \"14\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\td: \"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z\\n M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z\",\n\t\t\tfill: i\n\t\t}),\n\t\t/* @__PURE__ */ t(\"polygon\", {\n\t\t\tpoints: \"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2\",\n\t\t\tfill: r\n\t\t})\n\t]\n});\na.propTypes = {\n\tbgFill: e.string.isRequired,\n\tfgFill: e.string.isRequired,\n\tborderFill: e.string.isRequired\n};\nvar o = r(\"div\")(({ size: e }) => ({\n\twidth: e || \"25px\",\n\theight: e || \"25px\"\n})), s = ({ open: e, size: n }) => /* @__PURE__ */ t(o, {\n\tsize: n,\n\tchildren: e ? /* @__PURE__ */ t(i, {\n\t\tbgFill: \"#bce2ff\",\n\t\tfgFill: \"#1a9cff\"\n\t}) : /* @__PURE__ */ t(a, {\n\t\tbgFill: \"white\",\n\t\tfgFill: \"#1a9cff\",\n\t\tborderFill: \"#bce2ff\"\n\t})\n});\ns.propTypes = {\n\topen: e.bool,\n\tsize: e.string\n}, s.defaultProps = { open: !1 };\n//#endregion\nexport { s as default };\n","//#region src/index.ts\nvar e = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, t = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { e as ModelSetEvent, t as SessionChangedEvent };\n","import { styled as e } from \"@mui/material/styles\";\nimport { CSSTransition as t } from \"react-transition-group\";\nimport { jsx as n } from \"react/jsx-runtime\";\nimport { useRef as r } from \"react\";\nimport i from \"prop-types\";\n//#region src/expander.tsx\nvar a = \"height ease-in 300ms, opacity ease-in 300ms\", o = e(\"div\")(() => ({\n\tposition: \"relative\",\n\theight: 0,\n\toverflow: \"hidden\",\n\tdisplay: \"flex\",\n\tvisibility: \"hidden\",\n\twidth: 0,\n\t\"&.enter\": {\n\t\ttransition: a,\n\t\topacity: 1,\n\t\theight: \"auto\",\n\t\twidth: \"auto\",\n\t\tvisibility: \"visible\",\n\t\tminHeight: \"25px\"\n\t},\n\t\"&.enter-done\": {\n\t\theight: \"auto\",\n\t\tvisibility: \"visible\",\n\t\twidth: \"auto\",\n\t\tminHeight: \"25px\"\n\t},\n\t\"&.exit\": {\n\t\ttransition: a,\n\t\topacity: 0,\n\t\theight: 0,\n\t\tvisibility: \"visible\",\n\t\twidth: 0\n\t},\n\t\"&.exit-done\": {\n\t\topacity: 0,\n\t\tvisibility: \"hidden\",\n\t\theight: 0,\n\t\twidth: 0\n\t}\n})), s = (e) => {\n\tlet { show: i, children: a, className: s } = e, c = r(null);\n\treturn /* @__PURE__ */ n(t, {\n\t\tnodeRef: c,\n\t\tin: i,\n\t\tappear: !0,\n\t\tmountOnEnter: !1,\n\t\ttimeout: 300,\n\t\tclassNames: {\n\t\t\tenter: \"enter\",\n\t\t\tenterDone: \"enter-done\",\n\t\t\texit: \"exit\",\n\t\t\texitDone: \"exit-done\"\n\t\t},\n\t\tchildren: /* @__PURE__ */ n(o, {\n\t\t\tref: c,\n\t\t\tclassName: s,\n\t\t\tchildren: a\n\t\t})\n\t});\n};\ns.propTypes = {\n\tshow: i.bool.isRequired,\n\tclassName: i.string,\n\tchildren: i.oneOfType([i.arrayOf(i.node), i.node]).isRequired\n};\n//#endregion\nexport { s as default };\n","import e from \"./expander.js\";\nimport { styled as t } from \"@mui/material/styles\";\nimport { CSSTransition as n } from \"react-transition-group\";\nimport { CorrectResponse as r } from \"@pie-lib/icons\";\nimport * as i from \"@pie-lib/render-ui\";\nimport { Readable as a, color as o } from \"@pie-lib/render-ui\";\nimport { jsx as s, jsxs as c } from \"react/jsx-runtime\";\nimport l from \"react\";\nimport u from \"prop-types\";\nimport d from \"@pie-lib/translator\";\n//#region src/index.tsx\nfunction f(e) {\n\treturn typeof e == \"function\" || typeof e == \"object\" && !!e && typeof e.$$typeof == \"symbol\";\n}\nfunction p(e, t) {\n\treturn !e || f(e) ? e : f(e.default) ? e.default : t && f(e[t]) ? e[t] : t && f(e[t]?.default) ? e[t].default : e;\n}\nvar m = p(a, \"Readable\") || p(_.Readable, \"Readable\"), h = i, g = h.default, _ = g && typeof g == \"object\" ? g : h, { translator: v } = d, y = {\n\tWebkitTouchCallout: \"none\",\n\tWebkitUserSelect: \"none\",\n\tKhtmlUserSelect: \"none\",\n\tMozUserSelect: \"none\",\n\tmsUserSelect: \"none\",\n\tuserSelect: \"none\"\n}, b = t(\"div\")(() => ({\n\twidth: \"100%\",\n\tcursor: \"pointer\"\n})), x = t(\"div\")(() => ({\n\tmargin: \"0 auto\",\n\ttextAlign: \"center\",\n\tdisplay: \"flex\"\n})), S = t(\"div\")(() => ({\n\twidth: \"fit-content\",\n\tminWidth: \"140px\",\n\talignSelf: \"center\",\n\tverticalAlign: \"middle\",\n\tcolor: `var(--correct-answer-toggle-label-color, ${o.text()})`,\n\tfontWeight: \"normal\",\n\t...y\n})), C = t(\"div\")(() => ({\n\tposition: \"absolute\",\n\twidth: \"25px\",\n\t\"&.enter\": { opacity: \"0\" },\n\t\"&.enter-active\": {\n\t\topacity: \"1\",\n\t\ttransition: \"opacity 0.3s ease-in\"\n\t},\n\t\"&.exit\": { opacity: \"1\" },\n\t\"&.exit-active\": {\n\t\topacity: \"0\",\n\t\ttransition: \"opacity 0.3s ease-in\"\n\t}\n})), w = t(\"div\")(() => ({\n\twidth: \"25px\",\n\tmarginRight: \"5px\",\n\tdisplay: \"flex\",\n\talignItems: \"center\"\n})), T = class t extends l.Component {\n\tstatic propTypes = {\n\t\tonToggle: u.func,\n\t\ttoggled: u.bool,\n\t\tshow: u.bool,\n\t\thideMessage: u.string,\n\t\tshowMessage: u.string,\n\t\tclassName: u.string,\n\t\tlanguage: u.string\n\t};\n\tstatic defaultProps = {\n\t\tshowMessage: \"Show correct answer\",\n\t\thideMessage: \"Hide correct answer\",\n\t\tshow: !1,\n\t\ttoggled: !1\n\t};\n\tconstructor(e) {\n\t\tsuper(e), this.state = { show: e.show }, this.openIconRef = l.createRef(), this.closedIconRef = l.createRef(), t.defaultProps = {\n\t\t\t...t.defaultProps,\n\t\t\tshowMessage: v.t(\"common:showCorrectAnswer\", { lng: e.language }),\n\t\t\thideMessage: v.t(\"common:hideCorrectAnswer\", { lng: e.language })\n\t\t};\n\t}\n\tonClick() {\n\t\tthis.props.onToggle(!this.props.toggled);\n\t}\n\tonTouch(e) {\n\t\te.preventDefault(), this.props.onToggle(!this.props.toggled);\n\t}\n\tUNSAFE_componentWillReceiveProps(e) {\n\t\tthis.setState({ show: e.show }), e.language !== this.props?.language && (t.defaultProps = {\n\t\t\t...t.defaultProps,\n\t\t\tshowMessage: v.t(\"common:showCorrectAnswer\", { lng: e.language }),\n\t\t\thideMessage: v.t(\"common:hideCorrectAnswer\", { lng: e.language })\n\t\t});\n\t}\n\trender() {\n\t\tlet { className: t, toggled: i, hideMessage: a, showMessage: o } = this.props;\n\t\treturn /* @__PURE__ */ s(b, {\n\t\t\tclassName: t,\n\t\t\tchildren: /* @__PURE__ */ s(e, {\n\t\t\t\tshow: this.state.show,\n\t\t\t\tchildren: /* @__PURE__ */ c(x, {\n\t\t\t\t\tonClick: this.onClick.bind(this),\n\t\t\t\t\tonTouchEnd: this.onTouch.bind(this),\n\t\t\t\t\tchildren: [/* @__PURE__ */ c(w, { children: [/* @__PURE__ */ s(n, {\n\t\t\t\t\t\tnodeRef: this.openIconRef,\n\t\t\t\t\t\ttimeout: 400,\n\t\t\t\t\t\tin: i,\n\t\t\t\t\t\texit: !i,\n\t\t\t\t\t\tclassNames: {\n\t\t\t\t\t\t\tenter: \"enter\",\n\t\t\t\t\t\t\tenterActive: \"enter-active\",\n\t\t\t\t\t\t\texit: \"exit\",\n\t\t\t\t\t\t\texitActive: \"exit-active\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(C, {\n\t\t\t\t\t\t\tref: this.openIconRef,\n\t\t\t\t\t\t\tchildren: /* @__PURE__ */ s(r, { open: i }, \"correct-open\")\n\t\t\t\t\t\t})\n\t\t\t\t\t}), /* @__PURE__ */ s(n, {\n\t\t\t\t\t\tnodeRef: this.closedIconRef,\n\t\t\t\t\t\ttimeout: 5e3,\n\t\t\t\t\t\tin: !i,\n\t\t\t\t\t\texit: i,\n\t\t\t\t\t\tclassNames: {\n\t\t\t\t\t\t\tenter: \"enter\",\n\t\t\t\t\t\t\tenterActive: \"enter-active\",\n\t\t\t\t\t\t\texit: \"exit\",\n\t\t\t\t\t\t\texitActive: \"exit-active\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(C, {\n\t\t\t\t\t\t\tref: this.closedIconRef,\n\t\t\t\t\t\t\tchildren: /* @__PURE__ */ s(r, { open: i }, \"correct-closed\")\n\t\t\t\t\t\t})\n\t\t\t\t\t})] }), /* @__PURE__ */ s(m, {\n\t\t\t\t\t\tfalse: !0,\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(S, {\n\t\t\t\t\t\t\t\"aria-hidden\": !this.state.show,\n\t\t\t\t\t\t\tchildren: i ? a : o\n\t\t\t\t\t\t})\n\t\t\t\t\t})]\n\t\t\t\t})\n\t\t\t})\n\t\t});\n\t}\n};\n//#endregion\nexport { T as CorrectAnswerToggle, T as default };\n","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getCardContentUtilityClass(slot) {\n return generateUtilityClass('MuiCardContent', slot);\n}\nconst cardContentClasses = generateUtilityClasses('MuiCardContent', ['root']);\nexport default cardContentClasses;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { styled } from \"../zero-styled/index.js\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.js\";\nimport { getCardContentUtilityClass } from \"./cardContentClasses.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root']\n };\n return composeClasses(slots, getCardContentUtilityClass, classes);\n};\nconst CardContentRoot = styled('div', {\n name: 'MuiCardContent',\n slot: 'Root'\n})({\n padding: 16,\n '&:last-child': {\n paddingBottom: 24\n }\n});\nconst CardContent = /*#__PURE__*/React.forwardRef(function CardContent(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiCardContent'\n });\n const {\n className,\n component = 'div',\n ...other\n } = props;\n const ownerState = {\n ...props,\n component\n };\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(CardContentRoot, {\n as: component,\n className: clsx(classes.root, className),\n ownerState: ownerState,\n ref: ref,\n ...other\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? CardContent.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default CardContent;","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/categorize/src/categorize/choice.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport { styled } from '@mui/material/styles';\nimport { useDraggable } from '@dnd-kit/core';\nimport { uid } from '@pie-lib/drag';\nimport Card from '@mui/material/Card';\nimport CardContent from '@mui/material/CardContent';\nimport { color } from '@pie-lib/render-ui';\n\nconst log = debug('@pie-ui:categorize:choice');\n\nexport const ChoiceType = {\n content: PropTypes.string.isRequired,\n id: PropTypes.string,\n};\n\nconst ChoiceContainer: any = styled('div', {\n shouldForwardProp: (prop) => !['isDragging', 'disabled', 'correct', 'isSelected'].includes(prop),\n})(({ isDragging, disabled, correct, isSelected }) => ({\n direction: 'initial',\n cursor: disabled ? 'not-allowed' : isDragging ? 'move' : 'pointer',\n width: '100%',\n borderRadius: '6px',\n ...(isSelected && {\n border: `solid 2px ${color.buttonFocusOutline()}`,\n }),\n ...(correct === true && {\n border: `solid 2px ${color.correct()}`,\n }),\n ...(correct === false && {\n border: `solid 2px ${color.incorrect()}`,\n }),\n}));\n\nconst StyledCard: any = styled(Card, {\n shouldForwardProp: (prop) => prop !== 'isSelected',\n})(({ isSelected }) => ({\n color: color.text(),\n backgroundColor: color.background(),\n width: '100%',\n opacity: isSelected ? 0.5 : 1,\n}));\n\nconst StyledCardContent: any = styled(CardContent)(({ theme }) => ({\n color: color.text(),\n backgroundColor: color.white(),\n '&:last-child': {\n paddingBottom: theme.spacing(2),\n },\n borderRadius: '4px',\n border: '1px solid',\n '& p': {\n margin: '0px',\n },\n}));\n\nexport class Layout extends React.Component {\n static propTypes = {\n ...ChoiceType,\n disabled: PropTypes.bool,\n correct: PropTypes.bool,\n isDragging: PropTypes.bool,\n isSelected: PropTypes.bool,\n };\n static defaultProps = {};\n render() {\n const { content, isDragging, disabled, correct, isSelected, showsSelectionBorder } = this.props;\n\n return (\n <ChoiceContainer\n isDragging={isDragging}\n disabled={disabled}\n correct={correct}\n isSelected={isSelected}\n >\n <StyledCard isSelected={isSelected}>\n <StyledCardContent dangerouslySetInnerHTML={{ __html: content }} />\n </StyledCard>\n </ChoiceContainer>\n );\n }\n}\n\nconst DraggableChoice = ({\n id,\n content,\n disabled,\n correct,\n extraStyle,\n categoryId,\n choiceIndex,\n selectedItem,\n onSelectClick,\n}) => {\n // Generate unique draggable ID for each instance\n // If in choices board (categoryId is undefined), use 'board' suffix\n // If in a category, include categoryId and choiceIndex to make it unique\n const draggableId = categoryId !== undefined ? `choice-${id}-${categoryId}-${choiceIndex}` : `choice-${id}-board`;\n\n // Built once and reused for both dnd-kit's own data and the click handler below, so a\n // click carries exactly the same shape dnd-kit's onDragStart/onDragEnd would.\n const dragData = {\n id,\n categoryId,\n choiceIndex,\n value: content,\n itemType: 'categorize',\n type: 'choice',\n };\n\n const { attributes, listeners, setNodeRef, isDragging } = useDraggable({\n id: draggableId,\n data: dragData,\n disabled,\n });\n\n const isSelected =\n !!selectedItem &&\n selectedItem.id === id &&\n selectedItem.categoryId === categoryId &&\n selectedItem.choiceIndex === choiceIndex;\n\n const handleClick = (e) => {\n if (disabled) return;\n\n if (isSelected) {\n // Clicking the already-selected choice again deselects it.\n e.stopPropagation();\n onSelectClick?.(dragData);\n return;\n }\n\n if (selectedItem && categoryId !== undefined) {\n // A different item is selected and this choice sits inside a category. Let the click\n // bubble to the enclosing category droppable, which places the selection into that\n // category — identical to clicking the category's background. Handling it here would\n // duplicate that placement routing.\n return;\n }\n\n // Nothing selected, or this is a pool choice (pool choices are never placement\n // targets): select it for moving.\n e.stopPropagation();\n onSelectClick?.(dragData);\n };\n\n return (\n <div\n ref={setNodeRef}\n style={{ margin: '4px', ...extraStyle }}\n onClick={handleClick}\n {...listeners}\n {...attributes}\n >\n <Layout\n id={id}\n content={content}\n disabled={disabled}\n correct={correct}\n isDragging={isDragging}\n isSelected={isSelected}\n />\n </div>\n );\n};\n\nDraggableChoice.propTypes = {\n ...ChoiceType,\n extraStyle: PropTypes.object,\n categoryId: PropTypes.string,\n choiceIndex: PropTypes.number,\n onRemoveChoice: PropTypes.func,\n selectedItem: PropTypes.object,\n onSelectClick: PropTypes.func,\n};\n\nexport default uid.withUid(DraggableChoice);\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/categorize/src/categorize/droppable-placeholder.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport { useTheme } from '@mui/material/styles';\nimport { useDroppable } from '@dnd-kit/core';\nimport { PlaceHolder } from '@pie-lib/drag';\nimport { color } from '@pie-lib/render-ui';\n\nconst log = debug('@pie-ui:categorize:droppable-placeholder');\n\nconst DroppablePlaceholder = ({\n children,\n grid,\n disabled,\n choiceBoard,\n minRowHeight,\n id,\n correct,\n selectedItem,\n onPlacementClick,\n}) => {\n const theme = useTheme();\n const [isHovered, setIsHovered] = useState(false);\n const { setNodeRef, isOver } = useDroppable({\n id,\n data: {\n itemType: 'categorize',\n categoryId: id,\n },\n disabled,\n });\n\n const hasSelection = !!selectedItem;\n // dnd-kit's own isOver only reflects real collision detection during an active drag, so\n // it stays false while a choice is merely click-selected. Track hovering locally and fold\n // it into the same isOver signal PlaceHolder already consumes, so hovering a drop target\n // while something is selected gets the exact same treatment as hovering it mid-drag —\n // one visual code path, no duplicated styling.\n const showsHoverEffect = isOver || (hasSelection && isHovered && !disabled);\n\n // A category is always a valid drop target (it holds 0..N choices), so it is always a\n // tab stop unless disabled — that's what makes \"select a choice, Tab to a category,\n // press Enter\" work. The choices inside it keep their own dnd-kit tab stops for pick-up.\n const isNativeTabStop = !disabled;\n\n const handleClick = () => {\n if (disabled || !selectedItem) return;\n\n onPlacementClick?.(id);\n };\n\n const handleKeyDown = (e) => {\n // Only react to a keydown that originated directly on this droppable container, not one\n // that bubbled up from a descendant (e.g. a Choice card placed inside a category, or any\n // choice inside the pool). A real dnd-kit keyboard drag never moves DOM focus off the\n // choice being dragged, so Tab-cycling to a different target and pressing Enter to drop\n // still fires the keydown on the original (still-focused) choice node, which bubbles\n // through React's synthetic event system up to this ancestor's onKeyDown before dnd-kit's\n // own document-level listener sees it. Without this guard, that bubbled Enter would be\n // misread as \"place the current selection into ME\" (the choice's own origin container)\n // and would synchronously cancel the real drag via placeSelectedItem's synthetic Escape,\n // short-circuiting the drop before dnd-kit ever processes the keypress.\n if (e.target !== e.currentTarget) return;\n\n if (e.code === 'Space' || e.code === 'Enter') {\n e.preventDefault();\n handleClick();\n }\n };\n\n const extraStyles = {\n padding: theme.spacing(0.5),\n borderRadius: theme.spacing(0.5),\n gridColumnGap: 0,\n gridRowGap: 0,\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'center',\n alignItems: 'center',\n alignContent: 'flex-start',\n width: '100%',\n height: '100%',\n ...(correct === false &&\n !choiceBoard && {\n border: `solid 2px ${color.incorrect()}`,\n }),\n ...(correct === true &&\n !choiceBoard && {\n border: `solid 2px ${color.correct()}`,\n }),\n };\n\n return (\n <div\n ref={setNodeRef}\n role={isNativeTabStop ? 'button' : undefined}\n tabIndex={isNativeTabStop ? 0 : -1}\n onClick={handleClick}\n onKeyDown={isNativeTabStop ? handleKeyDown : undefined}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n style={{\n flex: 1,\n minHeight: minRowHeight || '80px',\n position: 'relative',\n touchAction: 'none',\n // Only a pointer while there is actually something to place here. `cursor` only\n // manifests on hover anyway, so this needs no separate :hover rule.\n ...(hasSelection && !disabled && { cursor: 'pointer' }),\n }}\n >\n <PlaceHolder\n isOver={showsHoverEffect}\n grid={grid}\n disabled={disabled}\n choiceBoard={choiceBoard}\n isCategorize\n extraStyles={extraStyles}\n >\n {children}\n </PlaceHolder>\n </div>\n );\n};\n\nDroppablePlaceholder.propTypes = {\n choiceBoard: PropTypes.bool,\n children: PropTypes.node.isRequired,\n grid: PropTypes.object,\n disabled: PropTypes.bool,\n minRowHeight: PropTypes.string,\n onDropChoice: PropTypes.func,\n id: PropTypes.string.isRequired,\n correct: PropTypes.bool,\n selectedItem: PropTypes.object,\n onPlacementClick: PropTypes.func,\n};\n\nexport default DroppablePlaceholder;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/categorize/src/categorize/choices.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport Choice, { ChoiceType } from './choice.js';\nimport DroppablePlaceholder from './droppable-placeholder.js';\nexport { ChoiceType };\n\nconst Wrapper: any = styled('div')({\n flex: 1,\n touchAction: 'none',\n});\n\nconst LabelHolder: any = styled('div')(({ theme }) => ({\n margin: '0 auto',\n textAlign: 'center',\n paddingTop: theme.spacing(1),\n}));\n\nexport class Choices extends React.Component {\n static propTypes = {\n choices: PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.shape(ChoiceType), PropTypes.shape({ empty: PropTypes.bool })]),\n ),\n model: PropTypes.shape({\n categoriesPerRow: PropTypes.number,\n choicesLabel: PropTypes.string,\n }),\n disabled: PropTypes.bool,\n choicePosition: PropTypes.string,\n onDropChoice: PropTypes.func,\n onRemoveChoice: PropTypes.func,\n correct: PropTypes.boolean,\n selectedItem: PropTypes.object,\n onSelectClick: PropTypes.func,\n onPlacementClick: PropTypes.func,\n };\n\n static defaultProps = {\n model: {\n categoriesPerRow: 1,\n choicesLabel: '',\n },\n };\n\n render() {\n const {\n choices = [],\n model,\n disabled,\n onDropChoice,\n onRemoveChoice,\n choicePosition,\n correct,\n selectedItem,\n onSelectClick,\n onPlacementClick,\n } = this.props;\n\n let style = {\n textAlign: 'center',\n };\n\n if (choicePosition === 'left') {\n style.direction = 'rtl';\n }\n\n return (\n <Wrapper>\n <DroppablePlaceholder\n id=\"choices-board\"\n onDropChoice={onDropChoice}\n onRemoveChoice={onRemoveChoice}\n disabled={disabled}\n style={{ background: 'none' }}\n choiceBoard={true}\n correct={correct}\n selectedItem={selectedItem}\n onPlacementClick={onPlacementClick}\n >\n {model.choicesLabel && model.choicesLabel !== '' && (\n <LabelHolder dangerouslySetInnerHTML={{ __html: model.choicesLabel }} />\n )}\n {choices.map((c, index) => {\n return c.empty ? (\n <div key={index} />\n ) : (\n <Choice\n disabled={disabled}\n key={index}\n extraStyle={{ maxWidth: `${95 / model.categoriesPerRow}%` }}\n selectedItem={selectedItem}\n onSelectClick={onSelectClick}\n {...c}\n />\n );\n })}\n </DroppablePlaceholder>\n </Wrapper>\n );\n }\n}\n\nexport default Choices;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/categorize/src/categorize/grid-content.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\n\nexport class GridContent extends React.Component {\n static propTypes = {\n className: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,\n columns: PropTypes.number,\n rows: PropTypes.number,\n extraStyle: PropTypes.object,\n };\n static defaultProps = {\n columns: 2,\n rows: 2,\n };\n\n render() {\n const { className, children, columns, extraStyle, rows } = this.props;\n const style = {\n gridTemplateColumns: `repeat(${columns}, 1fr)`,\n gridTemplateRows: rows === 2 ? 'auto 1fr' : `repeat(${rows}, auto)`,\n ...extraStyle,\n };\n\n return (\n <StyledDiv style={style} className={className}>\n {children}\n </StyledDiv>\n );\n }\n}\n\nconst StyledDiv: any = styled('div')(({ theme }) => ({\n display: 'grid',\n columnGap: theme.spacing(1),\n gridColumnGap: theme.spacing(1),\n rowGap: theme.spacing(1),\n gridRowGap: theme.spacing(1),\n gridAutoRows: '1fr',\n}));\n\nexport default GridContent;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/categorize/src/categorize/category.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\n\nimport Choice from './choice.js';\nimport PlaceHolder from './droppable-placeholder.js';\n\nexport const CategoryType = {\n id: PropTypes.string.isRequired,\n categoryId: PropTypes.string,\n};\n\nexport class Category extends React.Component {\n static propTypes = {\n ...CategoryType,\n className: PropTypes.string,\n disabled: PropTypes.bool,\n onDropChoice: PropTypes.func,\n onRemoveChoice: PropTypes.func,\n minRowHeight: PropTypes.string,\n selectedItem: PropTypes.object,\n onSelectClick: PropTypes.func,\n onPlacementClick: PropTypes.func,\n };\n\n static defaultProps = {};\n\n render() {\n const {\n className,\n choices = [],\n disabled,\n onDropChoice,\n onRemoveChoice,\n id,\n correct,\n minRowHeight,\n selectedItem,\n onSelectClick,\n onPlacementClick,\n } = this.props;\n\n return (\n <StyledDiv className={className} id={id}>\n <PlaceHolder\n id={id}\n onDropChoice={onDropChoice}\n disabled={disabled}\n correct={correct}\n minRowHeight={minRowHeight}\n selectedItem={selectedItem}\n onPlacementClick={onPlacementClick}\n >\n {choices.map((c, index) => (\n <Choice\n onRemoveChoice={onRemoveChoice}\n disabled={disabled}\n key={index}\n choiceIndex={index}\n categoryId={id}\n selectedItem={selectedItem}\n onSelectClick={onSelectClick}\n {...c}\n />\n ))}\n </PlaceHolder>\n </StyledDiv>\n );\n }\n}\n\nconst StyledDiv: any = styled('div')(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n flex: 2,\n}));\n\nexport default Category;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/categorize/src/categorize/categories.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { color } from '@pie-lib/render-ui';\n\nimport GridContent from './grid-content.js';\nimport Category, { CategoryType } from './category.js';\n\nexport { CategoryType };\n\nexport class Categories extends React.Component {\n static propTypes = {\n categories: PropTypes.arrayOf(PropTypes.shape(CategoryType)),\n model: PropTypes.shape({\n categoriesPerRow: PropTypes.number,\n }),\n disabled: PropTypes.bool,\n onDropChoice: PropTypes.func.isRequired,\n onRemoveChoice: PropTypes.func.isRequired,\n rowLabels: PropTypes.array,\n selectedItem: PropTypes.object,\n onSelectClick: PropTypes.func,\n onPlacementClick: PropTypes.func,\n };\n\n static defaultProps = {\n model: {\n categoriesPerRow: 1,\n },\n };\n\n render() {\n const {\n categories,\n model,\n disabled,\n onDropChoice,\n onRemoveChoice,\n rowLabels,\n selectedItem,\n onSelectClick,\n onPlacementClick,\n } = this.props;\n const { categoriesPerRow, minRowHeight } = model;\n\n // split categories into an array of arrays (inner array),\n // where each inner array represents how many categories should be displayed on one row\n const chunkedCategories = [];\n const cats = categories || [];\n for (let i = 0; i < cats.length; i += categoriesPerRow) {\n chunkedCategories.push(cats.slice(i, i + categoriesPerRow));\n }\n\n const hasNonEmptyString = (array) => {\n let found = false;\n\n (array || []).forEach((element) => {\n if (typeof element === 'string' && element.trim() !== '' && element.trim() !== '<div></div>') {\n found = true;\n }\n });\n\n return found;\n };\n\n return (\n <GridContent\n columns={categoriesPerRow}\n rows={Math.ceil(categories.length / categoriesPerRow) * 2}\n extraStyle={{ flex: 1 }}\n >\n {chunkedCategories.map((cat, rowIndex) => {\n let items = [];\n\n // for each inner array of categories, create a row with category titles\n // first cell of row has to be the row label\n cat.forEach((c, columnIndex) => {\n items.push(\n <div style={{ display: 'flex' }}>\n {columnIndex === 0 && hasNonEmptyString(rowLabels) ? (\n <StyledRowLabel\n key={rowIndex}\n dangerouslySetInnerHTML={{\n __html: rowLabels[rowIndex] || '',\n }}\n />\n ) : null}\n <StyledCategoryWrapper>\n <StyledLabel\n key={`category-label-${rowIndex}-${columnIndex}`}\n dangerouslySetInnerHTML={{ __html: c.label }}\n />\n\n <Category\n minRowHeight={minRowHeight}\n onDropChoice={(h) => onDropChoice(c.id, h)}\n onRemoveChoice={onRemoveChoice}\n disabled={disabled}\n key={`category-element-${rowIndex}-${columnIndex}`}\n selectedItem={selectedItem}\n onSelectClick={onSelectClick}\n onPlacementClick={onPlacementClick}\n {...c}\n />\n </StyledCategoryWrapper>\n </div>,\n );\n });\n\n // if the last row has fewer categories than max on a row, fill the spaces with divs\n items = items.concat(\n Array(categoriesPerRow - cat.length)\n .fill(<div />)\n .map((value, index) => <div key={`fill-space-final-${index}`} />),\n );\n\n return items;\n })}\n </GridContent>\n );\n }\n}\n\nconst StyledLabel: any = styled('div')(({ theme }) => ({\n color: color.text(),\n backgroundColor: color.background(),\n textAlign: 'center',\n paddingTop: theme.spacing(1),\n}));\n\nconst StyledRowLabel: any = styled('div')({\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n flex: 0.5,\n marginRight: '12px',\n});\n\nconst StyledCategoryWrapper: any = styled('div')({\n display: 'flex',\n flex: '2',\n flexDirection: 'column',\n});\n\nexport default Categories;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/categorize/src/categorize/keyboard-coordinates.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { defaultKeyboardCoordinateGetter, KeyboardCode } from '@dnd-kit/core';\n\n// Matches the id `choices.jsx` gives the choice pool's DroppablePlaceholder.\nconst CHOICES_BOARD_ID = 'choices-board';\n\n/**\n * Custom keyboard coordinate getter for categorize's Tab-based placement.\n *\n * Tab/Shift+Tab cycle the dragged choice directly onto the next/previous enabled\n * category, sorted by on-screen position (top-to-bottom, then left-to-right, matching the\n * category grid's reading order), followed by the choices pool as a fixed last stop.\n *\n * Arrow keys are delegated to dnd-kit's own `defaultKeyboardCoordinateGetter`, leaving the\n * existing free-form arrow-key dragging behavior completely unchanged.\n */\nexport const closestDroppableKeyboardCoordinates = (event, { context, currentCoordinates }) => {\n const { code } = event;\n const isTab = code === KeyboardCode.Tab;\n const isArrow =\n code === KeyboardCode.Down || code === KeyboardCode.Up || code === KeyboardCode.Left || code === KeyboardCode.Right;\n\n if (!isTab && !isArrow) {\n return undefined;\n }\n\n if (isArrow) {\n return defaultKeyboardCoordinateGetter(event, { context, currentCoordinates });\n }\n\n event.preventDefault();\n\n const { droppableRects, droppableContainers, collisionRect } = context;\n\n if (!droppableRects || droppableRects.size === 0) {\n return currentCoordinates;\n }\n\n const targets = [];\n let boardTarget;\n\n for (const [id, container] of droppableContainers) {\n if (container?.disabled) continue;\n\n // dnd-kit's own `droppableRects` is a cached snapshot that isn't guaranteed to be\n // populated for every registered droppable yet on the very first keyboard-driven\n // drag of a session (before any DOM-mutating interaction has forced a full\n // remeasure). A container silently missing from that cache here would otherwise\n // drop out of `targets` entirely, corrupting the Tab cycle. Reading the container's\n // live node directly sidesteps that cache entirely.\n const rect = container?.node?.current?.getBoundingClientRect() ?? droppableRects.get(id);\n if (!rect) continue;\n\n const center = {\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n };\n // Land the dragged item's own left edge at the target's left edge (avoids\n // overshooting into a neighboring droppable when the target is much larger than\n // the dragged item), and vertically CENTER the item on the target's own center —\n // not top-align it there. When the dragged item's rendered height differs from the\n // target's, top-aligning the item's edge to the target's center lets it bleed into\n // a neighboring target, and dnd-kit's own area-based collision detection\n // (rectIntersection) can then flag that neighbor as \"over\" even though the item\n // visually landed on the intended target (confirmed live in the equivalent\n // drag-in-the-blank bug this was ported from a fix for).\n const itemHeight = collisionRect?.height ?? 0;\n const dropPosition = {\n x: rect.left,\n y: rect.top + rect.height / 2 - itemHeight / 2,\n };\n\n const target = { id, rect, dropPosition, center };\n\n if (id === CHOICES_BOARD_ID) {\n boardTarget = target;\n } else {\n targets.push(target);\n }\n }\n\n if (targets.length === 0 && !boardTarget) {\n return currentCoordinates;\n }\n\n const reverse = event.shiftKey;\n\n targets.sort((a, b) => {\n if (Math.abs(a.center.y - b.center.y) > 10) return a.center.y - b.center.y;\n return a.center.x - b.center.x;\n });\n\n // The choices pool is an arbitrarily large container whose own center can land anywhere\n // relative to the categories it sits beside — including numerically between two category\n // rows when `choicesPosition` is 'left'/'right'. Sorting it by position the same way as a\n // category would then interleave it into the middle of the cycle, making a single Tab\n // press jump over categories. Anchor it as a fixed stop after every category instead of\n // trusting its own bounds.\n if (boardTarget) {\n targets.push(boardTarget);\n }\n\n // Resolve the current target by containment: whichever target's rect actually contains\n // the dragged item's own center. This is reliable regardless of how the dragged item's\n // size compares to the target's — a small choice card landed at a large category's\n // center-left point is still inside that category's rect, and a choice picked up from\n // inside a category is naturally still within it. Comparing distances between\n // reconstructed centers instead breaks down for exactly that shape.\n const draggedCenter = collisionRect\n ? { x: collisionRect.left + collisionRect.width / 2, y: collisionRect.top + collisionRect.height / 2 }\n : currentCoordinates;\n\n let currentIndex = targets.findIndex(\n (t) =>\n draggedCenter.x >= t.rect.left &&\n draggedCenter.x <= t.rect.right &&\n draggedCenter.y >= t.rect.top &&\n draggedCenter.y <= t.rect.bottom,\n );\n\n // Fall back to nearest-by-dropPosition when the dragged item's center isn't inside any\n // target (e.g. mid-flight after a free arrow-key move).\n if (currentIndex === -1) {\n let minDist = Infinity;\n\n for (let i = 0; i < targets.length; i++) {\n const dist = distance(currentCoordinates, targets[i].dropPosition);\n\n if (dist < minDist) {\n minDist = dist;\n currentIndex = i;\n }\n }\n }\n\n const nextIndex = reverse\n ? (currentIndex - 1 + targets.length) % targets.length\n : (currentIndex + 1) % targets.length;\n\n return targets[nextIndex].dropPosition;\n};\n\nconst distance = (a, b) => Math.sqrt((a.x - b.x) ** 2 + (a.y - b.y) ** 2);\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/categorize/src/categorize/index.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport { styled } from '@mui/material/styles';\nimport { DragOverlay } from '@dnd-kit/core';\nimport CorrectAnswerToggle from '@pie-lib/correct-answer-toggle';\nimport { buildState, removeChoiceFromCategory, moveChoiceToCategory } from '@pie-lib/categorize';\nimport { DragProvider, uid } from '@pie-lib/drag';\nimport { color, Feedback as FeedbackImport, Collapsible as CollapsibleImport, hasText, hasMedia, PreviewPrompt as PreviewPromptImport, UiLayout as UiLayoutImport } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nconst UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');\nconst PreviewPrompt = unwrapReactInteropSymbol(PreviewPromptImport, 'PreviewPrompt') || unwrapReactInteropSymbol(renderUi.PreviewPrompt, 'PreviewPrompt');\nconst Collapsible = unwrapReactInteropSymbol(CollapsibleImport, 'Collapsible') || unwrapReactInteropSymbol(renderUi.Collapsible, 'Collapsible');\nconst Feedback = unwrapReactInteropSymbol(FeedbackImport, 'Feedback') || unwrapReactInteropSymbol(renderUi.Feedback, 'Feedback');\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\nimport Translator from '@pie-lib/translator';\nimport { AlertDialog } from '@pie-lib/config-ui';\nimport Choices from './choices.js';\nimport Choice from './choice.js';\nimport Categories from './categories.js';\nimport { closestDroppableKeyboardCoordinates } from './keyboard-coordinates.js';\n\nconst { translator } = Translator;\nconst log = debug('@pie-ui:categorize');\n\n// Matches the id `choices.jsx` gives the choice pool's DroppablePlaceholder.\nconst CHOICES_BOARD_ID = 'choices-board';\n\n// A click that lands right after a real drag gesture ends (a pointer drag-and-drop, or\n// the browser's own synthetic click following a keyboard Space/Enter drop) must be ignored\n// by the click-to-select/click-to-place handlers below, or it would immediately reopen or\n// re-trigger a selection for a drag that just completed.\nconst CLICK_AFTER_DRAG_GUARD_MS = 250;\n\nclass DragPreviewWrapper extends React.Component {\n static propTypes = {\n children: PropTypes.node,\n };\n\n containerRef = React.createRef();\n\n componentDidMount() {\n if (this.containerRef.current) {\n renderMath(this.containerRef.current);\n }\n }\n\n render() {\n return <div ref={this.containerRef}>{this.props.children}</div>;\n }\n}\n\nexport class Categorize extends React.Component {\n static propTypes = {\n model: PropTypes.object,\n session: PropTypes.shape({\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n choice: PropTypes.string,\n category: PropTypes.string,\n }),\n ),\n }),\n onAnswersChange: PropTypes.func.isRequired,\n onShowCorrectToggle: PropTypes.func.isRequired,\n pauseMathObserver: PropTypes.func,\n resumeMathObserver: PropTypes.func,\n selectedItem: PropTypes.object,\n onSelectClick: PropTypes.func,\n onPlacementClick: PropTypes.func,\n };\n\n static defaultProps = {\n disabled: false,\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n showCorrect: false,\n showMaxChoiceAlert: false,\n };\n }\n\n removeChoice: any = (c) => {\n log('[removeChoice]: ', c);\n const { onAnswersChange, session } = this.props;\n const answers = removeChoiceFromCategory(c.id, c.categoryId, c.choiceIndex, session.answers);\n onAnswersChange(answers);\n };\n\n dropChoice: any = (categoryId, draggedChoice) => {\n const { session, onAnswersChange, model } = this.props;\n const { maxChoicesPerCategory = 0 } = model || {};\n const { answers = [] } = session || {};\n let newAnswers;\n if (draggedChoice) {\n log('[dropChoice] category: ', draggedChoice.categoryId, 'choice: ', draggedChoice);\n } else {\n log('[dropChoice] category: ', undefined, 'choice: ', undefined);\n }\n\n const answer = answers.find((answer) => answer.category === categoryId);\n\n // treat special case to replace the existing choice with the new one when maxChoicesPerCategory = 1\n if (draggedChoice && maxChoicesPerCategory === 1 && answer && answer.choices && answer.choices.length === 1) {\n // First, move the dragged choice to the target category (this will also remove it from source if allowMultiplePlacements is disabled)\n newAnswers = moveChoiceToCategory(\n draggedChoice.id,\n draggedChoice.categoryId,\n categoryId,\n draggedChoice.choiceIndex,\n answers,\n );\n // Then, remove the existing choice from the target category (use newAnswers, not answers)\n newAnswers = removeChoiceFromCategory(answer.choices[0], categoryId, 0, newAnswers);\n }\n\n // treat special case when there are as many choices as maxChoicesPerCategory is\n else if (\n draggedChoice &&\n maxChoicesPerCategory > 1 &&\n answer &&\n answer.choices &&\n answer.choices.length === maxChoicesPerCategory\n ) {\n newAnswers = draggedChoice.categoryId\n ? moveChoiceToCategory(\n draggedChoice.id,\n draggedChoice.categoryId,\n draggedChoice.categoryId,\n draggedChoice.choiceIndex,\n answers,\n )\n : removeChoiceFromCategory(draggedChoice.id, draggedChoice.categoryId, draggedChoice.choiceIndex, answers);\n this.setState({ showMaxChoiceAlert: true });\n }\n\n // treat special case when there are more choices that maxChoicesPerCategory is (testing purpose in pits)\n else if (maxChoicesPerCategory !== 0 && answer && answer.choices && answer.choices.length > maxChoicesPerCategory) {\n newAnswers = answers;\n this.setState({ showMaxChoiceAlert: true });\n } else {\n newAnswers = draggedChoice\n ? moveChoiceToCategory(\n draggedChoice.id,\n draggedChoice.categoryId,\n categoryId,\n draggedChoice.choiceIndex,\n answers,\n )\n : this.removeChoice(categoryId);\n }\n\n if (draggedChoice) {\n onAnswersChange(newAnswers);\n }\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { model } = this.props;\n const { model: nextModel } = nextProps;\n\n // check if the note is the default one for prev language and change to the default one for new language\n // this check is necessary in order to diferanciate between default and authour defined note\n // and only change between languages for default ones\n if (\n model.note &&\n model.language &&\n model.language !== nextModel.language &&\n model.note === translator.t('common:commonCorrectAnswerWithAlternates', { lng: model.language })\n ) {\n model.note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: nextModel.language });\n }\n\n this.setState({ showCorrect: false });\n }\n\n toggleShowCorrect = () =>\n this.setState({ showCorrect: !this.state.showCorrect }, () => {\n this.props.onShowCorrectToggle();\n });\n\n getPositionDirection: any = (choicePosition) => {\n let flexDirection;\n\n switch (choicePosition) {\n case 'left':\n flexDirection = 'row-reverse';\n break;\n case 'right':\n flexDirection = 'row';\n break;\n case 'below':\n flexDirection = 'column';\n break;\n default:\n // above\n flexDirection = 'column-reverse';\n break;\n }\n\n return flexDirection;\n };\n\n existAlternateResponse = (correctResponse) =>\n correctResponse?.some((correctRes) => correctRes.alternateResponses?.length > 0);\n\n render() {\n const { model, session, selectedItem, onSelectClick, onPlacementClick } = this.props;\n const { showCorrect, showMaxChoiceAlert } = this.state;\n const {\n choicesPosition,\n extraCSSRules,\n note,\n showNote,\n env,\n language,\n maxChoicesPerCategory,\n autoplayAudioEnabled,\n customAudioButton,\n } = model;\n const { mode, role } = env || {};\n const choicePosition = choicesPosition || 'above';\n\n const style = {\n flexDirection: this.getPositionDirection(choicePosition),\n gap: '8px',\n };\n\n const { categories, choices, correct } = buildState(\n model.categories,\n model.choices,\n showCorrect ? model.correctResponse : session.answers,\n model.correctResponse,\n );\n\n log('[render] disabled: ', model.disabled);\n\n const { rowLabels, categoriesPerRow, correctResponse, fontSizeFactor } = model;\n const nbOfRows = (categories && Math.ceil(categories.length / categoriesPerRow)) || 0;\n const existAlternate = this.existAlternateResponse(correctResponse) || false;\n const displayNote =\n (showCorrect || (mode === 'view' && role === 'instructor')) && showNote && note && existAlternate;\n const alertMessage = translator.t('translation:categorize:limitMaxChoicesPerCategory', {\n lng: model.language,\n maxChoicesPerCategory,\n });\n\n const alertTitle = translator.t('common:warning', {\n lng: model.language,\n });\n\n const onCloseText = translator.t('common:cancel', {\n lng: model.language,\n });\n\n const showRationale = model.rationale && (hasText(model.rationale) || hasMedia(model.rationale));\n const showTeacherInstructions =\n model.teacherInstructions && (hasText(model.teacherInstructions) || hasMedia(model.teacherInstructions));\n\n return (\n <StyledUiLayout extraCSSRules={extraCSSRules} id={'main-container'} fontSizeFactor={fontSizeFactor}>\n {showTeacherInstructions && (\n <React.Fragment>\n <StyledCollapsible\n labels={{\n hidden: 'Show Teacher Instructions',\n visible: 'Hide Teacher Instructions',\n }}\n >\n <PreviewPrompt prompt={model.teacherInstructions} />\n </StyledCollapsible>\n </React.Fragment>\n )}\n\n {model.prompt && (\n <PreviewPrompt\n prompt={model.prompt}\n autoplayAudioEnabled={autoplayAudioEnabled}\n customAudioButton={customAudioButton}\n />\n )}\n\n <CorrectAnswerToggle\n show={showCorrect || correct === false}\n toggled={showCorrect}\n onToggle={this.toggleShowCorrect}\n language={language}\n />\n\n <StyledCategorize style={style}>\n <div style={{ display: 'flex', flex: 1 }}>\n <Categories\n model={model}\n disabled={model.disabled}\n categories={categories}\n onDropChoice={this.dropChoice}\n onRemoveChoice={this.removeChoice}\n rowLabels={(rowLabels || []).slice(0, nbOfRows)}\n selectedItem={selectedItem}\n onSelectClick={onSelectClick}\n onPlacementClick={onPlacementClick}\n />\n </div>\n <Choices\n disabled={model.disabled}\n model={model}\n choices={choices}\n choicePosition={choicePosition}\n onDropChoice={this.dropChoice}\n onRemoveChoice={this.removeChoice}\n correct={correct}\n selectedItem={selectedItem}\n onSelectClick={onSelectClick}\n onPlacementClick={onPlacementClick}\n />\n </StyledCategorize>\n {displayNote && (\n <StyledNote\n dangerouslySetInnerHTML={{\n __html: note,\n }}\n />\n )}\n\n {showRationale && (\n <StyledCollapsible labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}>\n <PreviewPrompt prompt={model.rationale} />\n </StyledCollapsible>\n )}\n\n {model.correctness && model.feedback && !showCorrect && (\n <Feedback correctness={model.correctness} feedback={model.feedback} />\n )}\n <AlertDialog\n title={alertTitle}\n text={alertMessage}\n open={showMaxChoiceAlert}\n onCloseText={onCloseText}\n onClose={() => this.setState({ showMaxChoiceAlert: false })}\n ></AlertDialog>\n </StyledUiLayout>\n );\n }\n}\n\nclass CategorizeProvider extends React.Component {\n static propTypes = {\n model: PropTypes.object,\n session: PropTypes.shape({\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n choice: PropTypes.string,\n category: PropTypes.string,\n }),\n ),\n }),\n onAnswersChange: PropTypes.func.isRequired,\n onShowCorrectToggle: PropTypes.func.isRequired,\n pauseMathObserver: PropTypes.func,\n resumeMathObserver: PropTypes.func,\n };\n\n constructor(props) {\n super(props);\n this.uid = uid.generateId();\n this.state = {\n activeDragItem: null,\n isValidDrop: false,\n selectedItem: null,\n };\n this.lastDragEndAt = 0;\n this.isInternalDragCancel = false;\n }\n\n onDragStart: any = (event) => {\n const { active } = event;\n const { pauseMathObserver } = this.props;\n\n if (pauseMathObserver) {\n pauseMathObserver();\n }\n\n if (active?.data?.current) {\n this.setState({\n activeDragItem: active.data.current,\n isValidDrop: false,\n selectedItem: active.data.current,\n });\n }\n };\n\n // Shared answer-mutation routing for both the drag-end path and the click-to-place path,\n // so neither reimplements the other's rules. Reproduces the original onDragEnd routing\n // exactly: a `targetId` of undefined (dropped outside any known target) and the choices\n // pool both return the choice to the pool by removing it from its source category;\n // anything else is a category drop, which goes through dropChoice — and therefore\n // inherits all of its maxChoicesPerCategory handling unchanged.\n commitPlacement: any = (choiceData, targetId) => {\n if (!this.categorizeRef) return;\n\n if (targetId === undefined || targetId === CHOICES_BOARD_ID) {\n if (choiceData.categoryId && this.categorizeRef.removeChoice) {\n this.categorizeRef.removeChoice(choiceData);\n }\n return;\n }\n\n if (this.categorizeRef.dropChoice) {\n this.categorizeRef.dropChoice(targetId, choiceData);\n }\n };\n\n onDragEnd: any = (event) => {\n const { active, over } = event;\n const { resumeMathObserver } = this.props;\n\n // Check if drop is valid\n const draggedItem = active?.data?.current;\n const overData = over?.data?.current;\n const isValidDrop =\n over && active && draggedItem && draggedItem.type === 'choice' && overData && overData.itemType === 'categorize';\n\n this.setState({\n activeDragItem: null,\n isValidDrop: isValidDrop,\n selectedItem: null,\n });\n\n if (resumeMathObserver) {\n resumeMathObserver();\n }\n\n this.lastDragEndAt = Date.now();\n\n if (!active || !draggedItem || draggedItem.type !== 'choice') {\n return;\n }\n\n const choiceData = {\n id: draggedItem.id,\n categoryId: draggedItem.categoryId,\n choiceIndex: draggedItem.choiceIndex,\n value: draggedItem.value,\n itemType: draggedItem.itemType,\n };\n\n this.commitPlacement(choiceData, over ? over.id : undefined);\n };\n\n onDragCancel: any = () => {\n const { resumeMathObserver } = this.props;\n\n this.setState({ activeDragItem: null, isValidDrop: false, selectedItem: null });\n\n // onDragStart paused the math observer, so a cancelled drag must resume it too —\n // otherwise Escape leaves the observer paused for good.\n if (resumeMathObserver) {\n resumeMathObserver();\n }\n\n if (this.isInternalDragCancel) {\n // This onDragCancel invocation was fired synchronously as a direct side effect of\n // endAnyLiveKeyboardDrag's own synthetic Escape dispatch below, not by a real user-driven\n // drag cancellation. No browser-generated synthetic click follows this internal cleanup\n // the way one follows a genuine Space/Enter drop or mouse drag-end, so there is nothing\n // for the post-drag click guard to protect against here — skip arming it.\n this.isInternalDragCancel = false;\n } else {\n this.lastDragEndAt = Date.now();\n }\n };\n\n isSameItem = (a, b) =>\n !!a && !!b && a.id === b.id && a.categoryId === b.categoryId && a.choiceIndex === b.choiceIndex;\n\n // Click-to-select semantics: selecting the currently-selected choice again clears the\n // selection instead of re-selecting it.\n toggleItemSelection: any = (data) => {\n this.setState((state) => ({\n selectedItem: this.isSameItem(state.selectedItem, data) ? null : data,\n }));\n };\n\n cancelSelection: any = () => {\n this.setState({ selectedItem: null });\n };\n\n // If a real dnd-kit drag (started via keyboard Space/Enter) is still live when a click\n // completes the placement below, it needs to be cleanly ended — otherwise dnd-kit still\n // thinks a drag is in progress. Escape is configured as this sensor's cancel key (see the\n // keyboardCodes passed to DragProvider below), and dispatching it as a real DOM\n // KeyboardEvent is how dnd-kit's own document-level listener is reached from outside its\n // sensor.\n //\n // Only dispatch when a drag is actually live — this is a synthetic Escape keydown on\n // `document`, so an unconditional dispatch would also be observed by any other\n // document-level Escape listener (host player modals, another mounted instance of this\n // same component) even when nothing here needed cancelling.\n endAnyLiveKeyboardDrag: any = () => {\n if (!this.state.activeDragItem) return;\n\n // The dispatch below synchronously invokes onDragCancel as a direct side effect (dnd-kit's\n // KeyboardSensor handles Escape synchronously). Mark this specific cancellation as internal\n // cleanup — not a real user-driven drag end — so onDragCancel skips arming the post-drag\n // click guard: no browser-generated synthetic click follows this dispatch the way one\n // follows a genuine Space/Enter drop or mouse drag-end, so there is nothing to guard against.\n this.isInternalDragCancel = true;\n document.dispatchEvent(new KeyboardEvent('keydown', { code: 'Escape', bubbles: true, cancelable: true }));\n // dnd-kit handles Escape synchronously, so onDragCancel (which resets this flag) has\n // already run by this point under normal operation — this reset is defensive, in case\n // that assumption ever stops holding, so a stuck flag can't suppress a later genuine cancel.\n this.isInternalDragCancel = false;\n };\n\n placeSelectedItem: any = (targetId) => {\n const { selectedItem } = this.state;\n\n if (!selectedItem) return;\n\n this.commitPlacement(selectedItem, targetId);\n this.cancelSelection();\n this.endAnyLiveKeyboardDrag();\n };\n\n isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt < CLICK_AFTER_DRAG_GUARD_MS;\n\n onItemClick: any = (data) => {\n if (this.isClickSoonAfterDragEnd()) return;\n\n // End any still-live keyboard drag BEFORE toggling the new selection: ending it also\n // clears the current selection as a side effect (see onDragCancel above), so doing it\n // first lets this click's own selection be the one that sticks.\n this.endAnyLiveKeyboardDrag();\n this.toggleItemSelection(data);\n };\n\n onPlacementClick: any = (targetId) => {\n if (this.isClickSoonAfterDragEnd()) return;\n\n this.placeSelectedItem(targetId);\n };\n\n renderDragOverlay: any = () => {\n const { activeDragItem } = this.state;\n const { model } = this.props;\n\n if (!activeDragItem) return null;\n\n if (activeDragItem.type === 'choice') {\n const choice = model.choices?.find((c) => c.id === activeDragItem.id);\n if (choice) {\n return <Choice key={choice.id} id={choice.id} {...choice} />;\n }\n }\n\n return null;\n };\n\n render() {\n const { isValidDrop, selectedItem } = this.state;\n // Disable drop animation for valid drops to prevent visual snap-back\n // Keep default animation for invalid drops to show visual feedback\n const dropAnimation = isValidDrop ? null : undefined;\n\n return (\n <DragProvider\n onDragStart={this.onDragStart}\n onDragEnd={this.onDragEnd}\n onDragCancel={this.onDragCancel}\n keyboardCoordinateGetter={closestDroppableKeyboardCoordinates}\n keyboardCodes={{ start: ['Space', 'Enter'], cancel: ['Escape'], end: ['Space', 'Enter'] }}\n >\n <uid.Provider value={this.uid}>\n <Categorize\n ref={(ref) => (this.categorizeRef = ref)}\n {...this.props}\n selectedItem={selectedItem}\n onSelectClick={this.onItemClick}\n onPlacementClick={this.onPlacementClick}\n />\n <DragOverlay dropAnimation={dropAnimation}>\n <DragPreviewWrapper>{this.renderDragOverlay()}</DragPreviewWrapper>\n </DragOverlay>\n </uid.Provider>\n </DragProvider>\n );\n }\n}\n\nconst StyledUiLayout: any = styled(UiLayout)({\n color: color.text(),\n backgroundColor: color.background(),\n position: 'relative',\n});\n\nconst StyledNote: any = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(2),\n}));\n\nconst StyledCategorize: any = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(1),\n display: 'flex',\n flexDirection: 'column',\n}));\n\nconst StyledCollapsible: any = styled(Collapsible)(({ theme }) => ({\n paddingBottom: theme.spacing(2),\n}));\n\nexport default CategorizeProvider;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/categorize/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\nimport { EnableAudioAutoplayImage as EnableAudioAutoplayImageImport } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nconst EnableAudioAutoplayImage = unwrapReactInteropSymbol(EnableAudioAutoplayImageImport, 'EnableAudioAutoplayImage') || unwrapReactInteropSymbol(renderUi.EnableAudioAutoplayImage, 'EnableAudioAutoplayImage');\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nimport { SessionChangedEvent, ModelSetEvent } from '@pie-element/shared-player-events';\nimport CategorizeComponent from './categorize/index.js';\n\nexport default class Categorize extends HTMLElement {\n constructor() {\n super();\n this._root = null;\n this._mathObserver = null;\n this._mathRenderPending = false;\n }\n\n _scheduleMathRender: any = () => {\n if (this._mathRenderPending) return;\n\n this._mathRenderPending = true;\n\n requestAnimationFrame(() => {\n if (this._mathObserver && !this._mathObserverPaused) {\n this._mathObserver.disconnect();\n }\n\n renderMath(this);\n\n this._mathRenderPending = false;\n\n setTimeout(() => {\n if (this._mathObserver && !this._mathObserverPaused) {\n this._mathObserver.observe(this, {\n childList: true,\n subtree: true,\n characterData: false,\n });\n }\n }, 50);\n });\n };\n\n _initMathObserver() {\n if (this._mathObserver) return;\n\n this._mathObserver = new MutationObserver(() => {\n this._scheduleMathRender();\n });\n\n this._mathObserver.observe(this, {\n childList: true,\n subtree: true,\n characterData: false,\n });\n }\n\n _disconnectMathObserver() {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n this._mathObserver = null;\n }\n }\n\n pauseMathObserver: any = () => {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n this._mathObserverPaused = true;\n }\n };\n\n resumeMathObserver: any = () => {\n if (this._mathObserverPaused) {\n this._mathObserverPaused = false;\n\n if (this._mathObserver) {\n this._mathObserver.observe(this, {\n childList: true,\n subtree: true,\n characterData: false,\n });\n }\n }\n };\n\n set model(m) {\n this._model = m;\n\n this.eliminateBlindAnswersFromSession();\n this.dispatchEvent(new ModelSetEvent(this.tagName.toLowerCase(), this.isComplete(), !!this._model));\n // reset the audioInitialized to false since the model changed, and we might need to reinitialize the audio\n this._audioInitialized = false;\n\n this.render();\n }\n\n isComplete() {\n const {\n autoplayAudioEnabled,\n choices,\n completeAudioEnabled,\n hasUnplacedChoices,\n possibleResponses,\n responseAreasToBeFilled,\n } = this._model || {};\n const elementContext = this;\n\n // check audio completion if audio settings are enabled and audio actually exists\n if (autoplayAudioEnabled && completeAudioEnabled && !this.audioComplete) {\n if (elementContext) {\n const audio = elementContext.querySelector('audio');\n const isInsidePrompt = audio && audio.closest('.preview-prompt');\n\n // only require audio completion if audio exists and is inside the prompt\n if (audio && isInsidePrompt) {\n return false;\n }\n }\n }\n\n if (!this._session || !this._session.answers) {\n return false;\n }\n\n const { answers } = this._session;\n\n if (!Array.isArray(answers)) {\n return false;\n }\n\n // filter answers by category and count the ones with content\n const filledResponseAreas = answers.filter((answer) => answer.choices.length).length;\n // check if an answer choice was added to at least as many response areas\n // as the number of populated response areas in the correct answer\n const areResponseAreasFilled = filledResponseAreas >= responseAreasToBeFilled;\n // check if multiple placements are allowed\n const duplicatesAllowed = (choices || []).some((choice) => choice.categoryCount === 0);\n\n if (duplicatesAllowed) {\n // an answer choice can be used multiple times\n return areResponseAreasFilled;\n }\n\n // any correct answer have any unplaced answer choices (by the author)\n if (hasUnplacedChoices) {\n return areResponseAreasFilled;\n }\n\n const allAnswersIds = answers.map((answer) => answer.choices).flat();\n\n // check if any correct answer have any unplaced answer choices (by the student)\n const requiredAnswersPlaced = (possibleResponses || []).some((response) =>\n response.every((val) => allAnswersIds.includes(val)),\n );\n\n // true - all choices (required for a correct response) were placed into a response area\n return requiredAnswersPlaced;\n }\n\n set session(s) {\n if (s && !s.answers) {\n s.answers = [];\n }\n\n this._session = s;\n this.render();\n }\n\n get session() {\n return this._session;\n }\n\n eliminateBlindAnswersFromSession() {\n const { answers = [] } = this._session || {};\n const { choices = [] } = this._model || {};\n\n const mappedChoices = choices.map((c) => c.id) || [];\n const filteredAnswers = answers.map((answer) => {\n const answerChoices = answer?.choices || [];\n answer.choices = answerChoices.filter((c) => mappedChoices.includes(c));\n\n return answer;\n });\n\n if (filteredAnswers.length > 0) {\n this.changeAnswers(filteredAnswers);\n }\n }\n\n changeAnswers(answers) {\n this._session.answers = answers;\n this._session.selector = 'Mouse';\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete()));\n\n this.render();\n }\n\n onShowCorrectToggle() {\n renderMath(this);\n }\n\n _createAudioInfoToast() {\n const info = document.createElement('div');\n info.id = 'play-audio-info';\n\n Object.assign(info.style, {\n position: 'absolute',\n top: 0,\n width: '100%',\n height: '100%',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n background: 'white',\n zIndex: '1000',\n cursor: 'pointer',\n });\n\n const img = document.createElement('img');\n img.src = EnableAudioAutoplayImage;\n img.alt = 'Click anywhere to enable audio autoplay';\n img.width = 500;\n img.height = 300;\n\n info.appendChild(img);\n return info;\n }\n\n connectedCallback() {\n this._initMathObserver();\n \n // Observation: audio in Chrome will have the autoplay attribute,\n // while other browsers will not have the autoplay attribute and will need a user interaction to play the audio\n // This workaround fixes the issue of audio being cached and played on any user interaction in Safari and Firefox\n const observer = new MutationObserver((mutationsList, observer) => {\n mutationsList.forEach((mutation) => {\n if (mutation.type === 'childList') {\n if (this._audioInitialized) return;\n const audio = this.querySelector('audio');\n const isInsidePrompt = audio && audio.closest('.preview-prompt');\n\n if (!this._model) return;\n if (!this._model.autoplayAudioEnabled) return;\n if (audio && !isInsidePrompt) return;\n if (!audio) return;\n\n const info = this._createAudioInfoToast();\n const container = this.querySelector('#main-container');\n const enableAudio = () => {\n if (this.querySelector('#play-audio-info')) {\n audio.play();\n container.removeChild(info);\n }\n\n document.removeEventListener('click', enableAudio);\n };\n\n // if the audio is paused, it means the user has not interacted with the page yet and the audio will not play\n // FIX FOR SAFARI: play with a slight delay to check if autoplay was blocked\n setTimeout(() => {\n if (audio.paused && !this.querySelector('#play-audio-info')) {\n // add info message as a toast to enable audio playback\n container.appendChild(info);\n document.addEventListener('click', enableAudio);\n } else {\n document.removeEventListener('click', enableAudio);\n }\n }, 500);\n\n // we need to listen for the playing event to remove the toast in case the audio plays because of re-rendering\n const handlePlaying = () => {\n //timestamp when auto-played audio started playing\n this._session.audioStartTime = this._session.audioStartTime || new Date().getTime();\n\n const info = this.querySelector('#play-audio-info');\n if (info) {\n container.removeChild(info);\n }\n\n audio.removeEventListener('playing', handlePlaying);\n };\n\n audio.addEventListener('playing', handlePlaying);\n\n // we need to listen for the ended event to update the isComplete state\n const handleEnded = () => {\n //timestamp when auto-played audio completed playing\n this._session.audioEndTime = this._session.audioEndTime || new Date().getTime();\n\n let { audioStartTime, audioEndTime, waitTime } = this._session;\n if (!waitTime && audioStartTime && audioEndTime) {\n // waitTime is elapsed time the user waited for auto-played audio to finish\n this._session.waitTime = audioEndTime - audioStartTime;\n }\n\n this.audioComplete = true;\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete()));\n\n audio.removeEventListener('ended', handleEnded);\n };\n\n audio.addEventListener('ended', handleEnded);\n\n // store references to remove later\n this._audio = audio;\n this._handlePlaying = handlePlaying;\n this._handleEnded = handleEnded;\n this._enableAudio = enableAudio;\n // set to true to prevent multiple initializations\n this._audioInitialized = true;\n\n observer.disconnect();\n }\n });\n });\n\n observer.observe(this, { childList: true, subtree: true });\n }\n\n disconnectedCallback() {\n this._disconnectMathObserver();\n \n document.removeEventListener('click', this._enableAudio);\n\n if (this._audio) {\n this._audio.removeEventListener('playing', this._handlePlaying);\n this._audio.removeEventListener('ended', this._handleEnded);\n this._audio = null;\n }\n\n if (this._root) {\n this._root.unmount();\n }\n }\n\n render() {\n if (this._model && this._session) {\n const el = React.createElement(CategorizeComponent, {\n model: this._model,\n session: this._session,\n onAnswersChange: this.changeAnswers.bind(this),\n onShowCorrectToggle: this.onShowCorrectToggle.bind(this),\n pauseMathObserver: this.pauseMathObserver,\n resumeMathObserver: this.resumeMathObserver,\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(el);\n }\n }\n}\n"],"x_google_ignoreList":[4,5],"mappings":";;;;;;;;oCAKI,MAAK,EAAE,QAAQ,GAAG,QAAQ,QAAwB,kBAAE,OAAO;CAC9D,qBAAqB;CACrB,SAAS;CACT,SAAS;CACT,OAAO,EAAE,kBAAkB,qBAAqB;CAChD,UAAU;EACO,kBAAE,UAAU;GAC3B,IAAI;GACJ,IAAI;GACJ,GAAG;GACH,MAAM;EACP,CAAC;EACe,kBAAE,QAAQ;GACzB,GAAG;GACH,MAAM;EACP,CAAC;EACe,kBAAE,WAAW;GAC5B,QAAQ;GACR,MAAM;EACP,CAAC;CACF;AACD,CAAC;AACD,GAAE,YAAY;CACb,QAAQ,EAAA,QAAE,OAAO;CACjB,QAAQ,EAAA,QAAE,OAAO;AAClB;AACA,IAAI,MAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,YAAY,QAAwB,kBAAE,OAAO;CAC7E,qBAAqB;CACrB,SAAS;CACT,SAAS;CACT,OAAO,EAAE,kBAAkB,uBAAuB;CAClD,UAAU;EACO,kBAAE,QAAQ;GACzB,OAAO;IACN,MAAM;IACN,QAAQ;IACR,aAAa;IACb,kBAAkB;GACnB;GACA,GAAG;EACJ,CAAC;EACe,kBAAE,QAAQ;GACzB,OAAO;IACN,MAAM;IACN,QAAQ;IACR,aAAa;IACb,kBAAkB;GACnB;GACA,GAAG;EACJ,CAAC;EACe,kBAAE,UAAU;GAC3B,IAAI;GACJ,IAAI;GACJ,GAAG;GACH,MAAM;EACP,CAAC;EACe,kBAAE,QAAQ;GACzB,GAAG;GACH,MAAM;EACP,CAAC;EACe,kBAAE,WAAW;GAC5B,QAAQ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