{"code":"(window.webpackJsonpGUI=window.webpackJsonpGUI||[]).push([[37],{1449:function(e,t,o){(e.exports=o(9)(!1)).push([e.i,'[class*=\"gui_tabs_\"] {\\n /* overridden by other addons */\\n --sa-category-width: 60px;\\n --sa-flyout-width: 250px;\\n}\\n\\n/* The default left-side border does not work properly when a block is being dragged, */\\n/* which lets a 1 pixel column of the flyout be visible. */\\n/* To fix this we use two elements that are only visible when a block is being dragged. */\\n/* The first element is opaque to cover up the contents with the background color. */\\n/* The other element is the transparent border color. */\\n.sa-flyout-border-1,\\n.sa-flyout-border-2 {\\n position: absolute;\\n /* Above flyout but below add extension button */\\n z-index: 40;\\n top: 0;\\n bottom: 8px;\\n left: -1px;\\n}\\n[dir=\"rtl\"] .sa-flyout-border-1,\\n[dir=\"rtl\"] .sa-flyout-border-2 {\\n left: auto;\\n right: -1px;\\n}\\n.sa-flyout-border-1 {\\n border-left: 1px solid var(--editorDarkMode-page, hsla(215, 100%, 95%, 1));\\n}\\n.sa-flyout-border-2 {\\n border-left: 1px solid var(--editorDarkMode-border, rgba(0, 0, 0, 0.15));\\n}\\n\\n.blocklyFlyout,\\n.blocklyFlyoutScrollbar {\\n transition-property: margin;\\n}\\n\\n[dir=\"ltr\"] .blocklyFlyout.sa-flyoutClose,\\n[dir=\"ltr\"] .blocklyFlyoutScrollbar.sa-flyoutClose {\\n margin-left: calc(0px - var(--sa-flyout-width) - 10px);\\n}\\n\\n[dir=\"rtl\"] .blocklyFlyout.sa-flyoutClose,\\n[dir=\"rtl\"] .blocklyFlyoutScrollbar.sa-flyoutClose {\\n margin-left: calc(var(--sa-flyout-width) + 10px);\\n}\\n\\n.sa-flyout-placeHolder {\\n display: var(--hideFlyout-placeholderDisplay) !important;\\n position: absolute;\\n height: 100%;\\n width: calc(var(--sa-flyout-width) + 1px);\\n top: 0;\\n}\\n\\n[dir=\"ltr\"] .sa-flyout-placeHolder {\\n left: calc(var(--sa-category-width) + 1px);\\n}\\n\\n[dir=\"rtl\"] .sa-flyout-placeHolder {\\n right: calc(var(--sa-category-width) + 1px);\\n}\\n\\n.sa-lock-object {\\n display: var(--hideFlyout-lockDisplay) !important;\\n transform: translate(calc(var(--sa-flyout-width) - 15px - 32px), 3px);\\n width: 32px;\\n height: 32px;\\n}\\n[dir=\"rtl\"] .sa-lock-object {\\n transform: translate(15px, 3px);\\n}\\n\\n.sa-lock-button {\\n display: flex;\\n cursor: pointer;\\n width: 100%;\\n height: 100%;\\n padding: 0;\\n justify-content: center;\\n align-items: center;\\n background-color: var(--editorDarkMode-accent, white);\\n border: 1px solid var(--editorDarkMode-border, rgba(0, 0, 0, 0.15));\\n border-radius: 4px;\\n}\\n\\n.sa-lock-object.locked .sa-lock-button {\\n background-color: var(--editorDarkMode-primary, #855cd6);\\n border-color: var(--editorDarkMode-primary-variant, #714eb6);\\n}\\n\\n.sa-lock-button img {\\n width: 20px;\\n user-select: none;\\n filter: var(--editorDarkMode-accent-filter, none);\\n}\\n\\n.sa-lock-object.locked img {\\n filter: var(--editorDarkMode-primary-filter, none);\\n}\\n\\n.sa-hide-flyout-not-fullscreen .sa-body-editor [class*=\"gui_stage-and-target-wrapper\"] {\\n position: relative;\\n /* We need to be above these to hide the flyout while dragging blocks: */\\n /* .blocklyFlyout (z-index: 20) */\\n /* .blocklyFlyoutScrollbar (z-index: 30) */\\n /* and above these so that dragged sprites aren\\'t obscured: */\\n /* .blocklyToolboxDiv (z-index: 40) */\\n /* .gui_extension-button-container_b4rCs (z-index: 42) */\\n z-index: 43;\\n padding-inline: 0.5rem;\\n background-color: var(--editorDarkMode-page, hsl(215, 100%, 95%));\\n}\\n\\n[class*=\"gui_stage-and-target-wrapper_\"] {\\n padding: 0;\\n}\\n\\n/* https://github.com/ScratchAddons/ScratchAddons/issues/4896 */\\n.Popover {\\n /* Above stage wrapper and target pane */\\n /* See editor-stage-left */\\n z-index: 51;\\n}\\n',\"\"])},1529:function(e,t,o){\"use strict\";o.r(t),o.d(t,\"resources\",(function(){return l}));var n=o(1449);const l={\"userscript.js\":async function(e){let{addon:t,console:o,msg:n}=e,l=null,a=null,s=null,r=null,c=null,i=null,d=!1,u=!1,g=!1,y=!0;const b=await t.tab.traps.getBlockly();function p(){return{none:\"0\",short:\"0.2\",default:\"0.3\",long:\"0.5\"}[t.settings.get(\"speed\")]}function M(){return t.settings.get(\"toggle\")}function m(e){for(let t of[c,i])t.style.transitionDuration=\"\".concat(e,\"s\")}function h(){for(let e of[c,i])e.style.removeProperty(\"transition-duration\")}function A(){a.classList.toggle(\"locked\",u),s.title=n(u?\"unlock\":\"lock\"),r.src=t.self.getResource(\"/\".concat(u?\"\":\"un\",\"lock.svg\"))}function f(){const e=t.settings.get(\"lockLoad\");e&&(\"category\"===M()?d=!0:(u=e,A()),c.classList.remove(\"sa-flyoutClose\"),i.classList.remove(\"sa-flyoutClose\"))}function I(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e&&0!==e.buttons&&!document.querySelector(\".blocklyToolboxDiv\").className.includes(\"blocklyToolboxDelete\")||(o=\"object\"==typeof o?p():o,m(o),c.classList.remove(\"sa-flyoutClose\"),i.classList.remove(\"sa-flyoutClose\"),setTimeout((()=>{var e;null===(e=t.tab.traps.getWorkspace())||void 0===e||e.recordCachedAreas(),h()}),1e3*o)),g=!1}function x(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p();u||(e&&e.buttons?g=!0:(m(o),c.classList.add(\"sa-flyoutClose\"),i.classList.add(\"sa-flyoutClose\"),setTimeout((()=>{var e;null===(e=t.tab.traps.getWorkspace())||void 0===e||e.recordCachedAreas(),h()}),1e3*o)))}const v=()=>{const e=t.tab.redux.state.scratchGui.mode.isFullScreen;document.documentElement.classList.toggle(\"sa-hide-flyout-not-fullscreen\",!e)};v();let D=!1;function k(){if(D)return;D=!0,t.tab.redux.initialize(),t.tab.redux.addEventListener(\"statechanged\",(e=>{switch(e.detail.action.type){case\"scratch-gui/navigation/ACTIVATE_TAB\":{const o=M();0!==e.detail.action.activeTabIndex||t.self.disabled||\"hover\"!==o&&\"cathover\"!==o||(x(null,0),d=!1);break}case\"scratch-gui/mode/SET_FULL_SCREEN\":v()}})),document.body.addEventListener(\"mouseup\",(()=>{g&&(x(),g=!1)})),t.self.enabledLate&&\"category\"===M()&&!t.settings.get(\"lockLoad\")&&b.getMainWorkspace().getToolbox().selectedItem_.setSelected(!1),t.self.addEventListener(\"disabled\",(()=>{b.getMainWorkspace().getToolbox().selectedItem_.setSelected(!0)})),t.self.addEventListener(\"reenabled\",(()=>{\"category\"!==M()||t.settings.get(\"lockLoad\")||(b.getMainWorkspace().getToolbox().selectedItem_.setSelected(!1),x(null,0),d=!1)})),t.settings.addEventListener(\"change\",(()=>{t.self.disabled||(\"category\"===M()?u?(d=!0,u=!1,A()):(b.getMainWorkspace().getToolbox().selectedItem_.setSelected(!1),x(null,0),d=!1):(t.settings.get(\"lockLoad\")?(u=!0,A()):x(),b.getMainWorkspace().getToolbox().selectedItem_.setSelected(!0)))}));const e=b.Toolbox.prototype.setSelectedItem;b.Toolbox.prototype.setSelectedItem=function(o){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const l=this.selectedItem_;e.call(this,o,n),t.self.disabled||\"category\"!==M()||(n||d?o===l?(d=!d,d?I():(x(),o.setSelected(!1))):d||(y=!1,d=!0,I()):o.setSelected(!1))};const o=b.Toolbox.prototype.selectCategoryById;b.Toolbox.prototype.selectCategoryById=function(){if(t.self.disabled||\"category\"!==M()||d){for(var e=arguments.length,n=new Array(e),l=0;l!e.scratchGui.mode.isPlayerOnly}),i=document.querySelector(\".blocklyFlyoutScrollbar\");const e=document.querySelector('[class*=\"gui_blocks-wrapper_\"]'),o=document.querySelector(\".injectionDiv\"),n=document.createElement(\"div\");n.className=\"sa-flyout-border-1\",t.tab.displayNoneWhileDisabled(n),o.appendChild(n);const g=document.createElement(\"div\");g.className=\"sa-flyout-border-2\",t.tab.displayNoneWhileDisabled(g),o.appendChild(g),l&&l.remove(),l=document.createElement(\"div\"),e.appendChild(l),l.className=\"sa-flyout-placeHolder\",l.style.display=\"none\",a&&a.remove(),a=document.createElementNS(\"http://www.w3.org/2000/svg\",\"foreignObject\"),a.setAttribute(\"class\",\"sa-lock-object\"),a.style.display=\"none\",s=document.createElement(\"button\"),s.className=\"sa-lock-button\",r=document.createElement(\"img\"),r.alt=\"\",A(),s.onclick=()=>{u=!u,A()},s.appendChild(r),a.appendChild(s),c.appendChild(a),x(null,0),d=!1;const y=document.querySelector(\".blocklyToolboxDiv\"),p=document.querySelector(\"[class^=gui_extension-button-container_]\");for(let e of[y,p,c,i])e.onmouseenter=e=>{const o=M();t.self.disabled||\"hover\"!==o&&\"cathover\"!==o||I(e)},e.onmouseleave=e=>{const o=M();t.self.disabled||\"hover\"!==o&&\"cathover\"!==o||x(e)};l.onmouseenter=e=>{t.self.disabled||\"hover\"!==M()||I(e)},l.onmouseleave=e=>{t.self.disabled||\"hover\"!==M()||x(e)},k(),f(),b.svgResize(b.getMainWorkspace())}},\"style.css\":o.n(n).a,\"lock.svg\":\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGFyaWEtaGlkZGVuPSJ0cnVlIiB3aWR0aD0iMWVtIiBoZWlnaHQ9IjFlbSIgc3R5bGU9Ii1tcy10cmFuc2Zvcm06cm90YXRlKDM2MGRlZyk7LXdlYmtpdC10cmFuc2Zvcm06cm90YXRlKDM2MGRlZyk7dHJhbnNmb3JtOnJvdGF0ZSgzNjBkZWcpIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiAxM2ExIDEgMCAwIDAtMSAxdjNhMSAxIDAgMCAwIDIgMHYtM2ExIDEgMCAwIDAtMS0xem01LTRWN0E1IDUgMCAwIDAgNyA3djJhMyAzIDAgMCAwLTMgM3Y3YTMgMyAwIDAgMCAzIDNoMTBhMyAzIDAgMCAwIDMtM3YtN2EzIDMgMCAwIDAtMy0zek05IDdhMyAzIDAgMCAxIDYgMHYySDl6bTkgMTJhMSAxIDAgMCAxLTEgMUg3YTEgMSAwIDAgMS0xLTF2LTdhMSAxIDAgMCAxIDEtMWgxMGExIDEgMCAwIDEgMSAxeiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==\",\"unlock.svg\":\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGFyaWEtaGlkZGVuPSJ0cnVlIiB3aWR0aD0iMWVtIiBoZWlnaHQ9IjFlbSIgc3R5bGU9Ii1tcy10cmFuc2Zvcm06cm90YXRlKDM2MGRlZyk7LXdlYmtpdC10cmFuc2Zvcm06cm90YXRlKDM2MGRlZyk7dHJhbnNmb3JtOnJvdGF0ZSgzNjBkZWcpIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiAxM2ExLjQ5IDEuNDkgMCAwIDAtMSAyLjYxVjE3YTEgMSAwIDAgMCAyIDB2LTEuMzlBMS40OSAxLjQ5IDAgMCAwIDEyIDEzem01LTRIOVY3YTMgMyAwIDAgMSA1LjEyLTIuMTMgMy4wOCAzLjA4IDAgMCAxIC43OCAxLjM4IDEgMSAwIDEgMCAxLjk0LS41IDUuMDkgNS4wOSAwIDAgMC0xLjMxLTIuMjlBNSA1IDAgMCAwIDcgN3YyYTMgMyAwIDAgMC0zIDN2N2EzIDMgMCAwIDAgMyAzaDEwYTMgMyAwIDAgMCAzLTN2LTdhMyAzIDAgMCAwLTMtM3ptMSAxMGExIDEgMCAwIDEtMSAxSDdhMSAxIDAgMCAxLTEtMXYtN2ExIDEgMCAwIDEgMS0xaDEwYTEgMSAwIDAgMSAxIDF6IiBmaWxsPSIjNTc1ZTc1Ii8+PC9zdmc+\"}}}]);","name":"js/pentapod/addon-entry-hide-flyout.8165615dfdba03f82d80.js","input":"(window[\"webpackJsonpGUI\"] = window[\"webpackJsonpGUI\"] || []).push([[37],{\n\n/***/ 1449:\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(9)(false);\n// imports\n\n\n// module\nexports.push([module.i, \"[class*=\\\"gui_tabs_\\\"] {\\n /* overridden by other addons */\\n --sa-category-width: 60px;\\n --sa-flyout-width: 250px;\\n}\\n\\n/* The default left-side border does not work properly when a block is being dragged, */\\n/* which lets a 1 pixel column of the flyout be visible. */\\n/* To fix this we use two elements that are only visible when a block is being dragged. */\\n/* The first element is opaque to cover up the contents with the background color. */\\n/* The other element is the transparent border color. */\\n.sa-flyout-border-1,\\n.sa-flyout-border-2 {\\n position: absolute;\\n /* Above flyout but below add extension button */\\n z-index: 40;\\n top: 0;\\n bottom: 8px;\\n left: -1px;\\n}\\n[dir=\\\"rtl\\\"] .sa-flyout-border-1,\\n[dir=\\\"rtl\\\"] .sa-flyout-border-2 {\\n left: auto;\\n right: -1px;\\n}\\n.sa-flyout-border-1 {\\n border-left: 1px solid var(--editorDarkMode-page, hsla(215, 100%, 95%, 1));\\n}\\n.sa-flyout-border-2 {\\n border-left: 1px solid var(--editorDarkMode-border, rgba(0, 0, 0, 0.15));\\n}\\n\\n.blocklyFlyout,\\n.blocklyFlyoutScrollbar {\\n transition-property: margin;\\n}\\n\\n[dir=\\\"ltr\\\"] .blocklyFlyout.sa-flyoutClose,\\n[dir=\\\"ltr\\\"] .blocklyFlyoutScrollbar.sa-flyoutClose {\\n margin-left: calc(0px - var(--sa-flyout-width) - 10px);\\n}\\n\\n[dir=\\\"rtl\\\"] .blocklyFlyout.sa-flyoutClose,\\n[dir=\\\"rtl\\\"] .blocklyFlyoutScrollbar.sa-flyoutClose {\\n margin-left: calc(var(--sa-flyout-width) + 10px);\\n}\\n\\n.sa-flyout-placeHolder {\\n display: var(--hideFlyout-placeholderDisplay) !important;\\n position: absolute;\\n height: 100%;\\n width: calc(var(--sa-flyout-width) + 1px);\\n top: 0;\\n}\\n\\n[dir=\\\"ltr\\\"] .sa-flyout-placeHolder {\\n left: calc(var(--sa-category-width) + 1px);\\n}\\n\\n[dir=\\\"rtl\\\"] .sa-flyout-placeHolder {\\n right: calc(var(--sa-category-width) + 1px);\\n}\\n\\n.sa-lock-object {\\n display: var(--hideFlyout-lockDisplay) !important;\\n transform: translate(calc(var(--sa-flyout-width) - 15px - 32px), 3px);\\n width: 32px;\\n height: 32px;\\n}\\n[dir=\\\"rtl\\\"] .sa-lock-object {\\n transform: translate(15px, 3px);\\n}\\n\\n.sa-lock-button {\\n display: flex;\\n cursor: pointer;\\n width: 100%;\\n height: 100%;\\n padding: 0;\\n justify-content: center;\\n align-items: center;\\n background-color: var(--editorDarkMode-accent, white);\\n border: 1px solid var(--editorDarkMode-border, rgba(0, 0, 0, 0.15));\\n border-radius: 4px;\\n}\\n\\n.sa-lock-object.locked .sa-lock-button {\\n background-color: var(--editorDarkMode-primary, #855cd6);\\n border-color: var(--editorDarkMode-primary-variant, #714eb6);\\n}\\n\\n.sa-lock-button img {\\n width: 20px;\\n user-select: none;\\n filter: var(--editorDarkMode-accent-filter, none);\\n}\\n\\n.sa-lock-object.locked img {\\n filter: var(--editorDarkMode-primary-filter, none);\\n}\\n\\n.sa-hide-flyout-not-fullscreen .sa-body-editor [class*=\\\"gui_stage-and-target-wrapper\\\"] {\\n position: relative;\\n /* We need to be above these to hide the flyout while dragging blocks: */\\n /* .blocklyFlyout (z-index: 20) */\\n /* .blocklyFlyoutScrollbar (z-index: 30) */\\n /* and above these so that dragged sprites aren't obscured: */\\n /* .blocklyToolboxDiv (z-index: 40) */\\n /* .gui_extension-button-container_b4rCs (z-index: 42) */\\n z-index: 43;\\n padding-inline: 0.5rem;\\n background-color: var(--editorDarkMode-page, hsl(215, 100%, 95%));\\n}\\n\\n[class*=\\\"gui_stage-and-target-wrapper_\\\"] {\\n padding: 0;\\n}\\n\\n/* https://github.com/ScratchAddons/ScratchAddons/issues/4896 */\\n.Popover {\\n /* Above stage wrapper and target pane */\\n /* See editor-stage-left */\\n z-index: 51;\\n}\\n\", \"\"]);\n\n// exports\n\n\n/***/ }),\n\n/***/ 1529:\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/hide-flyout/userscript.js\n/* harmony default export */ var userscript = (async function (_ref) {\n let {\n addon,\n console,\n msg\n } = _ref;\n let placeHolderDiv = null;\n let lockObject = null;\n let lockButton = null;\n let lockIcon = null;\n let flyOut = null;\n let scrollBar = null;\n let toggle = false;\n let flyoutLock = false;\n let closeOnMouseUp = false;\n let scrollAnimation = true;\n const SVG_NS = \"http://www.w3.org/2000/svg\";\n const Blockly = await addon.tab.traps.getBlockly();\n function getSpeedValue() {\n let data = {\n none: \"0\",\n short: \"0.2\",\n default: \"0.3\",\n long: \"0.5\"\n };\n return data[addon.settings.get(\"speed\")];\n }\n function getToggleSetting() {\n return addon.settings.get(\"toggle\");\n }\n function setTransition(speed) {\n for (let element of [flyOut, scrollBar]) {\n element.style.transitionDuration = \"\".concat(speed, \"s\");\n }\n }\n function removeTransition() {\n for (let element of [flyOut, scrollBar]) {\n element.style.removeProperty(\"transition-duration\");\n }\n }\n function updateLockDisplay() {\n lockObject.classList.toggle(\"locked\", flyoutLock);\n lockButton.title = flyoutLock ? msg(\"unlock\") : msg(\"lock\");\n lockIcon.src = addon.self.getResource(\"/\".concat(flyoutLock ? \"\" : \"un\", \"lock.svg\")) /* rewritten by pull.js */;\n }\n function autoLock() {\n const option = addon.settings.get(\"lockLoad\");\n if (option) {\n if (getToggleSetting() === \"category\") {\n toggle = true;\n } else {\n flyoutLock = option;\n updateLockDisplay();\n }\n flyOut.classList.remove(\"sa-flyoutClose\");\n scrollBar.classList.remove(\"sa-flyoutClose\");\n }\n }\n function onmouseenter(e) {\n let speed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n // If a mouse event was passed, only open flyout if the workspace isn't being dragged\n if (!e || e.buttons === 0 || document.querySelector(\".blocklyToolboxDiv\").className.includes(\"blocklyToolboxDelete\")) {\n speed = typeof speed === \"object\" ? getSpeedValue() : speed;\n setTransition(speed);\n flyOut.classList.remove(\"sa-flyoutClose\");\n scrollBar.classList.remove(\"sa-flyoutClose\");\n setTimeout(() => {\n var _addon$tab$traps$getW;\n (_addon$tab$traps$getW = addon.tab.traps.getWorkspace()) === null || _addon$tab$traps$getW === void 0 ? void 0 : _addon$tab$traps$getW.recordCachedAreas();\n removeTransition();\n }, speed * 1000);\n }\n closeOnMouseUp = false; // only close if the mouseup event happens outside the flyout\n }\n function onmouseleave(e) {\n let speed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getSpeedValue();\n if (flyoutLock) return;\n if (e && e.buttons) {\n // dragging a block or scrollbar\n closeOnMouseUp = true;\n return;\n }\n setTransition(speed);\n flyOut.classList.add(\"sa-flyoutClose\");\n scrollBar.classList.add(\"sa-flyoutClose\");\n setTimeout(() => {\n var _addon$tab$traps$getW2;\n (_addon$tab$traps$getW2 = addon.tab.traps.getWorkspace()) === null || _addon$tab$traps$getW2 === void 0 ? void 0 : _addon$tab$traps$getW2.recordCachedAreas();\n removeTransition();\n }, speed * 1000);\n }\n const updateIsFullScreen = () => {\n const isFullScreen = addon.tab.redux.state.scratchGui.mode.isFullScreen;\n document.documentElement.classList.toggle(\"sa-hide-flyout-not-fullscreen\", !isFullScreen);\n };\n updateIsFullScreen();\n let didOneTimeSetup = false;\n function doOneTimeSetup() {\n if (didOneTimeSetup) {\n return;\n }\n didOneTimeSetup = true;\n addon.tab.redux.initialize();\n addon.tab.redux.addEventListener(\"statechanged\", e => {\n switch (e.detail.action.type) {\n // Event casted when you switch between tabs\n case \"scratch-gui/navigation/ACTIVATE_TAB\":\n {\n // always 0, 1, 2\n const toggleSetting = getToggleSetting();\n if (e.detail.action.activeTabIndex === 0 && !addon.self.disabled && (toggleSetting === \"hover\" || toggleSetting === \"cathover\")) {\n onmouseleave(null, 0);\n toggle = false;\n }\n break;\n }\n case \"scratch-gui/mode/SET_FULL_SCREEN\":\n updateIsFullScreen();\n break;\n }\n });\n document.body.addEventListener(\"mouseup\", () => {\n if (closeOnMouseUp) {\n onmouseleave();\n closeOnMouseUp = false;\n }\n });\n if (addon.self.enabledLate && getToggleSetting() === \"category\" && !addon.settings.get(\"lockLoad\")) {\n Blockly.getMainWorkspace().getToolbox().selectedItem_.setSelected(false);\n }\n addon.self.addEventListener(\"disabled\", () => {\n Blockly.getMainWorkspace().getToolbox().selectedItem_.setSelected(true);\n });\n addon.self.addEventListener(\"reenabled\", () => {\n if (getToggleSetting() === \"category\" && !addon.settings.get(\"lockLoad\")) {\n Blockly.getMainWorkspace().getToolbox().selectedItem_.setSelected(false);\n onmouseleave(null, 0);\n toggle = false;\n }\n });\n addon.settings.addEventListener(\"change\", () => {\n if (addon.self.disabled) return;\n if (getToggleSetting() === \"category\") {\n // switching to category click mode\n // close the flyout unless it's locked\n if (flyoutLock) {\n toggle = true;\n flyoutLock = false;\n updateLockDisplay();\n } else {\n Blockly.getMainWorkspace().getToolbox().selectedItem_.setSelected(false);\n onmouseleave(null, 0);\n toggle = false;\n }\n } else {\n // switching from category click to a different mode\n if (addon.settings.get(\"lockLoad\")) {\n flyoutLock = true;\n updateLockDisplay();\n } else {\n onmouseleave();\n }\n Blockly.getMainWorkspace().getToolbox().selectedItem_.setSelected(true);\n }\n });\n\n // category click mode\n const oldSetSelectedItem = Blockly.Toolbox.prototype.setSelectedItem;\n Blockly.Toolbox.prototype.setSelectedItem = function (item) {\n let shouldScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n const previousSelection = this.selectedItem_;\n oldSetSelectedItem.call(this, item, shouldScroll);\n if (addon.self.disabled || getToggleSetting() !== \"category\") return;\n if (!shouldScroll && !toggle) {\n // ignore initial selection when updating the toolbox\n item.setSelected(false);\n } else if (item === previousSelection) {\n toggle = !toggle;\n if (toggle) onmouseenter();else {\n onmouseleave();\n item.setSelected(false);\n }\n } else if (!toggle) {\n scrollAnimation = false;\n toggle = true;\n onmouseenter();\n }\n };\n const oldSelectCategoryById = Blockly.Toolbox.prototype.selectCategoryById;\n Blockly.Toolbox.prototype.selectCategoryById = function () {\n // called after populating the toolbox\n // ignore if the palette is closed\n if (!addon.self.disabled && getToggleSetting() === \"category\" && !toggle) return;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return oldSelectCategoryById.call(this, ...args);\n };\n const oldStepScrollAnimation = Blockly.Flyout.prototype.stepScrollAnimation;\n Blockly.Flyout.prototype.stepScrollAnimation = function () {\n // scrolling should not be animated when opening the flyout in category click mode\n if (!scrollAnimation) {\n this.scrollbar_.set(this.scrollTarget);\n this.scrollTarget = null;\n scrollAnimation = true;\n return;\n }\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return oldStepScrollAnimation.apply(this, args);\n };\n }\n while (true) {\n flyOut = await addon.tab.waitForElement(\".blocklyFlyout\", {\n markAsSeen: true,\n reduxEvents: [\"scratch-gui/mode/SET_PLAYER\", \"scratch-gui/locales/SELECT_LOCALE\", \"scratch-gui/theme/SET_THEME\", \"fontsLoaded/SET_FONTS_LOADED\"],\n reduxCondition: state => !state.scratchGui.mode.isPlayerOnly\n });\n scrollBar = document.querySelector(\".blocklyFlyoutScrollbar\");\n const blocksWrapper = document.querySelector('[class*=\"gui_blocks-wrapper_\"]');\n const injectionDiv = document.querySelector(\".injectionDiv\");\n\n // Code editor left border\n const borderElement1 = document.createElement(\"div\");\n borderElement1.className = \"sa-flyout-border-1\";\n addon.tab.displayNoneWhileDisabled(borderElement1);\n injectionDiv.appendChild(borderElement1);\n const borderElement2 = document.createElement(\"div\");\n borderElement2.className = \"sa-flyout-border-2\";\n addon.tab.displayNoneWhileDisabled(borderElement2);\n injectionDiv.appendChild(borderElement2);\n\n // Placeholder Div\n if (placeHolderDiv) placeHolderDiv.remove();\n placeHolderDiv = document.createElement(\"div\");\n blocksWrapper.appendChild(placeHolderDiv);\n placeHolderDiv.className = \"sa-flyout-placeHolder\";\n placeHolderDiv.style.display = \"none\"; // overridden by userstyle if the addon is enabled\n\n // Lock image\n if (lockObject) lockObject.remove();\n lockObject = document.createElementNS(SVG_NS, \"foreignObject\");\n lockObject.setAttribute(\"class\", \"sa-lock-object\");\n lockObject.style.display = \"none\"; // overridden by userstyle if the addon is enabled\n lockButton = document.createElement(\"button\");\n lockButton.className = \"sa-lock-button\";\n lockIcon = document.createElement(\"img\");\n lockIcon.alt = \"\";\n updateLockDisplay();\n lockButton.onclick = () => {\n flyoutLock = !flyoutLock;\n updateLockDisplay();\n };\n lockButton.appendChild(lockIcon);\n lockObject.appendChild(lockButton);\n flyOut.appendChild(lockObject);\n onmouseleave(null, 0);\n toggle = false;\n const toolbox = document.querySelector(\".blocklyToolboxDiv\");\n const addExtensionButton = document.querySelector(\"[class^=gui_extension-button-container_]\");\n for (let element of [toolbox, addExtensionButton, flyOut, scrollBar]) {\n element.onmouseenter = e => {\n const toggleSetting = getToggleSetting();\n if (!addon.self.disabled && (toggleSetting === \"hover\" || toggleSetting === \"cathover\")) onmouseenter(e);\n };\n element.onmouseleave = e => {\n const toggleSetting = getToggleSetting();\n if (!addon.self.disabled && (toggleSetting === \"hover\" || toggleSetting === \"cathover\")) onmouseleave(e);\n };\n }\n placeHolderDiv.onmouseenter = e => {\n if (!addon.self.disabled && getToggleSetting() === \"hover\") onmouseenter(e);\n };\n placeHolderDiv.onmouseleave = e => {\n if (!addon.self.disabled && getToggleSetting() === \"hover\") onmouseleave(e);\n };\n doOneTimeSetup();\n autoLock();\n Blockly.svgResize(Blockly.getMainWorkspace());\n }\n});\n// EXTERNAL MODULE: ./node_modules/css-loader!./src/addons/addons/hide-flyout/style.css\nvar style = __webpack_require__(1449);\nvar style_default = /*#__PURE__*/__webpack_require__.n(style);\n\n// CONCATENATED MODULE: ./node_modules/url-loader/dist/cjs.js!./src/addons/addons/hide-flyout/lock.svg\n/* harmony default export */ var lock = (\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGFyaWEtaGlkZGVuPSJ0cnVlIiB3aWR0aD0iMWVtIiBoZWlnaHQ9IjFlbSIgc3R5bGU9Ii1tcy10cmFuc2Zvcm06cm90YXRlKDM2MGRlZyk7LXdlYmtpdC10cmFuc2Zvcm06cm90YXRlKDM2MGRlZyk7dHJhbnNmb3JtOnJvdGF0ZSgzNjBkZWcpIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiAxM2ExIDEgMCAwIDAtMSAxdjNhMSAxIDAgMCAwIDIgMHYtM2ExIDEgMCAwIDAtMS0xem01LTRWN0E1IDUgMCAwIDAgNyA3djJhMyAzIDAgMCAwLTMgM3Y3YTMgMyAwIDAgMCAzIDNoMTBhMyAzIDAgMCAwIDMtM3YtN2EzIDMgMCAwIDAtMy0zek05IDdhMyAzIDAgMCAxIDYgMHYySDl6bTkgMTJhMSAxIDAgMCAxLTEgMUg3YTEgMSAwIDAgMS0xLTF2LTdhMSAxIDAgMCAxIDEtMWgxMGExIDEgMCAwIDEgMSAxeiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==\");\n// CONCATENATED MODULE: ./node_modules/url-loader/dist/cjs.js!./src/addons/addons/hide-flyout/unlock.svg\n/* harmony default export */ var unlock = (\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGFyaWEtaGlkZGVuPSJ0cnVlIiB3aWR0aD0iMWVtIiBoZWlnaHQ9IjFlbSIgc3R5bGU9Ii1tcy10cmFuc2Zvcm06cm90YXRlKDM2MGRlZyk7LXdlYmtpdC10cmFuc2Zvcm06cm90YXRlKDM2MGRlZyk7dHJhbnNmb3JtOnJvdGF0ZSgzNjBkZWcpIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiAxM2ExLjQ5IDEuNDkgMCAwIDAtMSAyLjYxVjE3YTEgMSAwIDAgMCAyIDB2LTEuMzlBMS40OSAxLjQ5IDAgMCAwIDEyIDEzem01LTRIOVY3YTMgMyAwIDAgMSA1LjEyLTIuMTMgMy4wOCAzLjA4IDAgMCAxIC43OCAxLjM4IDEgMSAwIDEgMCAxLjk0LS41IDUuMDkgNS4wOSAwIDAgMC0xLjMxLTIuMjlBNSA1IDAgMCAwIDcgN3YyYTMgMyAwIDAgMC0zIDN2N2EzIDMgMCAwIDAgMyAzaDEwYTMgMyAwIDAgMCAzLTN2LTdhMyAzIDAgMCAwLTMtM3ptMSAxMGExIDEgMCAwIDEtMSAxSDdhMSAxIDAgMCAxLTEtMXYtN2ExIDEgMCAwIDEgMS0xaDEwYTEgMSAwIDAgMSAxIDF6IiBmaWxsPSIjNTc1ZTc1Ii8+PC9zdmc+\");\n// CONCATENATED MODULE: ./src/addons/addons/hide-flyout/_runtime_entry.js\n/* generated by pull.js */\n\n\n\n\nconst resources = {\n \"userscript.js\": userscript,\n \"style.css\": style_default.a,\n \"lock.svg\": lock,\n \"unlock.svg\": unlock\n};\n\n/***/ })\n\n}]);","inputSourceMap":null}