{"version":3,"file":"script.min.js","sources":["https:\/\/www.virtual.facen.una.py\/gradofacen\/local\/accessibility\/widgets\/letterspacing\/amd\/src\/script.js"],"sourcesContent":["\/\/ This file is part of Moodle - https:\/\/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\n\/**\n * Letter spacing widget JS\n *\n * @module accessibility\/letterspacing\n * @copyright 2025 Ponlawat Weerapanpisit \n * @license https:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n *\/\n\nimport $ from 'jquery';\nimport { initrangewidget } from 'local_accessibility\/rangewidget';\nimport { saveWidgetConfig } from 'local_accessibility\/common';\n\n\/**\n * Initialisation\n * @param {number|undefined|null} userdefault\n *\/\nexport const init = (userdefault = undefined) => {\n const classnames = [\n 'accessibility-letterspacing--10',\n 'accessibility-letterspacing-10',\n 'accessibility-letterspacing-20',\n 'accessibility-letterspacing-30',\n 'accessibility-letterspacing-40',\n 'accessibility-letterspacing-50'\n ];\n\n $(() => {\n const $body = $('body');\n\n initrangewidget('accessibility_letterspacing', async(size) => {\n $body.removeClass(classnames);\n if (parseFloat(size) === 0) {\n await saveWidgetConfig('letterspacing', null);\n return;\n }\n const classname = 'accessibility-letterspacing-' + Math.round(parseFloat(size) * 100).toString();\n if (classnames.indexOf(classname) < 0) {\n return;\n }\n $body.addClass(classname);\n await saveWidgetConfig('letterspacing', size);\n }, userdefault);\n });\n};\n"],"names":["userdefault","undefined","classnames","$body","async","removeClass","parseFloat","size","classname","Math","round","toString","indexOf","addClass"],"mappings":";;;;;;;wJA+BoB,eAACA,wEAAcC,QACzBC,WAAa,CACf,kCACA,iCACA,iCACA,iCACA,iCACA,uDAGF,WACQC,OAAQ,mBAAE,yCAEA,+BAA+BC,MAAAA,UAC3CD,MAAME,YAAYH,YACO,IAArBI,WAAWC,wBACL,4BAAiB,gBAAiB,YAGtCC,UAAY,+BAAiCC,KAAKC,MAAyB,IAAnBJ,WAAWC,OAAaI,WAClFT,WAAWU,QAAQJ,WAAa,IAGpCL,MAAMU,SAASL,iBACT,4BAAiB,gBAAiBD,SACzCP"}