@pie-element/drag-in-the-blank 9.0.0-beta.0 → 9.0.0-next.42

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.
package/CHANGELOG.md CHANGED
@@ -3,17 +3,6 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [8.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank@8.3.2...@pie-element/drag-in-the-blank@8.3.3) (2025-11-27)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * bump libs PD-5274, PD-5211, PD-5248 ([7610b25](https://github.com/pie-framework/pie-elements/commit/7610b25423956b6492f33322513b3430051fca77))
12
-
13
-
14
-
15
-
16
-
17
6
  ## [8.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank@8.3.1...@pie-element/drag-in-the-blank@8.3.2) (2025-10-22)
18
7
 
19
8
 
@@ -3,17 +3,6 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [7.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-configure@7.3.2...@pie-element/drag-in-the-blank-configure@7.3.3) (2025-11-27)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * bump libs PD-5274, PD-5211, PD-5248 ([7610b25](https://github.com/pie-framework/pie-elements/commit/7610b25423956b6492f33322513b3430051fca77))
12
-
13
-
14
-
15
-
16
-
17
6
  ## [7.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-configure@7.3.1...@pie-element/drag-in-the-blank-configure@7.3.2) (2025-10-22)
18
7
 
19
8
 
@@ -8,7 +8,7 @@ exports.default = exports.Choices = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
- var _editableHtml = _interopRequireDefault(require("@pie-lib/editable-html"));
11
+ var _editableHtmlTipTap = _interopRequireDefault(require("@pie-lib/editable-html-tip-tap"));
12
12
  var _configUi = require("@pie-lib/config-ui");
13
13
  var _Button = _interopRequireDefault(require("@mui/material/Button"));
14
14
  var _styles = require("@mui/material/styles");
@@ -218,7 +218,7 @@ class Choices extends _react.default.Component {
218
218
  minWidth: '100%',
219
219
  zIndex: '100'
220
220
  }
221
- }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
221
+ }, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
222
222
  ref: ref => this.focusedNodeRef = ref,
223
223
  imageSupport: imageSupport,
224
224
  markup: choice.value,
@@ -1 +1 @@
1
- {"version":3,"file":"choices.js","names":["_react","_interopRequireDefault","require","_propTypes","_editableHtml","_configUi","_Button","_styles","_choice","_markupUtils","StyledDesign","styled","theme","display","flexDirection","marginBottom","spacing","StyledAddButton","Button","marginLeft","StyledAltChoices","alignItems","flexWrap","justifyContent","marginTop","margin","ErrorText","fontSize","typography","color","palette","error","main","paddingBottom","Choices","React","Component","constructor","args","_defineProperty2","default","warning","open","prevValue","val","key","onChange","model","props","choices","correctResponse","alternateResponses","duplicatedValue","find","c","value","id","newChoices","filter","setState","text","map","choice","choiceIsEmpty","usedForResponse","Object","keys","forEach","responseKey","values","alternate","indexOf","newChoicesWithoutTheEmptyOne","focusedEl","oldChoices","maxId","length","Math","max","parseInt","newId","duplicates","includes","componentDidUpdate","focusedNodeRef","focus","render","state","mathMlOptions","maxChoices","toolbarOpts","uploadSoundSupport","imageSupport","pluginProps","maxImageWidth","maxImageHeight","maxLength","visibleChoices","getVisibleChoices","createElement","variant","onClick","onAddChoice","disabled","index","style","minWidth","zIndex","ref","markup","languageCharactersProps","language","preventDone","onChoiceChanged","onDone","undefined","onBlur","e","inInInsertCharacter","relatedTarget","closest","disableUnderline","charactersLimit","onChoiceFocus","onRemoveChoice","onChoiceRemove","AlertDialog","title","onConfirm","exports","PropTypes","bool","string","object","isRequired","func","number","_default"],"sources":["../src/choices.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport EditableHtml from '@pie-lib/editable-html';\nimport { AlertDialog } from '@pie-lib/config-ui';\nimport Button from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\n\nimport Choice from './choice';\nimport { choiceIsEmpty } from './markupUtils';\n\nconst StyledDesign = styled('div')(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n marginBottom: theme.spacing(1.5),\n}));\n\nconst StyledAddButton = styled(Button)({\n marginLeft: 'auto',\n});\n\nconst StyledAltChoices = styled('div')(({ theme }) => ({\n alignItems: 'flex-start',\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'space-evenly',\n marginTop: theme.spacing(1),\n\n '& > *': {\n margin: theme.spacing(1),\n },\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingBottom: theme.spacing(2),\n}));\n\nexport class Choices extends React.Component {\n static propTypes = {\n duplicates: PropTypes.bool,\n error: PropTypes.string,\n model: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n toolbarOpts: PropTypes.object,\n pluginProps: PropTypes.object,\n maxChoices: PropTypes.number,\n uploadSoundSupport: PropTypes.object,\n maxImageWidth: PropTypes.number,\n maxImageHeight: PropTypes.number,\n maxLength: PropTypes.number,\n };\n\n state = { warning: { open: false } };\n preventDone = false;\n\n componentDidUpdate() {\n if (this.focusedNodeRef) {\n this.focusedNodeRef.focus('end');\n }\n }\n\n onChoiceChanged = (prevValue, val, key) => {\n const { onChange, model } = this.props;\n const { choices, correctResponse, alternateResponses } = model;\n const duplicatedValue = (choices || []).find((c) => c.value === val && c.id !== key);\n\n // discard the new added choice or the changes if the choice would be a duplicate to one that already exists\n if (duplicatedValue) {\n if (prevValue === '') {\n // remove the new added choice from choices\n const newChoices = (choices || []).filter((c) => c.id !== key);\n\n onChange(newChoices);\n }\n\n this.setState({\n warning: {\n open: true,\n text: 'Identical answer choices are not allowed and the changes will be discarded.',\n },\n });\n\n return;\n }\n\n const newChoices = choices?.map((choice) => (choice.id === key ? { ...choice, value: val } : choice)) || [];\n\n if (!choiceIsEmpty({ value: val })) {\n onChange(newChoices);\n\n return;\n }\n\n // if the edited content is empty, its usage has to be searched in the correct response definitions\n let usedForResponse = false;\n\n if (correctResponse) {\n Object.keys(correctResponse).forEach((responseKey) => {\n if (correctResponse[responseKey] === key) {\n usedForResponse = true;\n }\n });\n }\n\n if (alternateResponses && !usedForResponse) {\n Object.values(alternateResponses).forEach((alternate) => {\n if (alternate.indexOf(key) >= 0) {\n usedForResponse = true;\n }\n });\n }\n\n if (usedForResponse) {\n this.setState({\n warning: {\n open: true,\n text: 'Answer choices cannot be blank and the changes will be discarded.',\n },\n });\n\n return;\n }\n\n const newChoicesWithoutTheEmptyOne = newChoices.filter((choice) => choice.id !== key);\n\n onChange(newChoicesWithoutTheEmptyOne);\n\n this.setState({\n warning: {\n open: true,\n text: 'Answer choices cannot be blank.',\n },\n });\n };\n\n onChoiceFocus = (id) =>\n this.setState({\n focusedEl: id,\n });\n\n onAddChoice = () => {\n const {\n model: { choices: oldChoices },\n onChange,\n } = this.props;\n\n // find the maximum existing id and add 1 to generate the new id so we avoid duplicates\n const maxId = oldChoices.length > 0\n ? Math.max(...oldChoices.map(choice => parseInt(choice.id, 10) || 0))\n : -1;\n const newId = `${maxId + 1}`;\n\n this.setState(\n {\n focusedEl: newId,\n },\n () => {\n onChange([\n ...oldChoices,\n {\n id: newId,\n value: '',\n },\n ]);\n },\n );\n };\n\n onChoiceRemove = (id) => {\n const {\n onChange,\n model: { choices },\n } = this.props;\n const newChoices = (choices || []).filter((choice) => choice.id !== id);\n\n onChange(newChoices);\n };\n\n getVisibleChoices = () => {\n const {\n duplicates,\n model: { choices, correctResponse },\n } = this.props;\n\n if (!choices) {\n return [];\n }\n\n if (duplicates) {\n return choices;\n }\n\n // if duplicates not allowed, remove the choices that are used to define the correct response\n return choices.filter((choice) => !(correctResponse && Object.values(correctResponse).includes(choice.id)));\n };\n\n render() {\n const { focusedEl, warning } = this.state;\n const {\n duplicates,\n error,\n mathMlOptions = {},\n maxChoices,\n model: { choices },\n toolbarOpts,\n uploadSoundSupport,\n imageSupport = {},\n pluginProps = {},\n maxImageWidth,\n maxImageHeight,\n maxLength,\n } = this.props;\n const visibleChoices = this.getVisibleChoices() || [];\n return (\n <StyledDesign>\n <StyledAddButton\n variant=\"contained\"\n color=\"primary\"\n onClick={this.onAddChoice}\n disabled={maxChoices && choices && maxChoices === choices.length}\n >\n Add Choice\n </StyledAddButton>\n\n <StyledAltChoices>\n {visibleChoices.map((choice, index) => {\n if (!choice || !choice.id) {\n return null;\n }\n\n return focusedEl === choice.id ? (\n <div\n key={index}\n style={{\n minWidth: '100%',\n zIndex: '100',\n }}\n >\n <EditableHtml\n ref={(ref) => (this.focusedNodeRef = ref)}\n imageSupport={imageSupport}\n markup={choice.value}\n pluginProps={pluginProps}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n onChange={(val) => {\n if (this.preventDone) {\n return;\n }\n\n this.onChoiceChanged(choice.value, val, choice.id);\n }}\n onDone={() => {\n if (this.preventDone) {\n return;\n }\n\n this.setState({\n focusedEl: undefined,\n });\n }}\n onBlur={(e) => {\n const inInInsertCharacter = e.relatedTarget && e.relatedTarget.closest('.insert-character-dialog');\n\n this.preventDone = inInInsertCharacter;\n }}\n disableUnderline\n toolbarOpts={toolbarOpts}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n maxImageHeight={maxImageHeight}\n maxImageWidth={maxImageWidth}\n charactersLimit={maxLength}\n />\n </div>\n ) : (\n <Choice\n key={index}\n duplicates={duplicates}\n choice={choice}\n error={error}\n onClick={() => this.onChoiceFocus(choice.id)}\n onRemoveChoice={() => this.onChoiceRemove(choice.id)}\n />\n );\n })}\n </StyledAltChoices>\n {error && <ErrorText>{error}</ErrorText>}\n\n <AlertDialog\n open={warning.open}\n title=\"Warning\"\n text={warning.text}\n onConfirm={() => this.setState({ warning: { open: false } })}\n />\n </StyledDesign>\n );\n }\n}\n\nexport default Choices;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,aAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAEA,MAAMQ,YAAY,GAAG,IAAAC,cAAM,EAAC,KAAK,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EACjDC,OAAO,EAAE,MAAM;EACfC,aAAa,EAAE,QAAQ;EACvBC,YAAY,EAAEH,KAAK,CAACI,OAAO,CAAC,GAAG;AACjC,CAAC,CAAC,CAAC;AAEH,MAAMC,eAAe,GAAG,IAAAN,cAAM,EAACO,eAAM,CAAC,CAAC;EACrCC,UAAU,EAAE;AACd,CAAC,CAAC;AAEF,MAAMC,gBAAgB,GAAG,IAAAT,cAAM,EAAC,KAAK,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EACrDS,UAAU,EAAE,YAAY;EACxBR,OAAO,EAAE,MAAM;EACfS,QAAQ,EAAE,MAAM;EAChBC,cAAc,EAAE,cAAc;EAC9BC,SAAS,EAAEZ,KAAK,CAACI,OAAO,CAAC,CAAC,CAAC;EAE3B,OAAO,EAAE;IACPS,MAAM,EAAEb,KAAK,CAACI,OAAO,CAAC,CAAC;EACzB;AACF,CAAC,CAAC,CAAC;AAEH,MAAMU,SAAS,GAAG,IAAAf,cAAM,EAAC,KAAK,CAAC,CA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AM;EACvBrF,KAAK,EAAEmF,kBAAS,CAACG,MAAM,CAACC,UAAU;EAClCxF,QAAQ,EAAEoF,kBAAS,CAACK,IAAI,CAACD,UAAU;EACnC5C,WAAW,EAAEwC,kBAAS,CAACG,MAAM;EAC7BxC,WAAW,EAAEqC,kBAAS,CAACG,MAAM;EAC7B5C,UAAU,EAAEyC,kBAAS,CAACM,MAAM;EAC5B7C,kBAAkB,EAAEuC,kBAAS,CAACG,MAAM;EACpCvC,aAAa,EAAEoC,kBAAS,CAACM,MAAM;EAC/BzC,cAAc,EAAEmC,kBAAS,CAACM,MAAM;EAChCxC,SAAS,EAAEkC,kBAAS,CAACM;AACvB,CAAC;AAAA,IAAAC,QAAA,GAAAR,OAAA,CAAAzF,OAAA,GAyPYN,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"choices.js","names":["_react","_interopRequireDefault","require","_propTypes","_editableHtmlTipTap","_configUi","_Button","_styles","_choice","_markupUtils","StyledDesign","styled","theme","display","flexDirection","marginBottom","spacing","StyledAddButton","Button","marginLeft","StyledAltChoices","alignItems","flexWrap","justifyContent","marginTop","margin","ErrorText","fontSize","typography","color","palette","error","main","paddingBottom","Choices","React","Component","constructor","args","_defineProperty2","default","warning","open","prevValue","val","key","onChange","model","props","choices","correctResponse","alternateResponses","duplicatedValue","find","c","value","id","newChoices","filter","setState","text","map","choice","choiceIsEmpty","usedForResponse","Object","keys","forEach","responseKey","values","alternate","indexOf","newChoicesWithoutTheEmptyOne","focusedEl","oldChoices","maxId","length","Math","max","parseInt","newId","duplicates","includes","componentDidUpdate","focusedNodeRef","focus","render","state","mathMlOptions","maxChoices","toolbarOpts","uploadSoundSupport","imageSupport","pluginProps","maxImageWidth","maxImageHeight","maxLength","visibleChoices","getVisibleChoices","createElement","variant","onClick","onAddChoice","disabled","index","style","minWidth","zIndex","ref","markup","languageCharactersProps","language","preventDone","onChoiceChanged","onDone","undefined","onBlur","e","inInInsertCharacter","relatedTarget","closest","disableUnderline","charactersLimit","onChoiceFocus","onRemoveChoice","onChoiceRemove","AlertDialog","title","onConfirm","exports","PropTypes","bool","string","object","isRequired","func","number","_default"],"sources":["../src/choices.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport { AlertDialog } from '@pie-lib/config-ui';\nimport Button from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\n\nimport Choice from './choice';\nimport { choiceIsEmpty } from './markupUtils';\n\nconst StyledDesign = styled('div')(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n marginBottom: theme.spacing(1.5),\n}));\n\nconst StyledAddButton = styled(Button)({\n marginLeft: 'auto',\n});\n\nconst StyledAltChoices = styled('div')(({ theme }) => ({\n alignItems: 'flex-start',\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'space-evenly',\n marginTop: theme.spacing(1),\n\n '& > *': {\n margin: theme.spacing(1),\n },\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingBottom: theme.spacing(2),\n}));\n\nexport class Choices extends React.Component {\n static propTypes = {\n duplicates: PropTypes.bool,\n error: PropTypes.string,\n model: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n toolbarOpts: PropTypes.object,\n pluginProps: PropTypes.object,\n maxChoices: PropTypes.number,\n uploadSoundSupport: PropTypes.object,\n maxImageWidth: PropTypes.number,\n maxImageHeight: PropTypes.number,\n maxLength: PropTypes.number,\n };\n\n state = { warning: { open: false } };\n preventDone = false;\n\n componentDidUpdate() {\n if (this.focusedNodeRef) {\n this.focusedNodeRef.focus('end');\n }\n }\n\n onChoiceChanged = (prevValue, val, key) => {\n const { onChange, model } = this.props;\n const { choices, correctResponse, alternateResponses } = model;\n const duplicatedValue = (choices || []).find((c) => c.value === val && c.id !== key);\n\n // discard the new added choice or the changes if the choice would be a duplicate to one that already exists\n if (duplicatedValue) {\n if (prevValue === '') {\n // remove the new added choice from choices\n const newChoices = (choices || []).filter((c) => c.id !== key);\n\n onChange(newChoices);\n }\n\n this.setState({\n warning: {\n open: true,\n text: 'Identical answer choices are not allowed and the changes will be discarded.',\n },\n });\n\n return;\n }\n\n const newChoices = choices?.map((choice) => (choice.id === key ? { ...choice, value: val } : choice)) || [];\n\n if (!choiceIsEmpty({ value: val })) {\n onChange(newChoices);\n\n return;\n }\n\n // if the edited content is empty, its usage has to be searched in the correct response definitions\n let usedForResponse = false;\n\n if (correctResponse) {\n Object.keys(correctResponse).forEach((responseKey) => {\n if (correctResponse[responseKey] === key) {\n usedForResponse = true;\n }\n });\n }\n\n if (alternateResponses && !usedForResponse) {\n Object.values(alternateResponses).forEach((alternate) => {\n if (alternate.indexOf(key) >= 0) {\n usedForResponse = true;\n }\n });\n }\n\n if (usedForResponse) {\n this.setState({\n warning: {\n open: true,\n text: 'Answer choices cannot be blank and the changes will be discarded.',\n },\n });\n\n return;\n }\n\n const newChoicesWithoutTheEmptyOne = newChoices.filter((choice) => choice.id !== key);\n\n onChange(newChoicesWithoutTheEmptyOne);\n\n this.setState({\n warning: {\n open: true,\n text: 'Answer choices cannot be blank.',\n },\n });\n };\n\n onChoiceFocus = (id) =>\n this.setState({\n focusedEl: id,\n });\n\n onAddChoice = () => {\n const {\n model: { choices: oldChoices },\n onChange,\n } = this.props;\n\n // find the maximum existing id and add 1 to generate the new id so we avoid duplicates\n const maxId = oldChoices.length > 0\n ? Math.max(...oldChoices.map(choice => parseInt(choice.id, 10) || 0))\n : -1;\n const newId = `${maxId + 1}`;\n\n this.setState(\n {\n focusedEl: newId,\n },\n () => {\n onChange([\n ...oldChoices,\n {\n id: newId,\n value: '',\n },\n ]);\n },\n );\n };\n\n onChoiceRemove = (id) => {\n const {\n onChange,\n model: { choices },\n } = this.props;\n const newChoices = (choices || []).filter((choice) => choice.id !== id);\n\n onChange(newChoices);\n };\n\n getVisibleChoices = () => {\n const {\n duplicates,\n model: { choices, correctResponse },\n } = this.props;\n\n if (!choices) {\n return [];\n }\n\n if (duplicates) {\n return choices;\n }\n\n // if duplicates not allowed, remove the choices that are used to define the correct response\n return choices.filter((choice) => !(correctResponse && Object.values(correctResponse).includes(choice.id)));\n };\n\n render() {\n const { focusedEl, warning } = this.state;\n const {\n duplicates,\n error,\n mathMlOptions = {},\n maxChoices,\n model: { choices },\n toolbarOpts,\n uploadSoundSupport,\n imageSupport = {},\n pluginProps = {},\n maxImageWidth,\n maxImageHeight,\n maxLength,\n } = this.props;\n const visibleChoices = this.getVisibleChoices() || [];\n return (\n <StyledDesign>\n <StyledAddButton\n variant=\"contained\"\n color=\"primary\"\n onClick={this.onAddChoice}\n disabled={maxChoices && choices && maxChoices === choices.length}\n >\n Add Choice\n </StyledAddButton>\n\n <StyledAltChoices>\n {visibleChoices.map((choice, index) => {\n if (!choice || !choice.id) {\n return null;\n }\n\n return focusedEl === choice.id ? (\n <div\n key={index}\n style={{\n minWidth: '100%',\n zIndex: '100',\n }}\n >\n <EditableHtml\n ref={(ref) => (this.focusedNodeRef = ref)}\n imageSupport={imageSupport}\n markup={choice.value}\n pluginProps={pluginProps}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n onChange={(val) => {\n if (this.preventDone) {\n return;\n }\n\n this.onChoiceChanged(choice.value, val, choice.id);\n }}\n onDone={() => {\n if (this.preventDone) {\n return;\n }\n\n this.setState({\n focusedEl: undefined,\n });\n }}\n onBlur={(e) => {\n const inInInsertCharacter = e.relatedTarget && e.relatedTarget.closest('.insert-character-dialog');\n\n this.preventDone = inInInsertCharacter;\n }}\n disableUnderline\n toolbarOpts={toolbarOpts}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n maxImageHeight={maxImageHeight}\n maxImageWidth={maxImageWidth}\n charactersLimit={maxLength}\n />\n </div>\n ) : (\n <Choice\n key={index}\n duplicates={duplicates}\n choice={choice}\n error={error}\n onClick={() => this.onChoiceFocus(choice.id)}\n onRemoveChoice={() => this.onChoiceRemove(choice.id)}\n />\n );\n })}\n </StyledAltChoices>\n {error && <ErrorText>{error}</ErrorText>}\n\n <AlertDialog\n open={warning.open}\n title=\"Warning\"\n text={warning.text}\n onConfirm={() => this.setState({ warning: { open: false } })}\n />\n </StyledDesign>\n );\n }\n}\n\nexport default Choices;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAEA,MAAMQ,YAAY,GAAG,IAAAC,cAAM,EAAC,KAAK,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EACjDC,OAAO,EAAE,MAAM;EACfC,aAAa,EAAE,QAAQ;EACvBC,YAAY,EAAEH,KAAK,CAACI,OAAO,CAAC,GAAG;AACjC,CAAC,CAAC,CAAC;AAEH,MAAMC,eAAe,GAAG,IAAAN,cAAM,EAACO,eAAM,CAAC,CAAC;EACrCC,UAAU,EAAE;AACd,CAAC,CAAC;AAEF,MAAMC,gBAAgB,GAAG,IAAAT,cAAM,EAAC,KAAK,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EACrDS,UAAU,EAAE,YAAY;EACxBR,OAAO,EAAE,MAAM;EACfS,QAAQ,EAAE,MAAM;EAChBC,cAAc,EAAE,cAAc;EAC9BC,SAAS,EAAEZ,KAAK,CAACI,OAAO,CAAC,CAAC,CAAC;EAE3B,OAAO,EAAE;IACPS,MAAM,EAAEb,KAAK,CAACI,OAAO,CAAC,CAAC;EACzB;AACF,CAAC,CAAC,CAAC;AAEH,MAAMU,SAAS,GAAG,IAAAf,c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K,EAAEmG,kBAAS,CAACE,MAAM;EACvBrF,KAAK,EAAEmF,kBAAS,CAACG,MAAM,CAACC,UAAU;EAClCxF,QAAQ,EAAEoF,kBAAS,CAACK,IAAI,CAACD,UAAU;EACnC5C,WAAW,EAAEwC,kBAAS,CAACG,MAAM;EAC7BxC,WAAW,EAAEqC,kBAAS,CAACG,MAAM;EAC7B5C,UAAU,EAAEyC,kBAAS,CAACM,MAAM;EAC5B7C,kBAAkB,EAAEuC,kBAAS,CAACG,MAAM;EACpCvC,aAAa,EAAEoC,kBAAS,CAACM,MAAM;EAC/BzC,cAAc,EAAEmC,kBAAS,CAACM,MAAM;EAChCxC,SAAS,EAAEkC,kBAAS,CAACM;AACvB,CAAC;AAAA,IAAAC,QAAA,GAAAR,OAAA,CAAAzF,OAAA,GAyPYN,OAAO","ignoreList":[]}
@@ -8,7 +8,7 @@ exports.default = exports.Main = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
- var _editableHtml = _interopRequireWildcard(require("@pie-lib/editable-html"));
11
+ var _editableHtmlTipTap = _interopRequireWildcard(require("@pie-lib/editable-html-tip-tap"));
12
12
  var _configUi = require("@pie-lib/config-ui");
13
13
  var _renderUi = require("@pie-lib/render-ui");
14
14
  var _drag = require("@pie-lib/drag");
@@ -308,7 +308,7 @@ class Main extends _react.default.Component {
308
308
  })
309
309
  }, teacherInstructionsEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
310
310
  label: teacherInstructions.label
311
- }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
311
+ }, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
312
312
  markup: model.teacherInstructions || '',
