{"code":"(window.webpackJsonpGUI=window.webpackJsonpGUI||[]).push([[28],{1562:function(e,n,t){\"use strict\";t.r(n),t.d(n,\"resources\",(function(){return o}));const o={\"userscript.js\":async function(e){let{addon:n,console:t}=e;const o=await n.tab.traps.getBlockly(),s=()=>{const e=Blockly.getMainWorkspace(),n=e.options.pathToMedia;o.inject.loadSounds_(n,e)};s();const a=o.init_;o.init_=function(){for(var e=arguments.length,n=new Array(e),t=0;t{const e=Blockly.getMainWorkspace().getAudioManager();delete e.SOUNDS_.click,delete e.SOUNDS_.delete})),n.self.addEventListener(\"reenabled\",s)}}}}]);","name":"js/pentapod/addon-entry-editor-sounds.86de82d3d30dfe524589.js","input":"(window[\"webpackJsonpGUI\"] = window[\"webpackJsonpGUI\"] || []).push([[28],{\n\n/***/ 1562:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, \"resources\", function() { return /* binding */ resources; });\n\n// CONCATENATED MODULE: ./src/addons/addons/editor-sounds/userscript.js\n/* harmony default export */ var userscript = (async function (_ref) {\n let {\n addon,\n console\n } = _ref;\n const ScratchBlocks = await addon.tab.traps.getBlockly();\n const injectCurrent = () => {\n const workspace = Blockly.getMainWorkspace();\n const pathToMedia = workspace.options.pathToMedia;\n ScratchBlocks.inject.loadSounds_(pathToMedia, workspace);\n };\n\n // Add sounds to the current workspace\n injectCurrent();\n\n // Add sounds to all future workspaces\n const originalInit = ScratchBlocks.init_;\n ScratchBlocks.init_ = function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n const wksp = args[0];\n wksp.options.hasSounds = true;\n return originalInit.call(this, ...args);\n };\n addon.self.addEventListener(\"disabled\", () => {\n const workspace = Blockly.getMainWorkspace();\n const audio = workspace.getAudioManager();\n delete audio.SOUNDS_.click;\n delete audio.SOUNDS_.delete;\n });\n addon.self.addEventListener(\"reenabled\", injectCurrent);\n});\n// CONCATENATED MODULE: ./src/addons/addons/editor-sounds/_runtime_entry.js\n/* generated by pull.js */\n\nconst resources = {\n \"userscript.js\": userscript\n};\n\n/***/ })\n\n}]);","inputSourceMap":null}