const mainPages = [
    "pages/home/index",
    "pages/login/index",
    "pages/onboarding/index",
    "pages/onboarding-phone/index",
    "pages/onboarding-email/index",
    "pages/onboarding-password/index",
    "pages/onboarding-profile/index",
    "pages/onboarding-application/index",
    "pages/agreement/index",
    "pages/privacy/index",
    "pages/search/index",
    "pages/about-intro/index",
    "pages/about-structure/index",
    "pages/activity-detail/index",
    "pages/my-learning/index",
    "pages/my-browsing-history/index",
    "pages/my-suggestions/index",
    "pages/my-service-projects/index",
    "pages/my-created-activities/index",
    "pages/column-detail/index",
    "pages/my-registered-activities/index",
    "pages/my-mutual-aid-resources/index",
    "pages/my-mutual-aid-needs/index",
    "pages/my-points/index",
    "pages/social-card/index",
    "pages/tag-select/index",
    "pages/tag-professional/index",
    "pages/service-detail/index",
    "pages/service-team-detail/index",
    "pages/service-help-detail/index",
    "pages/survey/index",
    "pages/my-surveys/index",
    "pages/my-survey-detail/index",
    "pages/suggestions/index",
    "pages/suggestion-detail/index",
    "pages/suggestion-create/index",
    "pages/news-list/index",
    "pages/learning-list/index",
    "pages/member-showcase/index",
    "pages/member-detail/index",
    "pages/content-detail/index",
    "pages/knowledge-source-detail/index",
    "pages/media-matrix/index",
    "pages/mutual-aid/index",
    "pages/mutual-aid-create/index",
    "pages/demand-create/index",
    "pages/live/index",
    "pages/events/index",
    "pages/services/index",
    "pages/social/index",
    "pages/profile/index",
    "pages/evaluation/index",
    "pages/passport/index",
    "pages/passport-detail/index",
    "pages/social-settings/index",
    "pages/ai-approvals/index",
    "pages/ai-grants/index",
    "pages/admin-login/index",
    "pages/admin-pending/index",
    "pages/admin-content-list/index",
    "pages/admin-announcement/index",
    "pages/admin-live/index",
    "pages/admin-change-password/index",
];

const routeSubPackagePages = [
  "pages/account-security/index",
  "pages/admin-activity-checkin/index",
  "pages/admin-agent-debug/index",
  "pages/admin-content-create/index",
  "pages/admin-dashboard/index",
  "pages/admin-knowledge-governance/index",
  "pages/admin-review-detail/index",
  "pages/branch-detail/index",
  "pages/evaluation-material/index",
  "pages/event-create/index",
  "pages/join/index",
  "pages/mutual-aid-detail/index",
  "pages/my-survey-answer/index",
  "pages/notifications/index",
  "pages/performance-create/index",
  "pages/profile-edit/index",
  "pages/service-create/index",
  "pages/service-team-create/index"
];

const routeSubPackages = routeSubPackagePages.map((page) => {
  const parts = page.split("/");
  return {
    root: parts.slice(0, -1).join("/"),
    pages: [parts[parts.length - 1]]
  };
});

const appConfig = {
  pages: mainPages,
  window: {
    navigationBarTitleText: "e连心AI平台",
    navigationBarBackgroundColor: "#123E7C",
    navigationBarTextStyle: "white",
    backgroundTextStyle: "light"
  },
  subPackages: [
    ...routeSubPackages,
    {
      root: "skills",
      pages: [],
      independent: true
    }
  ],
  lazyCodeLoading: "requiredComponents",
  agent: {
    skills: [
      {
        name: "activity",
        description: "e连心活动服务：查询活动、查看活动详情、确认报名、查询我的报名",
        path: "skills/activity-skill"
      }
    ],
    pageMetadata: "page-meta.json"
  },
  tabBar: {
    color: "#6B7280",
    selectedColor: "#123E7C",
    backgroundColor: "#FFFFFF",
    borderStyle: "black",
    list: [
      {
        pagePath: "pages/home/index",
        text: "首页",
        iconPath: "assets/tabbar/home.png",
        selectedIconPath: "assets/tabbar/home-active.png"
      },
      {
        pagePath: "pages/mutual-aid/index",
        text: "企业互助",
        iconPath: "assets/tabbar/mutual-aid.png",
        selectedIconPath: "assets/tabbar/mutual-aid-active.png"
      },
      {
        pagePath: "pages/live/index",
        text: "e连心",
        iconPath: "assets/tabbar/live.png",
        selectedIconPath: "assets/tabbar/live-active.png"
      },
      {
        pagePath: "pages/social/index",
        text: "社交圈",
        iconPath: "assets/tabbar/social.png",
        selectedIconPath: "assets/tabbar/social-active.png"
      },
      {
        pagePath: "pages/profile/index",
        text: "我的",
        iconPath: "assets/tabbar/profile.png",
        selectedIconPath: "assets/tabbar/profile-active.png"
      }
    ]
  }
} as any;

export default defineAppConfig(appConfig);
