import '../constants/index.mjs';
import { provideGlobalConfig } from '../hooks/base/useGlobalConfig/index.mjs';
import { createLoginDialog } from '../components/src/business/loginDialog/method.mjs';
import { createRectSelect } from '../components/src/base/rectSelect/createRectSelect.mjs';
import { version } from './version.mjs';
import { INSTALLED_KEY } from '../constants/key.mjs';

const makeInstaller = (components = []) => {
  const install = (app, options) => {
    if (app[INSTALLED_KEY]) return;
    app[INSTALLED_KEY] = true;
    components.forEach((c) => app.use(c));
    provideGlobalConfig(options, app, true);
    if (!options.disabledLoginDialog) {
      createLoginDialog();
    }
    if (!options.disabledRectSelect) {
      createRectSelect();
    }
    if (!options.env.SSR) {
      document?.body?.setAttribute?.("data-giime-version", version);
    }
  };
  return {
    version,
    install
  };
};

export { makeInstaller };
//# sourceMappingURL=makeInstaller.mjs.map
