/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import e from"../../core/Logger.js";import{interactiveToolKeys as t}from"./keybindings.js";function o(t){return[t.on("before-add",o=>{const i=o.item;if(null==i||t.includes(i))return e.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void o.preventDefault();i.onAdd()}),t.on("after-remove",e=>{const t=e.item;t.active&&(t.view.activeTool=null),t.destroy()})]}function i(e){return e.visible&&null!=e.getEditableFlag&&e.getEditableFlag(0)&&e.getEditableFlag(1)}function n(e){return"key-down"===e.type&&e.key===t.cancel}export{i as areToolManipulatorsEditable,o as getToolCollectionHandles,n as isCancelEvent};