313
313
  onChange: this.onTeacherInstructionsChanged,
314
314
  imageSupport: imageSupport,
@@ -328,7 +328,7 @@ class Main extends _react.default.Component {
328
328
  mathMlOptions: mathMlOptions
329
329
  }), teacherInstructionsError && /*#__PURE__*/_react.default.createElement(ErrorText, null, teacherInstructionsError)), promptEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
330
330
  label: prompt.label
331
- }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
331
+ }, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
332
332
  markup: model.prompt,
333
333
  onChange: this.onPromptChanged,
334
334
  imageSupport: imageSupport,
@@ -362,8 +362,8 @@ class Main extends _react.default.Component {
362
362
  }
363
363
  }))), /*#__PURE__*/_react.default.createElement(StyledMarkup, {
364
364
  ref: this.markupRef
365
- }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
366
- activePlugins: _editableHtml.ALL_PLUGINS,
365
+ }, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
366
+ activePlugins: _editableHtmlTipTap.ALL_PLUGINS,
367
367
  responseAreaProps: {
368
368
  type: 'drag-in-the-blank',
369
369
  options: {
@@ -404,7 +404,7 @@ class Main extends _react.default.Component {
404
404
  maxLength: maxLength
405
405
  }), rationaleEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
406
406
  label: rationale.label
407
- }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
407
+ }, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
408
408
  markup: model.rationale || '',
409
409
  onChange: this.onRationaleChanged,
