import { registerAi, createAi } from "@cloudbase/ai";
import { generateAuthInstance, registerAuth } from "@cloudbase/auth";
<% if(cdnEndpoints.aegis){ %>import Aegis from 'aegis-mp-sdk';<%} else {%> class Aegis {
  constructor() {
    return new Proxy({}, {
      get: (_,prop) => {
        return () => {}
      }
    })
  }
}<% } %>
<% if(privatelink){ %>import { tcbPrivatelinkAdapter } from './privatelink/index';<%} else {%>const tcbPrivatelinkAdapter = undefined<% } %>
<% if(importJSSDK){ %>import cloudbase from "@cloudbase/js-sdk/app";
import { registerFunctions } from "@cloudbase/js-sdk/functions";
import { registerStorage } from "@cloudbase/js-sdk/storage";<% } %>

const loadMap = {
  <% if(importJSSDK){ %>"@cloudbase/js-sdk/app": {
    default: cloudbase,
  },
  "@cloudbase/js-sdk/functions": {
    registerFunctions,
  },
  "@cloudbase/js-sdk/storage": {
    registerStorage,
  },<% } %>
  "@cloudbase/ai": {
    registerAi,
    createAi,
  },
  "@cloudbase/auth": {
    generateAuthInstance,
    registerAuth,
  },
  "@cloudbase/adapter-wx_mp": require('@cloudbase/adapter-wx_mp')
};

const load = (name) => loadMap[name];

export { Aegis, tcbPrivatelinkAdapter, load }
