"use strict";exports.__esModule=!0,exports.default=definePlugin;var _util=require("../common/util"),_executer=require("../core/executer");function definePlugin(a,b){return c=>{return d=>{let e=b.setup(c,d),f="function"==typeof b.render;const g=a=>{f&&b.render.call(e,a)};return f&&(0,_executer.onRender)(g),(0,_util.extend)({type:"plugin",name:a,render:g,remove:()=>{"function"==typeof b.destroyed&&b.destroyed.call(e),f&&(0,_executer.removeRender)(g)}},e)}}}