410
410
  imageSupport: imageSupport,
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_propTypes","_editableHtml","_interopRequireWildcard","_configUi","_renderUi","_drag","_mathRendering","_styles","_Typography","_Info","_Tooltip","_core","_modifiers","_choice","_choices","_markupUtils","_utils","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DragPreviewWrapper","React","Component","constructor","args","_defineProperty2","createRef","componentDidMount","setTimeout","containerRef","current","renderMath","componentDidUpdate","render","createElement","ref","props","children","dropdown","toggle","Panel","settings","StyledInputContainer","styled","InputContainer","theme","width","paddingTop","spacing","marginBottom","StyledMarkup","minHeight","paddingBottom","StyledText","Typography","fontSize","typography","StyledTooltip","Tooltip","whiteSpace","maxWidth","ErrorText","color","palette","error","main","FlexContainer","display","alignItems","Main","activeDragItem","newVal","onModelChanged","model","prompt","rationale","teacherInstructions","slateMarkup","choices","correctResponse","markup","createSlateMarkup","markupRef","configuration","onConfigurationChanged","imageSupport","uploadSoundSupport","addChoice","baseInputConfiguration","contentDimensions","duplicates","partialScoring","lockChoiceOrder","choicesPosition","spellCheck","settingsPanelDisabled","maxChoices","maxResponseAreas","maxImageWidth","maxImageHeight","withRubric","mathMlOptions","language","languageChoices","maxLength","rationaleEnabled","promptEnabled","teacherInstructionsEnabled","spellCheckEnabled","toolbarEditorPosition","errors","extraCSSRules","choicesError","correctResponseError","promptError","rationaleError","responseAreasError","teacherInstructionsError","validationMessage","generateValidationMessage","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","label","enabled","options","panelProperties","rubricEnabled","getPluginProps","assign","onDragEnd","active","over","drag","data","type","markupBounds","getBoundingClientRect","dropX","rect","translated","x","dropY","y","isOutsideMarkup","left","right","top","bottom","onRemove","setState","drop","onDrop","onDragStart","event","renderDragOverlay","state","value","choice","find","c","id","DragProvider","layout","ConfigLayout","dimensions","hideSettings","onChangeModel","onModelChange","onChangeConfiguration","groups","Settings","Properties","onChange","onTeacherInstructionsChanged","nonEmpty","pluginProps","inputConfiguration","languageCharactersProps","onPromptChanged","disableUnderline","component","disableFocusListener","disableTouchListener","placement","title","style","marginLeft","activePlugins","ALL_PLUGINS","responseAreaProps","onMarkupChanged","disableImageAlignmentButtons","onResponsesChanged","onRationaleChanged","DragOverlay","exports","PropTypes","object","isRequired","disableSidePanel","bool","func","shape","add","delete","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html';\nimport { layout, settings } from '@pie-lib/config-ui';\nimport { InputContainer } from '@pie-lib/render-ui';\nimport { DragProvider } from '@pie-lib/drag';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport Info from '@mui/icons-material/Info';\nimport Tooltip from '@mui/material/Tooltip';\nimport { DragOverlay } from '@dnd-kit/core';\nimport { restrictToFirstScrollableAncestor } from '@dnd-kit/modifiers';\n\nimport Choice from './choice';\nimport Choices from './choices';\nimport { createSlateMarkup } from './markupUtils';\nimport { generateValidationMessage } from '../utils';\n\nclass DragPreviewWrapper extends React.Component {\n containerRef = React.createRef();\n\n componentDidMount() {\n // Render math in the drag preview after it mounts\n setTimeout(() => {\n if (this.containerRef.current) {\n renderMath(this.containerRef.current);\n }\n }, 0);\n }\n\n componentDidUpdate() {\n // Re-render math when the drag preview updates\n setTimeout(() => {\n if (this.containerRef.current) {\n renderMath(this.containerRef.current);\n }\n }, 0);\n }\n\n render() {\n return <div ref={this.containerRef}>{this.props.children}</div>;\n }\n}\n\nconst { dropdown, toggle, Panel } = settings;\n\nconst StyledInputContainer = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n}));\n\nconst StyledMarkup = styled('div')(({ theme }) => ({\n minHeight: '235px',\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(2),\n width: '100%',\n '& [data-slate-editor=\"true\"]': {\n minHeight: '235px',\n },\n}));\n\nconst StyledText = styled(Typography)(({ theme }) => ({\n fontSize: theme.typography.fontSize + 2,\n}));\n\nconst StyledTooltip = styled(Tooltip)(({ theme }) => ({\n '& .MuiTooltip-tooltip': {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nconst FlexContainer = styled('div')({\n display: 'flex',\n alignItems: 'center',\n});\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.object,\n };\n\n state = {\n activeDragItem: null,\n };\n\n constructor(props) {\n super(props);\n this.markupRef = React.createRef();\n }\n\n onModelChange = (newVal) => {\n this.props.onModelChanged({\n ...this.props.model,\n ...newVal,\n });\n };\n\n onPromptChanged = (prompt) => {\n this.props.onModelChanged({\n ...this.props.model,\n prompt,\n });\n };\n\n onRationaleChanged = (rationale) => {\n this.props.onModelChanged({\n ...this.props.model,\n rationale,\n });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n this.props.onModelChanged({\n ...this.props.model,\n teacherInstructions,\n });\n };\n\n onMarkupChanged = (slateMarkup) => {\n this.props.onModelChanged({\n ...this.props.model,\n slateMarkup,\n });\n };\n\n onResponsesChanged = (choices) => {\n const {\n model: { correctResponse, markup },\n } = this.props;\n const slateMarkup = createSlateMarkup(markup, choices, correctResponse);\n\n this.props.onModelChanged({\n ...this.props.model,\n slateMarkup,\n choices,\n });\n };\n\n render() {\n const { model, configuration, onConfigurationChanged, imageSupport, uploadSoundSupport } = this.props;\n const {\n addChoice = {},\n baseInputConfiguration = {},\n contentDimensions = {},\n duplicates = {},\n prompt = {},\n partialScoring = {},\n lockChoiceOrder = {},\n rationale = {},\n teacherInstructions = {},\n choicesPosition = {},\n spellCheck = {},\n settingsPanelDisabled,\n maxChoices,\n maxResponseAreas,\n maxImageWidth = {},\n maxImageHeight = {},\n withRubric = {},\n mathMlOptions = {},\n language = {},\n languageChoices = {},\n maxLength = {},\n } = configuration || {};\n const {\n rationaleEnabled,\n promptEnabled,\n teacherInstructionsEnabled,\n spellCheckEnabled,\n toolbarEditorPosition,\n errors,\n extraCSSRules,\n } = model || {};\n\n const {\n choicesError,\n correctResponseError,\n prompt: promptError,\n rationale: rationaleError,\n responseAreasError,\n teacherInstructions: teacherInstructionsError,\n } = errors || {};\n const validationMessage = generateValidationMessage(configuration);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const panelSettings = {\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n duplicates: duplicates.settings && toggle(duplicates.label),\n lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label),\n choicesPosition: choicesPosition.settings && dropdown(choicesPosition.label, ['above', 'below', 'left', 'right']),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n };\n\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n const getPluginProps = (props) => {\n return Object.assign(\n {\n ...baseInputConfiguration,\n },\n props || {},\n );\n };\n\n\n const onDragEnd = ({ active, over }) => {\n // check if item was placed as a correct answer and then dropped outside of StyledMarkup component\n if (active && !over) {\n const drag = active.data.current;\n\n if (drag && drag.type === 'drag-in-the-blank-placed-choice') {\n if (this.markupRef.current) {\n const markupBounds = this.markupRef.current.getBoundingClientRect();\n const dropX = active.rect.current.translated?.x || 0;\n const dropY = active.rect.current.translated?.y || 0;\n\n const isOutsideMarkup = (\n dropX < markupBounds.left ||\n dropX > markupBounds.right ||\n dropY < markupBounds.top ||\n dropY > markupBounds.bottom\n );\n\n if (isOutsideMarkup && drag.onRemove && typeof drag.onRemove === 'function') {\n drag.onRemove(drag);\n }\n }\n }\n }\n\n if (!active || !over) {\n this.setState({\n activeDragItem: null,\n });\n return;\n }\n\n const drag = active.data.current;\n const drop = over.data.current;\n\n if (drop && typeof drop.onDrop === \"function\") {\n drop.onDrop(drag, drop);\n return;\n }\n\n if (drag && typeof drag.onDrop === \"function\") {\n drag.onDrop(drag, drop);\n }\n\n this.setState({\n activeDragItem: null,\n });\n };\n\n const onDragStart = (event) => {\n const { active } = event;\n\n if (active?.data?.current) {\n this.setState({\n activeDragItem: active.data.current,\n });\n }\n };\n\n const renderDragOverlay = () => {\n const { activeDragItem } = this.state;\n const { model } = this.props;\n\n if (!activeDragItem) return null;\n\n if ((activeDragItem.type === 'drag-in-the-blank-choice' || activeDragItem.type === 'drag-in-the-blank-placed-choice') && activeDragItem.value) {\n const choice = model.choices?.find(c => c.id === activeDragItem.value.id);\n\n if (!choice) return null;\n\n return <Choice choice={choice} />;\n }\n };\n\n return (\n <DragProvider onDragEnd={onDragEnd} onDragStart={onDragStart}>\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => this.onModelChange(model)}\n onChangeConfiguration={(configuration) => onConfigurationChanged(configuration, true)}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <StyledInputContainer label={teacherInstructions.label}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={teacherInstructionsError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(teacherInstructions?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n {promptEnabled && (\n <StyledInputContainer label={prompt.label}>\n <EditableHtml\n markup={model.prompt}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n error={promptError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(prompt?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {promptError && <ErrorText>{promptError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n <FlexContainer>\n <StyledText component={'div'}>\n Define Template, Choices, and Correct Responses\n </StyledText>\n <StyledTooltip\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} style={{ marginLeft: '5px' }} />\n </StyledTooltip>\n </FlexContainer>\n\n <StyledMarkup ref={this.markupRef}>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n responseAreaProps={{\n type: 'drag-in-the-blank',\n options: {\n duplicates: model.duplicates,\n },\n maxResponseAreas: maxResponseAreas,\n }}\n pluginProps={getPluginProps()}\n markup={model.slateMarkup}\n onChange={this.onMarkupChanged}\n imageSupport={imageSupport}\n disableImageAlignmentButtons={true}\n nonEmpty={false}\n disableUnderline\n error={responseAreasError || correctResponseError}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n </StyledMarkup>\n {responseAreasError && <ErrorText>{responseAreasError}</ErrorText>}\n {correctResponseError && <ErrorText>{correctResponseError}</ErrorText>}\n\n <Choices\n model={model}\n imageSupport={imageSupport}\n duplicates={model.duplicates}\n error={choicesError}\n onChange={this.onResponsesChanged}\n toolbarOpts={toolbarOpts}\n maxChoices={maxChoices}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n pluginProps={getPluginProps(addChoice?.inputConfiguration)}\n maxImageWidth={(maxImageWidth && maxImageWidth.choice) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.choice) || defaultImageMaxHeight}\n maxLength={maxLength}\n />\n\n {rationaleEnabled && (\n <StyledInputContainer label={rationale.label}>\n <EditableHtml\n markup={model.rationale || ''}\n onChange={this.onRationaleChanged}\n imageSupport={imageSupport}\n error={rationaleError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(rationale?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {rationaleError && <ErrorText>{rationaleError}</ErrorText>}\n </StyledInputContainer>\n )}\n </layout.ConfigLayout>\n <DragOverlay>\n <DragPreviewWrapper>\n {renderDragOverlay()}\n </DragPreviewWrapper>\n </DragOverlay>\n </DragProvider>\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,aAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAA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ACVxN,MAAA,CAAA8B,OAAA,CAAAuB,aAAA,CAACd,kBAAkB,QAChByI,iBAAiB,CAAC,CACD,CACT,CACD,CAAC;EAEnB;AACF;AAACyC,OAAA,CAAAjI,IAAA,GAAAA,IAAA;AAAA,IAAA5C,gBAAA,CAAAd,OAAA,EApXY0D,IAAI,eACI;EACjBc,aAAa,EAAEoH,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC1ChI,KAAK,EAAE8H,kBAAS,CAACC,MAAM,CAACC,UAAU;EAClCC,gBAAgB,EAAEH,kBAAS,CAACI,IAAI;EAChCnI,cAAc,EAAE+H,kBAAS,CAACK,IAAI,CAACH,UAAU;EACzCrH,sBAAsB,EAAEmH,kBAAS,CAACK,IAAI,CAACH,UAAU;EACjDpH,YAAY,EAAEkH,kBAAS,CAACM,KAAK,CAAC;IAC5BC,GAAG,EAAEP,kBAAS,CAACK,IAAI,CAACH,UAAU;IAC9BM,MAAM,EAAER,kBAAS,CAACK,IAAI,CAACH;EACzB,CAAC,CAAC;EACFnH,kBAAkB,EAAEiH,kBAAS,CAACC;AAChC,CAAC;AAAA,IAAAQ,QAAA,GAAAV,OAAA,CAAA3L,OAAA,GA0WY0D,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_propTypes","_editableHtmlTipTap","_interopRequireWildcard","_configUi","_renderUi","_drag","_mathRendering","_styles","_Typography","_Info","_Tooltip","_core","_modifiers","_choice","_choices","_markupUtils","_utils","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DragPreviewWrapper","React","Component","constructor","args","_defineProperty2","createRef","componentDidMount","setTimeout","containerRef","current","renderMath","componentDidUpdate","render","createElement","ref","props","children","dropdown","toggle","Panel","settings","StyledInputContainer","styled","InputContainer","theme","width","paddingTop","spacing","marginBottom","StyledMarkup","minHeight","paddingBottom","StyledText","Typography","fontSize","typography","StyledTooltip","Tooltip","whiteSpace","maxWidth","ErrorText","color","palette","error","main","FlexContainer","display","alignItems","Main","activeDragItem","newVal","onModelChanged","model","prompt","rationale","teacherInstructions","slateMarkup","choices","correctResponse","markup","createSlateMarkup","markupRef","configuration","onConfigurationChanged","imageSupport","uploadSoundSupport","addChoice","baseInputConfiguration","contentDimensions","duplicates","partialScoring","lockChoiceOrder","choicesPosition","spellCheck","settingsPanelDisabled","maxChoices","maxResponseAreas","maxImageWidth","maxImageHeight","withRubric","mathMlOptions","language","languageChoices","maxLength","rationaleEnabled","promptEnabled","teacherInstructionsEnabled","spellCheckEnabled","toolbarEditorPosition","errors","extraCSSRules","choicesError","correctResponseError","promptError","rationaleError","responseAreasError","teacherInstructionsError","validationMessage","generateValidationMessage","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","label","enabled","options","panelProperties","rubricEnabled","getPluginProps","assign","onDragEnd","active","over","drag","data","type","markupBounds","getBoundingClientRect","dropX","rect","translated","x","dropY","y","isOutsideMarkup","left","right","top","bottom","onRemove","setState","drop","onDrop","onDragStart","event","renderDragOverlay","state","value","choice","find","c","id","DragProvider","layout","ConfigLayout","dimensions","hideSettings","onChangeModel","onModelChange","onChangeConfiguration","groups","Settings","Properties","onChange","onTeacherInstructionsChanged","nonEmpty","pluginProps","inputConfiguration","languageCharactersProps","onPromptChanged","disableUnderline","component","disableFocusListener","disableTouchListener","placement","title","style","marginLeft","activePlugins","ALL_PLUGINS","responseAreaProps","onMarkupChanged","disableImageAlignmentButtons","onResponsesChanged","onRationaleChanged","DragOverlay","exports","PropTypes","object","isRequired","disableSidePanel","bool","func","shape","add","delete","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html-tip-tap';\nimport { layout, settings } from '@pie-lib/config-ui';\nimport { InputContainer } from '@pie-lib/render-ui';\nimport { DragProvider } from '@pie-lib/drag';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport Info from '@mui/icons-material/Info';\nimport Tooltip from '@mui/material/Tooltip';\nimport { DragOverlay } from '@dnd-kit/core';\nimport { restrictToFirstScrollableAncestor } from '@dnd-kit/modifiers';\n\nimport Choice from './choice';\nimport Choices from './choices';\nimport { createSlateMarkup } from './markupUtils';\nimport { generateValidationMessage } from '../utils';\n\nclass DragPreviewWrapper extends React.Component {\n containerRef = React.createRef();\n\n componentDidMount() {\n // Render math in the drag preview after it mounts\n setTimeout(() => {\n if (this.containerRef.current) {\n renderMath(this.containerRef.current);\n }\n }, 0);\n }\n\n componentDidUpdate() {\n // Re-render math when the drag preview updates\n setTimeout(() => {\n if (this.containerRef.current) {\n renderMath(this.containerRef.current);\n }\n }, 0);\n }\n\n render() {\n return <div ref={this.containerRef}>{this.props.children}</div>;\n }\n}\n\nconst { dropdown, toggle, Panel } = settings;\n\nconst StyledInputContainer = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n}));\n\nconst StyledMarkup = styled('div')(({ theme }) => ({\n minHeight: '235px',\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(2),\n width: '100%',\n '& [data-slate-editor=\"true\"]': {\n minHeight: '235px',\n },\n}));\n\nconst StyledText = styled(Typography)(({ theme }) => ({\n fontSize: theme.typography.fontSize + 2,\n}));\n\nconst StyledTooltip = styled(Tooltip)(({ theme }) => ({\n '& .MuiTooltip-tooltip': {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nconst FlexContainer = styled('div')({\n display: 'flex',\n alignItems: 'center',\n});\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.object,\n };\n\n state = {\n activeDragItem: null,\n };\n\n constructor(props) {\n super(props);\n this.markupRef = React.createRef();\n }\n\n onModelChange = (newVal) => {\n this.props.onModelChanged({\n ...this.props.model,\n ...newVal,\n });\n };\n\n onPromptChanged = (prompt) => {\n this.props.onModelChanged({\n ...this.props.model,\n prompt,\n });\n };\n\n onRationaleChanged = (rationale) => {\n this.props.onModelChanged({\n ...this.props.model,\n rationale,\n });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n this.props.onModelChanged({\n ...this.props.model,\n teacherInstructions,\n });\n };\n\n onMarkupChanged = (slateMarkup) => {\n this.props.onModelChanged({\n ...this.props.model,\n slateMarkup,\n });\n };\n\n onResponsesChanged = (choices) => {\n const {\n model: { correctResponse, markup },\n } = this.props;\n const slateMarkup = createSlateMarkup(markup, choices, correctResponse);\n\n this.props.onModelChanged({\n ...this.props.model,\n slateMarkup,\n choices,\n });\n };\n\n render() {\n const { model, configuration, onConfigurationChanged, imageSupport, uploadSoundSupport } = this.props;\n const {\n addChoice = {},\n baseInputConfiguration = {},\n contentDimensions = {},\n duplicates = {},\n prompt = {},\n partialScoring = {},\n lockChoiceOrder = {},\n rationale = {},\n teacherInstructions = {},\n choicesPosition = {},\n spellCheck = {},\n settingsPanelDisabled,\n maxChoices,\n maxResponseAreas,\n maxImageWidth = {},\n maxImageHeight = {},\n withRubric = {},\n mathMlOptions = {},\n language = {},\n languageChoices = {},\n maxLength = {},\n } = configuration || {};\n const {\n rationaleEnabled,\n promptEnabled,\n teacherInstructionsEnabled,\n spellCheckEnabled,\n toolbarEditorPosition,\n errors,\n extraCSSRules,\n } = model || {};\n\n const {\n choicesError,\n correctResponseError,\n prompt: promptError,\n rationale: rationaleError,\n responseAreasError,\n teacherInstructions: teacherInstructionsError,\n } = errors || {};\n const validationMessage = generateValidationMessage(configuration);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const panelSettings = {\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n duplicates: duplicates.settings && toggle(duplicates.label),\n lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label),\n choicesPosition: choicesPosition.settings && dropdown(choicesPosition.label, ['above', 'below', 'left', 'right']),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n };\n\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n const getPluginProps = (props) => {\n return Object.assign(\n {\n ...baseInputConfiguration,\n },\n props || {},\n );\n };\n\n\n const onDragEnd = ({ active, over }) => {\n // check if item was placed as a correct answer and then dropped outside of StyledMarkup component\n if (active && !over) {\n const drag = active.data.current;\n\n if (drag && drag.type === 'drag-in-the-blank-placed-choice') {\n if (this.markupRef.current) {\n const markupBounds = this.markupRef.current.getBoundingClientRect();\n const dropX = active.rect.current.translated?.x || 0;\n const dropY = active.rect.current.translated?.y || 0;\n\n const isOutsideMarkup = (\n dropX < markupBounds.left ||\n dropX > markupBounds.right ||\n dropY < markupBounds.top ||\n dropY > markupBounds.bottom\n );\n\n if (isOutsideMarkup && drag.onRemove && typeof drag.onRemove === 'function') {\n drag.onRemove(drag);\n }\n }\n }\n }\n\n if (!active || !over) {\n this.setState({\n activeDragItem: null,\n });\n return;\n }\n\n const drag = active.data.current;\n const drop = over.data.current;\n\n if (drop && typeof drop.onDrop === \"function\") {\n drop.onDrop(drag, drop);\n return;\n }\n\n if (drag && typeof drag.onDrop === \"function\") {\n drag.onDrop(drag, drop);\n }\n\n this.setState({\n activeDragItem: null,\n });\n };\n\n const onDragStart = (event) => {\n const { active } = event;\n\n if (active?.data?.current) {\n this.setState({\n activeDragItem: active.data.current,\n });\n }\n };\n\n const renderDragOverlay = () => {\n const { activeDragItem } = this.state;\n const { model } = this.props;\n\n if (!activeDragItem) return null;\n\n if ((activeDragItem.type === 'drag-in-the-blank-choice' || activeDragItem.type === 'drag-in-the-blank-placed-choice') && activeDragItem.value) {\n const choice = model.choices?.find(c => c.id === activeDragItem.value.id);\n\n if (!choice) return null;\n\n return <Choice choice={choice} />;\n }\n };\n\n return (\n <DragProvider onDragEnd={onDragEnd} onDragStart={onDragStart}>\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => this.onModelChange(model)}\n onChangeConfiguration={(configuration) => onConfigurationChanged(configuration, true)}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <StyledInputContainer label={teacherInstructions.label}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={teacherInstructionsError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(teacherInstructions?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n {promptEnabled && (\n <StyledInputContainer label={prompt.label}>\n <EditableHtml\n markup={model.prompt}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n error={promptError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(prompt?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {promptError && <ErrorText>{promptError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n <FlexContainer>\n <StyledText component={'div'}>\n Define Template, Choices, and Correct Responses\n </StyledText>\n <StyledTooltip\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} style={{ marginLeft: '5px' }} />\n </StyledTooltip>\n </FlexContainer>\n\n <StyledMarkup ref={this.markupRef}>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n responseAreaProps={{\n type: 'drag-in-the-blank',\n options: {\n duplicates: model.duplicates,\n },\n maxResponseAreas: maxResponseAreas,\n }}\n pluginProps={getPluginProps()}\n markup={model.slateMarkup}\n onChange={this.onMarkupChanged}\n imageSupport={imageSupport}\n disableImageAlignmentButtons={true}\n nonEmpty={false}\n disableUnderline\n error={responseAreasError || correctResponseError}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n </StyledMarkup>\n {responseAreasError && <ErrorText>{responseAreasError}</ErrorText>}\n {correctResponseError && <ErrorText>{correctResponseError}</ErrorText>}\n\n <Choices\n model={model}\n imageSupport={imageSupport}\n duplicates={model.duplicates}\n error={choicesError}\n onChange={this.onResponsesChanged}\n toolbarOpts={toolbarOpts}\n maxChoices={maxChoices}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n pluginProps={getPluginProps(addChoice?.inputConfiguration)}\n maxImageWidth={(maxImageWidth && maxImageWidth.choice) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.choice) || defaultImageMaxHeight}\n maxLength={maxLength}\n />\n\n {rationaleEnabled && (\n <StyledInputContainer label={rationale.label}>\n <EditableHtml\n markup={model.rationale || ''}\n onChange={this.onRationaleChanged}\n imageSupport={imageSupport}\n error={rationaleError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(rationale?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {rationaleError && <ErrorText>{rationaleError}</ErrorText>}\n </StyledInputContainer>\n )}\n </layout.ConfigLayout>\n <DragOverlay>\n <DragPreviewWrapper>\n {renderDragOverlay()}\n </DragPreviewWrapper>\n </DragOverlay>\n </DragProvider>\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,mBAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,KAAA,GA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A,GAAAA,IAAA;AAAA,IAAA5C,gBAAA,CAAAd,OAAA,EApXY0D,IAAI,eACI;EACjBc,aAAa,EAAEoH,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC1ChI,KAAK,EAAE8H,kBAAS,CAACC,MAAM,CAACC,UAAU;EAClCC,gBAAgB,EAAEH,kBAAS,CAACI,IAAI;EAChCnI,cAAc,EAAE+H,kBAAS,CAACK,IAAI,CAACH,UAAU;EACzCrH,sBAAsB,EAAEmH,kBAAS,CAACK,IAAI,CAACH,UAAU;EACjDpH,YAAY,EAAEkH,kBAAS,CAACM,KAAK,CAAC;IAC5BC,GAAG,EAAEP,kBAAS,CAACK,IAAI,CAACH,UAAU;IAC9BM,MAAM,EAAER,kBAAS,CAACK,IAAI,CAACH;EACzB,CAAC,CAAC;EACFnH,kBAAkB,EAAEiH,kBAAS,CAACC;AAChC,CAAC;AAAA,IAAAQ,QAAA,GAAAV,OAAA,CAAA3L,OAAA,GA0WY0D,IAAI","ignoreList":[]}
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@pie-element/drag-in-the-blank-configure",
3
- "version": "8.0.0-beta.0",
3
+ "version": "8.0.0-beta.1",
4
4
  "private": true,
