{"version":3,"file":"mutations.min.js","sources":["https:\/\/dl1.cuni.cz\/course\/format\/flexsections\/amd\/src\/local\/courseeditor\/mutations.js"],"sourcesContent":["\/\/ This file is part of Moodle - http:\/\/moodle.org\/\n\/\/\n\/\/ Moodle is free software: you can redistribute it and\/or modify\n\/\/ it under the terms of the GNU General Public License as published by\n\/\/ the Free Software Foundation, either version 3 of the License, or\n\/\/ (at your option) any later version.\n\/\/\n\/\/ Moodle is distributed in the hope that it will be useful,\n\/\/ but WITHOUT ANY WARRANTY; without even the implied warranty of\n\/\/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\/\/ GNU General Public License for more details.\n\/\/\n\/\/ You should have received a copy of the GNU General Public License\n\/\/ along with Moodle. If not, see .\n\nimport Mutations from 'core_courseformat\/local\/courseeditor\/mutations';\n\n\/**\n * Mutations\n *\n * @module format_flexsections\/local\/courseeditor\/mutations\n * @copyright 2022 Marina Glancy\n * @license http:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n *\/\nexport default class extends Mutations {\n \/\/ Extends: course\/format\/amd\/src\/local\/courseeditor\/mutations.js\n\n \/**\n * Merge section with its parent.\n *\n * @param {StateManager} stateManager the current state manager\n * @param {number} sectionId\n *\/\n async sectionMergeUp(stateManager, sectionId) {\n this.sectionLock(stateManager, [sectionId], true);\n const course = stateManager.get('course');\n const updates = await this._callEditWebservice('section_mergeup', course.id, [], sectionId);\n stateManager.processUpdates(updates);\n this.sectionLock(stateManager, [sectionId], false);\n }\n\n \/**\n * Add a new subsection to a specific section.\n *\n * @param {StateManager} stateManager the current state manager\n * @param {number} parentSectionId\n *\/\n async addSubSection(stateManager, parentSectionId) {\n const course = stateManager.get('course');\n const updates = await this._callEditWebservice('section_add_subsection', course.id, [], parentSectionId);\n stateManager.processUpdates(updates);\n }\n\n \/**\n * Add a new section to a specific course location.\n *\n * @param {StateManager} stateManager the current state manager\n * @param {number} parentSectionId optional the target section id\n *\/\n async insertSubSection(stateManager, parentSectionId) {\n const course = stateManager.get('course');\n const updates = await this._callEditWebservice('section_insert_subsection', course.id, [], parentSectionId);\n stateManager.processUpdates(updates);\n }\n\n \/**\n * Switch between section being displayed on a separate page vs on the same page\n *\n * @param {StateManager} stateManager the current state manager\n * @param {number} sectionId\n *\/\n async sectionSwitchCollapsed(stateManager, sectionId) {\n const course = stateManager.get('course');\n const updates = await this._callEditWebservice('section_switch_collapsed', course.id, [sectionId]);\n stateManager.processUpdates(updates);\n }\n}"],"names":["Mutations","stateManager","sectionId","sectionLock","course","get","updates","this","_callEditWebservice","id","processUpdates","parentSectionId"],"mappings":";;;;;;;0KAwB6BA,wCASJC,aAAcC,gBAC1BC,YAAYF,aAAc,CAACC,YAAY,SACtCE,OAASH,aAAaI,IAAI,UAC1BC,cAAgBC,KAAKC,oBAAoB,kBAAmBJ,OAAOK,GAAI,GAAIP,WACjFD,aAAaS,eAAeJ,cACvBH,YAAYF,aAAc,CAACC,YAAY,uBAS5BD,aAAcU,uBACxBP,OAASH,aAAaI,IAAI,UAC1BC,cAAgBC,KAAKC,oBAAoB,yBAA0BJ,OAAOK,GAAI,GAAIE,iBACxFV,aAAaS,eAAeJ,gCASTL,aAAcU,uBAC3BP,OAASH,aAAaI,IAAI,UAC1BC,cAAgBC,KAAKC,oBAAoB,4BAA6BJ,OAAOK,GAAI,GAAIE,iBAC3FV,aAAaS,eAAeJ,sCASHL,aAAcC,iBACjCE,OAASH,aAAaI,IAAI,UAC1BC,cAAgBC,KAAKC,oBAAoB,2BAA4BJ,OAAOK,GAAI,CAACP,YACvFD,aAAaS,eAAeJ"}