5
5
  "main": "lib/index.js",
6
6
  "module": "src/index.js",
7
7
  "dependencies": {
8
- "@dnd-kit/core": "6.1.0",
8
+ "@dnd-kit/core": "6.3.1",
9
9
  "@dnd-kit/modifiers": "9.0.0",
10
10
  "@emotion/react": "^11.14.0",
11
11
  "@emotion/style": "^0.8.0",
12
12
  "@mui/icons-material": "^7.3.4",
13
13
  "@mui/material": "^7.3.4",
14
14
  "@pie-framework/pie-configure-events": "^1.3.0",
15
- "@pie-lib/config-ui": "11.30.4-next.0",
16
- "@pie-lib/drag": "2.22.4-next.0",
17
- "@pie-lib/editable-html": "11.21.4-next.0",
18
- "@pie-lib/math-rendering": "3.22.3-next.0",
19
- "debug": "^3.1.0",
15
+ "@pie-lib/config-ui": "12.1.1-next.0",
16
+ "@pie-lib/drag": "3.1.1-next.0",
17
+ "@pie-lib/editable-html-tip-tap": "1.1.1-next.0",
18
+ "@pie-lib/math-rendering": "4.1.1-next.0",
19
+ "debug": "^4.1.1",
20
20
  "lodash": "^4.17.15",
21
21
  "prop-types": "^15.6.2",
22
22
  "react": "18.2.0",
@@ -3,17 +3,6 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [7.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-controller@7.3.2...@pie-element/drag-in-the-blank-controller@7.3.3) (2025-11-27)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * bump libs PD-5274, PD-5211, PD-5248 ([7610b25](https://github.com/pie-framework/pie-elements/commit/7610b25423956b6492f33322513b3430051fca77))
12
-
13
-
14
-
15
-
16
-
17
6
  ## [7.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-controller@7.3.1...@pie-element/drag-in-the-blank-controller@7.3.2) (2025-10-22)
18
7
 
19
8
 
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@pie-element/drag-in-the-blank-controller",
3
3
  "private": true,
4
- "version": "8.0.0-beta.0",
4
+ "version": "8.0.0-beta.1",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
8
8
  "author": "",
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
- "@pie-lib/controller-utils": "0.22.4-next.0",
12
- "debug": "^3.1.0",
11
+ "@pie-lib/controller-utils": "1.1.1-next.0",
12
+ "debug": "^4.1.1",
13
13
  "lodash": "^4.17.15",
14
14
  "type-of": "^2.0.1"
15
15
  }
@@ -0,0 +1 @@
1
+ import{_dll_react_dom as e,_dll_react as t,_dll_lodash as n,_dll_prop_types as r,_dll_mui__icons_material as o,_dll_mui__material_styles as i,_dll_mui__material as a,_dll_pie_lib__render_ui as l,_dll_debug as s}from"../../../@pie-lib/shared-module@^3.0.5/module/index.js";import{_dll_pie_lib__math_rendering as c}from"../../../@pie-lib/math-rendering-module@^4.0.5/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as d}from"../../../@pie-lib/editable-html-module@^6.0.5/module/index.js";import{_dll_pie_lib__config_ui as u}from"../../../@pie-lib/config-module@^3.0.0/module/index.js";import{_dll_pie_lib__drag as h}from"../../../@pie-lib/drag-module@^3.0.5/module/index.js";var p={};Object.defineProperty(p,"__esModule",{value:!0});class g extends CustomEvent{constructor(e,t=!1){super(g.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}g.TYPE="model.updated";var m=p.ModelUpdatedEvent=g;class f extends CustomEvent{constructor(e,t){super(f.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}f.TYPE="delete.image";var v=p.DeleteImageEvent=f;class b extends CustomEvent{constructor(e){super(b.TYPE,{bubbles:!0,detail:e}),this.handler=e}}b.TYPE="insert.image";var y=p.InsertImageEvent=b;class C extends CustomEvent{constructor(e,t){super(C.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}C.TYPE="delete.sound";var w=p.DeleteSoundEvent=C;class x extends CustomEvent{constructor(e){super(x.TYPE,{bubbles:!0,detail:e}),this.handler=e}}x.TYPE="insert.sound";var E,_=p.InsertSoundEvent=x,S=e;E=S.createRoot,S.hydrateRoot;const{useMemo:D}=t,{useLayoutEffect:R}=t,{useEffect:k}=t,{useRef:M}=t,{useCallback:A}=t,T="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function I(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function O(e){return"nodeType"in e}function P(e){var t,n;return e?I(e)?e:O(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function N(e){const{Document:t}=P(e);return e instanceof t}function L(e){return!I(e)&&e instanceof P(e).HTMLElement}function j(e){return e instanceof P(e).SVGElement}function B(e){return e?I(e)?e.document:O(e)?N(e)?e:L(e)||j(e)?e.ownerDocument:document:document:document}const z=T?R:k;function Y(e){const t=M(e);return z(()=>{t.current=e}),A(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function W(e,t){void 0===t&&(t=[e]);const n=M(e);return z(()=>{n.current!==e&&(n.current=e)},t),n}function H(e,t){const n=M();return D(()=>{const t=e(n.current);return n.current=t,t},[...t])}function q(e){const t=Y(e),n=M(null),r=A(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function F(e){const t=M();return k(()=>{t.current=e},[e]),t.current}let U={};function X(e,t){return D(()=>{if(t)return t;const n=null==U[e]?0:U[e]+1;return U[e]=n,e+"-"+n},[e,t])}function K(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const $=K(1),V=K(-1);function J(e){if(!e)return!1;const{KeyboardEvent:t}=P(e.target);return t&&e instanceof t}function G(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=P(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Q=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Q.Translate.toString(e),Q.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Z="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ee(e){return e.matches(Z)?e:e.querySelector(Z)}const te=t,{useState:ne}=t,{useCallback:re}=t,oe={display:"none"};function ie(e){let{id:t,value:n}=e;return te.createElement("div",{id:t,style:oe},n)}function ae(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return te.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const le=t,{createContext:se}=t,{useContext:ce}=t,{useEffect:de}=t,{useState:ue}=t,{useCallback:he}=t,{useMemo:pe}=t,{useRef:ge}=t,{memo:me}=t,{useReducer:fe}=t,{cloneElement:ve}=t,{forwardRef:be}=t,{createPortal:ye}=e,{unstable_batchedUpdates:Ce}=e,we=se(null),xe={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Ee={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function _e(e){let{announcements:t=Ee,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=xe}=e;const{announce:i,announcement:a}=function(){const[e,t]=ne("");return{announce:re(e=>{null!=e&&t(e)},[]),announcement:e}}(),l=X("DndLiveRegion"),[s,c]=ue(!1);if(de(()=>{c(!0)},[]),function(e){const t=ce(we);de(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(pe(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!s)return null;const d=le.createElement(le.Fragment,null,le.createElement(ie,{id:r,value:o.draggable}),le.createElement(ae,{id:l,announcement:a}));return n?ye(d,n):d}var Se;function De(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Se||(Se={}));const Re=Object.freeze({x:0,y:0});function ke(e,t){const n=G(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Me(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Ae(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const Te=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=Ae(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(Me)};function Ie(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Re}const Oe=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((e,t)=>({...e,top:e.top+1*t.y,bottom:e.bottom+1*t.y,left:e.left+1*t.x,right:e.right+1*t.x}),{...e})};function Pe(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const Ne={ignoreTransform:!1};function Le(e,t){void 0===t&&(t=Ne);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=P(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=Pe(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,s=e.left-a-(1-o)*parseFloat(n),c=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:s+d,bottom:c+u,left:s}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:s}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:s}}function je(e){return Le(e,{ignoreTransform:!0})}function Be(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(N(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!L(o)||j(o))return n;if(n.includes(o))return n;const i=P(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=P(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=P(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function ze(e){const[t]=Be(e,1);return null!=t?t:null}function Ye(e){return T&&e?I(e)?e:O(e)?N(e)||e===B(e).scrollingElement?window:L(e)?e:null:null:null}function We(e){return I(e)?e.scrollX:e.scrollLeft}function He(e){return I(e)?e.scrollY:e.scrollTop}function qe(e){return{x:We(e),y:He(e)}}var Fe;function Ue(e){return!(!T||!e)&&e===document.scrollingElement}function Xe(e){const t={x:0,y:0},n=Ue(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Fe||(Fe={}));const Ke={x:.2,y:.2};function $e(e,t,n,r,o){let{top:i,left:a,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=Ke);const{isTop:c,isBottom:d,isLeft:u,isRight:h}=Xe(e),p={x:0,y:0},g={x:0,y:0},m=t.height*o.y,f=t.width*o.x;return!c&&i<=t.top+m?(p.y=Fe.Backward,g.y=r*Math.abs((t.top+m-i)/m)):!d&&s>=t.bottom-m&&(p.y=Fe.Forward,g.y=r*Math.abs((t.bottom-m-s)/m)),!h&&l>=t.right-f?(p.x=Fe.Forward,g.x=r*Math.abs((t.right-f-l)/f)):!u&&a<=t.left+f&&(p.x=Fe.Backward,g.x=r*Math.abs((t.left+f-a)/f)),{direction:p,speed:g}}function Ve(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Je(e){return e.reduce((e,t)=>$(e,qe(t)),Re)}function Ge(e,t){if(void 0===t&&(t=Le),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);ze(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Qe=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+We(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+He(t),0)}]];class Ze{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Be(t),r=Je(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Qe)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class et{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function tt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var nt,rt;function ot(e){e.preventDefault()}function it(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(nt||(nt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(rt||(rt={}));const at={start:[rt.Space,rt.Enter],cancel:[rt.Esc],end:[rt.Space,rt.Enter,rt.Tab]},lt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case rt.Right:return{...n,x:n.x+25};case rt.Left:return{...n,x:n.x-25};case rt.Down:return{...n,y:n.y+25};case rt.Up:return{...n,y:n.y-25}}};class st{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new et(B(t)),this.windowListeners=new et(P(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(nt.Resize,this.handleCancel),this.windowListeners.add(nt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(nt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Ge(n),t(Re)}handleKeyDown(e){if(J(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=at,coordinateGetter:i=lt,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:Re;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=V(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:s,isBottom:c,maxScroll:u,minScroll:h}=Xe(n),p=Ve(n),g={x:Math.min(o===rt.Right?p.right-p.width/2:p.right,Math.max(o===rt.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(o===rt.Down?p.bottom-p.height/2:p.bottom,Math.max(o===rt.Down?p.top:p.top+p.height/2,d.y))},m=o===rt.Right&&!l||o===rt.Left&&!s,f=o===rt.Down&&!c||o===rt.Up&&!i;if(m&&g.x!==d.x){const e=n.scrollLeft+t.x,i=o===rt.Right&&e<=u.x||o===rt.Left&&e>=h.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===rt.Right?n.scrollLeft-u.x:n.scrollLeft-h.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(f&&g.y!==d.y){const e=n.scrollTop+t.y,i=o===rt.Down&&e<=u.y||o===rt.Up&&e>=h.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===rt.Down?n.scrollTop-u.y:n.scrollTop-h.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,$(V(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function ct(e){return Boolean(e&&"distance"in e)}function dt(e){return Boolean(e&&"delay"in e)}st.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=at,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==o||o({event:e.nativeEvent}),0))}return!1}}];class ut{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=P(e);return e instanceof t?e:B(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=B(i),this.documentListeners=new et(this.document),this.listeners=new et(n),this.windowListeners=new et(P(i)),this.initialCoordinates=null!=(r=G(o))?r:Re,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(nt.Resize,this.handleCancel),this.windowListeners.add(nt.DragStart,ot),this.windowListeners.add(nt.VisibilityChange,this.handleCancel),this.windowListeners.add(nt.ContextMenu,ot),this.documentListeners.add(nt.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(dt(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ct(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(nt.Click,it,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(nt.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=G(e))?t:Re,s=V(r,l);if(!n&&a){if(ct(a)){if(null!=a.tolerance&&tt(s,a.tolerance))return this.handleCancel();if(tt(s,a.distance))return this.handleStart()}return dt(a)&&tt(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===rt.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const ht={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class pt extends ut{constructor(e){const{event:t}=e,n=B(t.target);super(e,ht,n)}}pt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button||(null==r||r({event:n}),0))}}];const gt={move:{name:"mousemove"},end:{name:"mouseup"}};var mt;!function(e){e[e.RightClick=2]="RightClick"}(mt||(mt={})),class extends ut{constructor(e){super(e,gt,B(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==mt.RightClick&&(null==r||r({event:n}),!0)}}];const ft={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var vt,bt;function yt(e){let{acceleration:t,activator:n=vt.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:l=bt.TreeOrder,pointerCoordinates:s,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:h}=e;const p=function(e){let{delta:t,disabled:n}=e;const r=F(t);return H(e=>{if(n||!r||!e)return Ct;const o=Math.sign(t.x-r.x),i=Math.sign(t.y-r.y);return{x:{[Fe.Backward]:e.x[Fe.Backward]||-1===o,[Fe.Forward]:e.x[Fe.Forward]||1===o},y:{[Fe.Backward]:e.y[Fe.Backward]||-1===i,[Fe.Forward]:e.y[Fe.Forward]||1===i}}},[n,t,r])}({delta:u,disabled:!i}),[g,m]=function(){const e=M(null);return[A((t,n)=>{e.current=setInterval(t,n)},[]),A(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),f=ge({x:0,y:0}),v=ge({x:0,y:0}),b=pe(()=>{switch(n){case vt.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case vt.DraggableRect:return o}},[n,o,s]),y=ge(null),C=he(()=>{const e=y.current;if(!e)return;const t=f.current.x*v.current.x,n=f.current.y*v.current.y;e.scrollBy(t,n)},[]),w=pe(()=>l===bt.TreeOrder?[...c].reverse():c,[l,c]);de(()=>{if(i&&c.length&&b){for(const e of w){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=d[n];if(!o)continue;const{direction:i,speed:l}=$e(e,o,b,t,h);for(const e of["x","y"])p[e][i[e]]||(l[e]=0,i[e]=0);if(l.x>0||l.y>0)return m(),y.current=e,g(C,a),f.current=l,void(v.current=i)}f.current={x:0,y:0},v.current={x:0,y:0},m()}else m()},[t,C,r,m,i,a,JSON.stringify(b),JSON.stringify(p),g,c,w,d,JSON.stringify(h)])}(class extends ut{constructor(e){super(e,ft)}static setup(){return window.addEventListener(ft.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ft.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1||(null==r||r({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(vt||(vt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(bt||(bt={}));const Ct={x:{[Fe.Backward]:!1,[Fe.Forward]:!1},y:{[Fe.Backward]:!1,[Fe.Forward]:!1}};var wt,xt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(wt||(wt={})),(xt||(xt={})).Optimized="optimized";const Et=new Map;function _t(e,t){return H(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function St(e){let{callback:t,disabled:n}=e;const r=Y(t),o=pe(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return de(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Dt(e){return new Ze(Le(e),e)}function Rt(e,t,n){void 0===t&&(t=Dt);const[r,o]=ue(null);function i(){o(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const a=function(e){let{callback:t,disabled:n}=e;const r=Y(t),o=pe(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return de(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),l=St({callback:i});return z(()=>{i(),e?(null==l||l.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==a||a.disconnect())},[e]),r}const kt=[];function Mt(e,t){void 0===t&&(t=[]);const n=ge(null);return de(()=>{n.current=null},t),de(()=>{const t=e!==Re;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?V(e,n.current):Re}function At(e){return pe(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const Tt=[];function It(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return L(t)?t:e}const Ot=[{sensor:pt,options:{}},{sensor:st,options:{}}],Pt={current:{}},Nt={draggable:{measure:je},droppable:{measure:je,strategy:wt.WhileDragging,frequency:xt.Optimized},dragOverlay:{measure:Le}};class Lt extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const jt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Lt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:De},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Nt,measureDroppableContainers:De,windowRect:null,measuringScheduled:!1},Bt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:De,draggableNodes:new Map,over:null,measureDroppableContainers:De},zt=se(Bt),Yt=se(jt);function Wt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Lt}}}function Ht(e,t){switch(t.type){case Se.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Se.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Se.DragEnd:case Se.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Se.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Lt(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Se.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new Lt(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Se.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Lt(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function qt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=ce(zt),i=F(r),a=F(null==n?void 0:n.id);return de(()=>{if(!t&&!r&&i&&null!=a){if(!J(i))return;if(document.activeElement===i.target)return;const e=o.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=ee(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function Ft(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const Ut=se({...Re,scaleX:1,scaleY:1});var Xt;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Xt||(Xt={})),me(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:l=!0,children:s,sensors:c=Ot,collisionDetection:d=Te,measuring:u,modifiers:h,...p}=e;const g=fe(Ht,void 0,Wt),[m,f]=g,[v,b]=function(){const[e]=ue(()=>new Set),t=he(t=>(e.add(t),()=>e.delete(t)),[e]);return[he(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[y,C]=ue(Xt.Uninitialized),w=y===Xt.Initialized,{draggable:{active:x,nodes:E,translate:_},droppable:{containers:S}}=m,D=null!=x?E.get(x):null,R=ge({initial:null,translated:null}),k=pe(()=>{var e;return null!=x?{id:x,data:null!=(e=null==D?void 0:D.data)?e:Pt,rect:R}:null},[x,D]),M=ge(null),[A,I]=ue(null),[O,N]=ue(null),j=W(p,Object.values(p)),B=X("DndDescribedBy",i),Y=pe(()=>S.getEnabled(),[S]),F=pe(()=>({draggable:{...Nt.draggable,...null==U?void 0:U.draggable},droppable:{...Nt.droppable,...null==U?void 0:U.droppable},dragOverlay:{...Nt.dragOverlay,...null==U?void 0:U.dragOverlay}}),[null==(U=u)?void 0:U.draggable,null==U?void 0:U.droppable,null==U?void 0:U.dragOverlay]);var U;const{droppableRects:K,measureDroppableContainers:V,measuringScheduled:J}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=ue(null),{frequency:l,measure:s,strategy:c}=o,d=ge(e),u=function(){switch(c){case wt.Always:return!1;case wt.BeforeDragging:return n;default:return!n}}(),h=W(u),p=he(function(e){void 0===e&&(e=[]),h.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[h]),g=ge(null),m=H(t=>{if(u&&!n)return Et;if(!t||t===Et||d.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new Ze(s(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,u,s]);return de(()=>{d.current=e},[e]),de(()=>{u||p()},[n,u]),de(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),de(()=>{u||"number"!=typeof l||null!==g.current||(g.current=setTimeout(()=>{p(),g.current=null},l))},[l,u,p,...r]),{droppableRects:m,measureDroppableContainers:p,measuringScheduled:null!=i}}(Y,{dragging:w,dependencies:[_.x,_.y],config:F.droppable}),Q=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return H(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(E,x),Z=pe(()=>O?G(O):null,[O]),ee=function(){const e=!1===(null==A?void 0:A.autoScrollEnabled),t="object"==typeof l?!1===l.enabled:!1===l,n=w&&!e&&!t;return"object"==typeof l?{...l,enabled:n}:{enabled:n}}(),te=function(e,t){return _t(e,t)}(Q,F.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=ge(!1),{x:a,y:l}="boolean"==typeof o?{x:o,y:o}:o;z(()=>{if(!a&&!l||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=Ie(n(e),r);if(a||(o.x=0),l||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=ze(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,l,r,n])}({activeNode:null!=x?E.get(x):null,config:ee.layoutShiftCompensation,initialRect:te,measure:F.draggable.measure});const ne=Rt(Q,F.draggable.measure,te),re=Rt(Q?Q.parentElement:null),oe=ge({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:S,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=S.getNodeFor(null==(t=oe.current.over)?void 0:t.id),ae=function(e){let{measure:t}=e;const[n,r]=ue(null),o=St({callback:he(e=>{for(const{target:n}of e)if(L(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=he(e=>{const n=It(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[a,l]=q(i);return pe(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}({measure:F.dragOverlay.measure}),se=null!=(n=ae.nodeRef.current)?n:Q,ce=w?null!=(r=ae.rect)?r:ne:null,me=Boolean(ae.nodeRef.current&&ae.rect),ve=Ie(be=me?null:ne,_t(be));var be;const ye=At(se?P(se):null),xe=function(e){const t=ge(e),n=H(n=>e?n&&n!==kt&&e&&t.current&&e.parentNode===t.current.parentNode?n:Be(e):kt,[e]);return de(()=>{t.current=e},[e]),n}(w?null!=ie?ie:Q:null),Ee=function(e,t){void 0===t&&(t=Le);const[n]=e,r=At(n?P(n):null),[o,i]=ue(Tt);function a(){i(()=>e.length?e.map(e=>Ue(e)?r:new Ze(t(e),e)):Tt)}const l=St({callback:a});return z(()=>{null==l||l.disconnect(),a(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),o}(xe),De=Ft(h,{transform:{x:_.x-ve.x,y:_.y-ve.y,scaleX:1,scaleY:1},activatorEvent:O,active:k,activeNodeRect:ne,containerNodeRect:re,draggingNodeRect:ce,over:oe.current.over,overlayNodeRect:ae.rect,scrollableAncestors:xe,scrollableAncestorRects:Ee,windowRect:ye}),ke=Z?$(Z,_):null,Me=function(e){const[t,n]=ue(null),r=ge(e),o=he(e=>{const t=Ye(e.target);t&&n(e=>e?(e.set(t,qe(t)),new Map(e)):null)},[]);return de(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=Ye(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,qe(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=Ye(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),pe(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>$(e,t),Re):Je(e):Re,[e,t])}(xe),Ae=Mt(Me),Pe=Mt(Me,[ne]),Ne=$(De,Ae),je=ce?Oe(ce,De):null,We=k&&je?d({active:k,collisionRect:je,droppableRects:K,droppableContainers:Y,pointerCoordinates:ke}):null,He=function(e){if(!e||0===e.length)return null;const[t]=e;return t.id}(We),[Fe,Xe]=ue(null),Ke=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(me?De:$(De,Pe),null!=(o=null==Fe?void 0:Fe.rect)?o:null,ne),$e=ge(null),Ve=he((e,t)=>{let{sensor:n,options:r}=t;if(null==M.current)return;const o=E.get(M.current);if(!o)return;const i=e.nativeEvent,a=new n({active:M.current,activeNode:o,event:i,options:r,context:oe,onAbort(e){if(!E.get(e))return;const{onDragAbort:t}=j.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!E.get(e))return;const{onDragPending:o}=j.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),v({type:"onDragPending",event:i})},onStart(e){const t=M.current;if(null==t)return;const n=E.get(t);if(!n)return;const{onDragStart:r}=j.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:R}};Ce(()=>{null==r||r(o),C(Xt.Initializing),f({type:Se.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),I($e.current),N(i)})},onMove(e){f({type:Se.DragMove,coordinates:e})},onEnd:l(Se.DragEnd),onCancel:l(Se.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=oe.current;let a=null;if(t&&o){const{cancelDrop:l}=j.current;a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===Se.DragEnd&&"function"==typeof l&&await Promise.resolve(l(a))&&(e=Se.DragCancel)}M.current=null,Ce(()=>{f({type:e}),C(Xt.Uninitialized),Xe(null),I(null),N(null),$e.current=null;const t=e===Se.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=j.current[t];null==e||e(a),v({type:t,event:a})}})}}$e.current=a},[E]),Ge=he((e,t)=>(n,r)=>{const o=n.nativeEvent,i=E.get(r);if(null!==M.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},M.current=r,Ve(n,t))},[E,Ve]),Qe=function(e,t){return pe(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(c,Ge);!function(e){de(()=>{if(!T)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(c),z(()=>{ne&&y===Xt.Initializing&&C(Xt.Initialized)},[ne,y]),de(()=>{const{onDragMove:e}=j.current,{active:t,activatorEvent:n,collisions:r,over:o}=oe.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:Ne.x,y:Ne.y},over:o};Ce(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[Ne.x,Ne.y]),de(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=oe.current;if(!e||null==M.current||!t||!o)return;const{onDragOver:i}=j.current,a=r.get(He),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};Ce(()=>{Xe(l),null==i||i(s),v({type:"onDragOver",event:s})})},[He]),z(()=>{oe.current={activatorEvent:O,active:k,activeNode:Q,collisionRect:je,collisions:We,droppableRects:K,draggableNodes:E,draggingNode:se,draggingNodeRect:ce,droppableContainers:S,over:Fe,scrollableAncestors:xe,scrollAdjustedTranslate:Ne},R.current={initial:ce,translated:je}},[k,Q,We,je,E,se,ce,K,S,Fe,xe,Ne]),yt({...ee,delta:_,draggingRect:je,pointerCoordinates:ke,scrollableAncestors:xe,scrollableAncestorRects:Ee});const et=pe(()=>({active:k,activeNode:Q,activeNodeRect:ne,activatorEvent:O,collisions:We,containerNodeRect:re,dragOverlay:ae,draggableNodes:E,droppableContainers:S,droppableRects:K,over:Fe,measureDroppableContainers:V,scrollableAncestors:xe,scrollableAncestorRects:Ee,measuringConfiguration:F,measuringScheduled:J,windowRect:ye}),[k,Q,ne,O,We,re,ae,E,S,K,Fe,V,xe,Ee,F,J,ye]),tt=pe(()=>({activatorEvent:O,activators:Qe,active:k,activeNodeRect:ne,ariaDescribedById:{draggable:B},dispatch:f,draggableNodes:E,over:Fe,measureDroppableContainers:V}),[O,Qe,k,ne,f,B,E,Fe,V]);return le.createElement(we.Provider,{value:b},le.createElement(zt.Provider,{value:tt},le.createElement(Yt.Provider,{value:et},le.createElement(Ut.Provider,{value:Ke},s)),le.createElement(qt,{disabled:!1===(null==a?void 0:a.restoreFocus)})),le.createElement(_e,{...a,hiddenTextDescribedById:B}))});const Kt=se(null),$t="button";function Vt(e){let{animation:t,children:n}=e;const[r,o]=ue(null),[i,a]=ue(null),l=F(n);return n||r||!l||o(l),z(()=>{if(!i)return;const e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{o(null)}):o(null)},[t,r,i]),le.createElement(le.Fragment,null,n,r?ve(r,{ref:a}):null)}const Jt={x:0,y:0,scaleX:1,scaleY:1};function Gt(e){let{children:t}=e;return le.createElement(zt.Provider,{value:Bt},le.createElement(Ut.Provider,{value:Jt},t))}const Qt={position:"fixed",touchAction:"none"},Zt=e=>J(e)?"transform 250ms ease":void 0,en=be((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:l,style:s,transform:c,transition:d=Zt}=e;if(!l)return null;const u=o?c:{...c,scaleX:1,scaleY:1},h={...Qt,width:l.width,height:l.height,top:l.top,left:l.left,transform:Q.Transform.toString(u),transformOrigin:o&&r?ke(r,l):void 0,transition:"function"==typeof d?d(r):d,...s};return le.createElement(n,{className:a,style:h,ref:t},i)}),tn={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Q.Transform.toString(t)},{transform:Q.Transform.toString(n)}]},sideEffects:(nn={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=nn;if(null!=o&&o.active)for(const[e,n]of Object.entries(o.active))void 0!==n&&(r[e]=t.node.style.getPropertyValue(e),t.node.style.setProperty(e,n));if(null!=o&&o.dragOverlay)for(const[e,t]of Object.entries(o.dragOverlay))void 0!==t&&n.node.style.setProperty(e,t);return null!=i&&i.active&&t.node.classList.add(i.active),null!=i&&i.dragOverlay&&n.node.classList.add(i.dragOverlay),function(){for(const[e,n]of Object.entries(r))t.node.style.setProperty(e,n);null!=i&&i.active&&t.node.classList.remove(i.active)}})};var nn;let rn=0;const on=le.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:a,wrapperElement:l="div",className:s,zIndex:c=999}=e;const{activatorEvent:d,active:u,activeNodeRect:h,containerNodeRect:p,draggableNodes:g,droppableContainers:m,dragOverlay:f,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:C,windowRect:w}=ce(Yt),x=ce(Ut),E=function(e){return pe(()=>{if(null!=e)return rn++,rn},[e])}(null==u?void 0:u.id),_=Ft(a,{activatorEvent:d,active:u,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:f.rect,over:v,overlayNodeRect:f.rect,scrollableAncestors:y,scrollableAncestorRects:C,transform:x,windowRect:w}),S=_t(h),D=function(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Y((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const l=a.node.current;if(!l)return;const s=It(i);if(!s)return;const{transform:c}=P(i).getComputedStyle(i),d=Pe(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...tn,...e};return e=>{let{active:i,dragOverlay:a,transform:l,...s}=e;if(!t)return;const c=a.rect.left-i.rect.left,d=a.rect.top-i.rect.top,u={scaleX:1!==l.scaleX?i.rect.width*l.scaleX/a.rect.width:1,scaleY:1!==l.scaleY?i.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-c,y:l.y-d,...u},p=o({...s,active:i,dragOverlay:a,transform:{initial:l,final:h}}),[g]=p,m=p[p.length-1];if(JSON.stringify(g)===JSON.stringify(m))return;const f=null==r?void 0:r({active:i,dragOverlay:a,...s}),v=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{v.onfinish=()=>{null==f||f(),e()}})}}(t);return Ge(l,o.draggable.measure),u({active:{id:e,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(s)},droppableContainers:r,measuringConfiguration:o,transform:d})})}({config:r,draggableNodes:g,droppableContainers:m,measuringConfiguration:b}),R=S?f.setRef:void 0;return le.createElement(Gt,null,le.createElement(Vt,{animation:D},u&&E?le.createElement(en,{key:E,id:u.id,ref:R,as:l,activatorEvent:d,adjustScale:t,className:s,transition:i,rect:S,style:{zIndex:c,...o},transform:_},n):null))}),{escape:an}=n,ln=e=>{const t=document.createElement("div");return t.innerHTML=e.trim(),t},sn="imes|riangle|an|heta|herefore",cn="throot|parallel|cong|approx|eq|e|sim",dn=new RegExp(`(\\t(?!${sn}))|(\\n(?!${cn}))|(\\\\t(?!${sn}))|(\\\\n(?!${cn}))`,"g"),un=e=>e.replace(dn,"").replace(/\\"/g,'"').replace(/\\\//g,"/"),hn=/\{\{(\d+)\}\}/g,pn=(e,t,n)=>{const r=un(e);let o=0;return r.replace(hn,(e,r)=>{const i=n[r];let a=t.find(e=>e.id===i);return a&&a.value||(a={id:"",value:""}),`<span data-type="drag_in_the_blank" data-index="${o++}" data-id="${a.id}" data-value="${an(a.value)}"></span>`})},gn=e=>{if(e){const{value:t=""}=e,n=ln(t);return Array.from(n.querySelectorAll("*")).forEach(e=>{"IMG"!==e.tagName&&0===e.childNodes.length&&e.remove()}),""===n.innerHTML.trim()}return!1},mn=t,fn=r,{MoreVert:vn}=o,{Delete:bn}=o,{styled:yn}=i,Cn=({style:e})=>mn.createElement("span",{style:e},mn.createElement(vn,{style:{margin:"0 -16px"}}),mn.createElement(vn,null));Cn.propTypes={style:fn.object};const wn=yn("div",{shouldForwardProp:e=>!["error","isDragging"].includes(e)})(({theme:e,error:t})=>({display:"inline-flex",minWidth:"178px",minHeight:"36px",background:e.palette.common.white,boxSizing:"border-box",borderRadius:"3px",overflow:"hidden",position:"relative",padding:"8px 35px 8px 35px",cursor:"grab",border:"1px solid "+(t?"#f44336":"#C0C3CF"),"& img":{display:"flex"},"& mjx-frac":{fontSize:"120% !important"}})),xn=yn(bn)(({theme:e})=>({position:"absolute",top:"6px",right:"0",color:e.palette.grey[500],zIndex:2,"&:hover":{cursor:"pointer",color:e.palette.common.black}})),En=e=>{const{choice:t,onClick:n,onRemoveChoice:r,error:o,instanceId:i,disabled:a}=e,{attributes:l,listeners:s,setNodeRef:c,isDragging:d}=function(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=X("Draggable"),{activators:a,activatorEvent:l,active:s,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:h}=ce(zt),{role:p=$t,roleDescription:g="draggable",tabIndex:m=0}=null!=o?o:{},f=(null==s?void 0:s.id)===t,v=ce(f?Ut:Kt),[b,y]=q(),[C,w]=q(),x=function(e,t){return pe(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),E=W(n);return z(()=>(u.set(t,{id:t,key:i,node:b,activatorNode:C,data:E}),()=>{const e=u.get(t);e&&e.key===i&&u.delete(t)}),[u,t]),{active:s,activatorEvent:l,activeNodeRect:c,attributes:pe(()=>({role:p,tabIndex:m,"aria-disabled":r,"aria-pressed":!(!f||p!==$t)||void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[r,p,m,f,g,d.draggable]),isDragging:f,listeners:r?void 0:x,node:b,over:h,setNodeRef:y,setActivatorNodeRef:w,transform:v}}({id:`choice-${t.id}-${i||"default"}`,data:{type:"drag-in-the-blank-choice",id:t.id,value:t,instanceId:i},disabled:a||gn(t)});return mn.createElement(wn,{ref:c,error:o,isDragging:d,onClick:n,...l,...s,onDragStart:e=>{if(gn(t))return e.preventDefault(),void alert("You need to define a value for an answer choice before it can be associated with a response area.")}},mn.createElement(Cn,{style:{position:"absolute",top:"6px",left:"15px",color:"#9e9e9e",zIndex:2}}),mn.createElement("span",{dangerouslySetInnerHTML:{__html:t.value}}),mn.createElement(xn,{onClick:e=>{e.preventDefault(),e.stopPropagation(),r(e)}}))};En.propTypes={choice:fn.object.isRequired,onClick:fn.func,onRemoveChoice:fn.func.isRequired,error:fn.bool,instanceId:fn.string,disabled:fn.bool};const _n=t,Sn=r,{Button:Dn}=a,{styled:Rn}=i,kn=d,{AlertDialog:Mn}=u,An=Rn("div")(({theme:e})=>({display:"flex",flexDirection:"column",marginBottom:e.spacing(1.5)})),Tn=Rn(Dn)({marginLeft:"auto"}),In=Rn("div")(({theme:e})=>({alignItems:"flex-start",display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",marginTop:e.spacing(1),"& > *":{margin:e.spacing(1)}})),On=Rn("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingBottom:e.spacing(2)}));class Pn extends _n.Component{constructor(...e){super(...e),Pn.prototype.__init.call(this),Pn.prototype.__init2.call(this),Pn.prototype.__init3.call(this),Pn.prototype.__init4.call(this),Pn.prototype.__init5.call(this),Pn.prototype.__init6.call(this),Pn.prototype.__init7.call(this)}static __initStatic(){this.propTypes={duplicates:Sn.bool,error:Sn.string,model:Sn.object.isRequired,onChange:Sn.func.isRequired,toolbarOpts:Sn.object,pluginProps:Sn.object,maxChoices:Sn.number,uploadSoundSupport:Sn.object,maxImageWidth:Sn.number,maxImageHeight:Sn.number,maxLength:Sn.number}}__init(){this.state={warning:{open:!1}}}__init2(){this.preventDone=!1}componentDidUpdate(){this.focusedNodeRef&&this.focusedNodeRef.focus("end")}__init3(){this.onChoiceChanged=(e,t,n)=>{const{onChange:r,model:o}=this.props,{choices:i,correctResponse:a,alternateResponses:l}=o;if((i||[]).find(e=>e.value===t&&e.id!==n))return""===e&&r((i||[]).filter(e=>e.id!==n)),void this.setState({warning:{open:!0,text:"Identical answer choices are not allowed and the changes will be discarded."}});const s=function(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}([i,"optionalAccess",e=>e.map,"call",e=>e(e=>e.id===n?{...e,value:t}:e)])||[];if(!gn({value:t}))return void r(s);let c=!1;a&&Object.keys(a).forEach(e=>{a[e]===n&&(c=!0)}),l&&!c&&Object.values(l).forEach(e=>{e.indexOf(n)>=0&&(c=!0)}),c?this.setState({warning:{open:!0,text:"Answer choices cannot be blank and the changes will be discarded."}}):(r(s.filter(e=>e.id!==n)),this.setState({warning:{open:!0,text:"Answer choices cannot be blank."}}))}}__init4(){this.onChoiceFocus=e=>this.setState({focusedEl:e})}__init5(){this.onAddChoice=()=>{const{model:{choices:e},onChange:t}=this.props,n=`${(e.length>0?Math.max(...e.map(e=>parseInt(e.id,10)||0)):-1)+1}`;this.setState({focusedEl:n},()=>{t([...e,{id:n,value:""}])})}}__init6(){this.onChoiceRemove=e=>{const{onChange:t,model:{choices:n}}=this.props;t((n||[]).filter(t=>t.id!==e))}}__init7(){this.getVisibleChoices=()=>{const{duplicates:e,model:{choices:t,correctResponse:n}}=this.props;return t?e?t:t.filter(e=>!(n&&Object.values(n).includes(e.id))):[]}}render(){const{focusedEl:e,warning:t}=this.state,{duplicates:n,error:r,mathMlOptions:o={},maxChoices:i,model:{choices:a},toolbarOpts:l,uploadSoundSupport:s,imageSupport:c={},pluginProps:d={},maxImageWidth:u,maxImageHeight:h,maxLength:p}=this.props,g=this.getVisibleChoices()||[];return _n.createElement(An,null,_n.createElement(Tn,{variant:"contained",color:"primary",onClick:this.onAddChoice,disabled:i&&a&&i===a.length},"Add Choice"),_n.createElement(In,null,g.map((t,i)=>t&&t.id?e===t.id?_n.createElement("div",{key:i,style:{minWidth:"100%",zIndex:"100"}},_n.createElement(kn,{ref:e=>this.focusedNodeRef=e,imageSupport:c,markup:t.value,pluginProps:d,languageCharactersProps:[{language:"spanish"},{language:"special"}],onChange:e=>{this.preventDone||this.onChoiceChanged(t.value,e,t.id)},onDone:()=>{this.preventDone||this.setState({focusedEl:void 0})},onBlur:e=>{const t=e.relatedTarget&&e.relatedTarget.closest(".insert-character-dialog");this.preventDone=t},disableUnderline:!0,toolbarOpts:l,uploadSoundSupport:s,mathMlOptions:o,maxImageHeight:h,maxImageWidth:u,charactersLimit:p})):_n.createElement(En,{key:i,duplicates:n,choice:t,error:r,onClick:()=>this.onChoiceFocus(t.id),onRemoveChoice:()=>this.onChoiceRemove(t.id)}):null)),r&&_n.createElement(On,null,r),_n.createElement(Mn,{open:t.open,title:"Warning",text:t.text,onConfirm:()=>this.setState({warning:{open:!1}})}))}}Pn.__initStatic();const Nn=t,Ln=r,{InputContainer:jn}=l,{styled:Bn}=i,{Typography:zn}=a,{Tooltip:Yn}=a,{Info:Wn}=o,Hn=d,{ALL_PLUGINS:qn}=d,{layout:Fn}=u,{settings:Un}=u,{DragProvider:Xn}=h,{renderMath:Kn}=c;function $n(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}class Vn extends Nn.Component{constructor(...e){super(...e),Vn.prototype.__init.call(this)}__init(){this.containerRef=Nn.createRef()}componentDidMount(){setTimeout(()=>{this.containerRef.current&&Kn(this.containerRef.current)},0)}componentDidUpdate(){setTimeout(()=>{this.containerRef.current&&Kn(this.containerRef.current)},0)}render(){return Nn.createElement("div",{ref:this.containerRef},this.props.children)}}const{dropdown:Jn,toggle:Gn,Panel:Qn}=Un,Zn=Bn(jn)(({theme:e})=>({width:"100%",paddingTop:e.spacing(2),marginBottom:e.spacing(2)})),er=Bn("div")(({theme:e})=>({minHeight:"235px",paddingTop:e.spacing(1),paddingBottom:e.spacing(2),width:"100%",'& [data-slate-editor="true"]':{minHeight:"235px"}})),tr=Bn(zn)(({theme:e})=>({fontSize:e.typography.fontSize+2})),nr=Bn(Yn)(({theme:e})=>({"& .MuiTooltip-tooltip":{fontSize:e.typography.fontSize-2,whiteSpace:"pre",maxWidth:"500px"}})),rr=Bn("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)})),or=Bn("div")({display:"flex",alignItems:"center"});class ir extends Nn.Component{static __initStatic(){this.propTypes={configuration:Ln.object.isRequired,model:Ln.object.isRequired,disableSidePanel:Ln.bool,onModelChanged:Ln.func.isRequired,onConfigurationChanged:Ln.func.isRequired,imageSupport:Ln.shape({add:Ln.func.isRequired,delete:Ln.func.isRequired}),uploadSoundSupport:Ln.object}}__init2(){this.state={activeDragItem:null}}constructor(e){super(e),ir.prototype.__init2.call(this),ir.prototype.__init3.call(this),ir.prototype.__init4.call(this),ir.prototype.__init5.call(this),ir.prototype.__init6.call(this),ir.prototype.__init7.call(this),ir.prototype.__init8.call(this),this.markupRef=Nn.createRef()}__init3(){this.onModelChange=e=>{this.props.onModelChanged({...this.props.model,...e})}}__init4(){this.onPromptChanged=e=>{this.props.onModelChanged({...this.props.model,prompt:e})}}__init5(){this.onRationaleChanged=e=>{this.props.onModelChanged({...this.props.model,rationale:e})}}__init6(){this.onTeacherInstructionsChanged=e=>{this.props.onModelChanged({...this.props.model,teacherInstructions:e})}}__init7(){this.onMarkupChanged=e=>{this.props.onModelChanged({...this.props.model,slateMarkup:e})}}__init8(){this.onResponsesChanged=e=>{const{model:{correctResponse:t,markup:n}}=this.props,r=pn(n,e,t);this.props.onModelChanged({...this.props.model,slateMarkup:r,choices:e})}}render(){const{model:e,configuration:t,onConfigurationChanged:n,imageSupport:r,uploadSoundSupport:o}=this.props,{addChoice:i={},baseInputConfiguration:a={},contentDimensions:l={},duplicates:s={},prompt:c={},partialScoring:d={},lockChoiceOrder:u={},rationale:h={},teacherInstructions:p={},choicesPosition:g={},spellCheck:m={},settingsPanelDisabled:f,maxChoices:v,maxResponseAreas:b,maxImageWidth:y={},maxImageHeight:C={},withRubric:w={},mathMlOptions:x={},language:E={},languageChoices:_={},maxLength:S={}}=t||{},{rationaleEnabled:D,promptEnabled:R,teacherInstructionsEnabled:k,spellCheckEnabled:M,toolbarEditorPosition:A,errors:T,extraCSSRules:I}=e||{},{choicesError:O,correctResponseError:P,prompt:N,rationale:L,responseAreasError:j,teacherInstructions:B}=T||{},z=(e=>{let{maxResponseAreas:t,minChoices:n,maxChoices:r}=e;return n=n||2,"Validation requirements:\nThe tokens should not be empty and should be unique.\nThere should be at least 1 "+(t?`and at most ${t} `:"")+"response area"+(t?"s":"")+" defined."+`\nThere should be at least ${n} `+(r?`and at most ${r} `:"")+"tokens defined."})(t),Y=y&&y.prompt,W=C&&C.prompt,H={position:"top"===A?"top":"bottom"},q={partialScoring:d.settings&&Gn(d.label),duplicates:s.settings&&Gn(s.label),lockChoiceOrder:u.settings&&Gn(u.label),choicesPosition:g.settings&&Jn(g.label,["above","below","left","right"]),"language.enabled":E.settings&&Gn(E.label,!0),language:E.settings&&E.enabled&&Jn(_.label,_.options)},F={teacherInstructionsEnabled:p.settings&&Gn(p.label),rationaleEnabled:h.settings&&Gn(h.label),spellCheckEnabled:m.settings&&Gn(m.label),promptEnabled:c.settings&&Gn(c.label),rubricEnabled:$n([w,"optionalAccess",e=>e.settings])&&Gn($n([w,"optionalAccess",e=>e.label]))},U=e=>Object.assign({...a},e||{});return Nn.createElement(Xn,{onDragEnd:({active:e,over:t})=>{if(e&&!t){const t=e.data.current;if(t&&"drag-in-the-blank-placed-choice"===t.type&&this.markupRef.current){const n=this.markupRef.current.getBoundingClientRect(),r=$n([e,"access",e=>e.rect,"access",e=>e.current,"access",e=>e.translated,"optionalAccess",e=>e.x])||0,o=$n([e,"access",e=>e.rect,"access",e=>e.current,"access",e=>e.translated,"optionalAccess",e=>e.y])||0;(r<n.left||r>n.right||o<n.top||o>n.bottom)&&t.onRemove&&"function"==typeof t.onRemove&&t.onRemove(t)}}if(!e||!t)return void this.setState({activeDragItem:null});const n=e.data.current,r=t.data.current;r&&"function"==typeof r.onDrop?r.onDrop(n,r):(n&&"function"==typeof n.onDrop&&n.onDrop(n,r),this.setState({activeDragItem:null}))},onDragStart:e=>{const{active:t}=e;$n([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current])&&this.setState({activeDragItem:t.data.current})}},Nn.createElement(Fn.ConfigLayout,{extraCSSRules:I,dimensions:l,hideSettings:f,settings:Nn.createElement(Qn,{model:e,configuration:t,onChangeModel:e=>this.onModelChange(e),onChangeConfiguration:e=>n(e,!0),groups:{Settings:q,Properties:F}})},k&&Nn.createElement(Zn,{label:p.label},Nn.createElement(Hn,{markup:e.teacherInstructions||"",onChange:this.onTeacherInstructionsChanged,imageSupport:r,nonEmpty:!1,error:B,toolbarOpts:H,pluginProps:U($n([p,"optionalAccess",e=>e.inputConfiguration])),spellCheck:M,maxImageWidth:y&&y.teacherInstructions||Y,maxImageHeight:C&&C.teacherInstructions||W,uploadSoundSupport:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:x}),B&&Nn.createElement(rr,null,B)),R&&Nn.createElement(Zn,{label:c.label},Nn.createElement(Hn,{markup:e.prompt,onChange:this.onPromptChanged,imageSupport:r,nonEmpty:!1,disableUnderline:!0,error:N,toolbarOpts:H,pluginProps:U($n([c,"optionalAccess",e=>e.inputConfiguration])),spellCheck:M,maxImageWidth:Y,maxImageHeight:W,uploadSoundSupport:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:x}),N&&Nn.createElement(rr,null,N)),Nn.createElement(or,null,Nn.createElement(tr,{component:"div"},"Define Template, Choices, and Correct Responses"),Nn.createElement(nr,{disableFocusListener:!0,disableTouchListener:!0,placement:"right",title:z},Nn.createElement(Wn,{fontSize:"small",color:"primary",style:{marginLeft:"5px"}}))),Nn.createElement(er,{ref:this.markupRef},Nn.createElement(Hn,{activePlugins:qn,responseAreaProps:{type:"drag-in-the-blank",options:{duplicates:e.duplicates},maxResponseAreas:b},pluginProps:U(),markup:e.slateMarkup,onChange:this.onMarkupChanged,imageSupport:r,disableImageAlignmentButtons:!0,nonEmpty:!1,disableUnderline:!0,error:j||P,toolbarOpts:H,spellCheck:M,uploadSoundSupport:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:x})),j&&Nn.createElement(rr,null,j),P&&Nn.createElement(rr,null,P),Nn.createElement(Pn,{model:e,imageSupport:r,duplicates:e.duplicates,error:O,onChange:this.onResponsesChanged,toolbarOpts:H,maxChoices:v,uploadSoundSupport:o,mathMlOptions:x,pluginProps:U($n([i,"optionalAccess",e=>e.inputConfiguration])),maxImageWidth:y&&y.choice||Y,maxImageHeight:C&&C.choice||W,maxLength:S}),D&&Nn.createElement(Zn,{label:h.label},Nn.createElement(Hn,{markup:e.rationale||"",onChange:this.onRationaleChanged,imageSupport:r,error:L,toolbarOpts:H,pluginProps:U($n([h,"optionalAccess",e=>e.inputConfiguration])),spellCheck:M,maxImageWidth:y&&y.rationale||Y,maxImageHeight:C&&C.rationale||W,uploadSoundSupport:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:x}),L&&Nn.createElement(rr,null,L))),Nn.createElement(on,null,Nn.createElement(Vn,null,(()=>{const{activeDragItem:e}=this.state,{model:t}=this.props;if(!e)return null;if(("drag-in-the-blank-choice"===e.type||"drag-in-the-blank-placed-choice"===e.type)&&e.value){const n=$n([t,"access",e=>e.choices,"optionalAccess",e=>e.find,"call",t=>t(t=>t.id===e.value.id)]);return n?Nn.createElement(En,{choice:n}):null}})())))}}ir.__initStatic();var ar={choices:[],choicesPosition:"below",correctResponse:{},disabled:!1,duplicates:!0,markup:"",mode:"gather",prompt:"",promptEnabled:!0,rationale:"",rationaleEnabled:!0,studentInstructionsEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0,toolbarEditorPosition:"bottom"},lr={baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!0},blockquote:{disabled:!0},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},choicesPosition:{settings:!0,label:"Choices Position"},prompt:{settings:!0,label:"Prompt",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},addChoice:{inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!1}}},duplicates:{settings:!0,label:"Duplicates"},lockChoiceOrder:{settings:!0,label:"Lock Choice Order"},partialScoring:{settings:!1,label:"Allow Partial Scoring"},rationale:{settings:!0,label:"Rationale",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},settingsPanelDisabled:!1,teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},minChoices:2,maxResponseAreas:10,maxImageWidth:{teacherInstructions:300,prompt:300,rationale:300,choice:300},maxImageHeight:{teacherInstructions:300,prompt:300,rationale:300,choice:300},withRubric:{settings:!1,label:"Add Rubric"},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]},maxLength:200};const sr=t,cr=s,{defaults:dr}=n,{renderMath:ur}=c;function hr(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const pr=cr("multiple-choice:configure");class gr extends HTMLElement{static __initStatic(){this.prepareModel=(e={})=>{const t={...ar,...e},n=e.slateMarkup||pn(t.markup,t.choices,t.correctResponse),r=(e=>{const t=un(e),n=ln(t),r=[];let o=0;return n.querySelectorAll('[data-type="drag_in_the_blank"]').forEach(e=>{let t=e.dataset.value&&e.dataset.value.replace(/&nbsp;/g," ").trim();t||(t=""),r.push({value:t,id:e.dataset.id}),e.replaceWith(`{{${o++}}}`)}),{markup:n.innerHTML,choices:r,correctResponse:r.reduce((e,t,n)=>(e[n]=void 0!==t.id&&t.id||"",e),{})}})(n);return{...t,slateMarkup:n,markup:r.markup,correctResponse:r.correctResponse}}}constructor(){super(),this._root=null,this._model=gr.prepareModel(),this._configuration=lr,this.onModelChanged=this.onModelChanged.bind(this),this.onConfigurationChanged=this.onConfigurationChanged.bind(this)}set model(e){const t={...e,markup:`<div>${e.markup||ar.markup}</div>`};this._model=gr.prepareModel(t),this._render()}set configuration(e){const t=dr(e,lr);this._configuration=t,hr([t,"optionalAccess",e=>e.language,"optionalAccess",e=>e.enabled])?hr([t,"optionalAccess",e=>e.languageChoices,"optionalAccess",e=>e.options,"optionalAccess",e=>e.length])&&(this._model.language=hr([t,"optionalAccess",e=>e.languageChoices,"access",e=>e.options,"access",e=>e[0],"access",e=>e.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({value:this._model.language,label:this._model.language})):delete this._model.language,this._render()}set disableSidePanel(e){this._disableSidePanel=e,this._render()}dispatchModelUpdated(e){const t=!!e;this.dispatchEvent(new m(this._model,t))}onModelChanged(e,t){this._model=gr.prepareModel(e),this._render(),this.dispatchModelUpdated(t)}onConfigurationChanged(e){this._configuration=e,this._render()}insertImage(e){this.dispatchEvent(new y(e))}onDeleteImage(e,t){this.dispatchEvent(new v(e,t))}insertSound(e){this.dispatchEvent(new _(e))}onDeleteSound(e,t){this.dispatchEvent(new w(e,t))}_render(){pr("_render");let e=sr.createElement(ir,{model:this._model,configuration:this._configuration,onModelChanged:this.onModelChanged,onConfigurationChanged:this.onConfigurationChanged,disableSidePanel:this._disableSidePanel,imageSupport:{add:this.insertImage.bind(this),delete:this.onDeleteImage.bind(this)},uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});this._root||(this._root=E(this)),this._root.render(e),setTimeout(()=>{ur(this)},0)}disconnectedCallback(){this._root&&this._root.unmount()}}gr.__initStatic();export{gr as default};