const OSS_PUBLIC_BASE_URL = "https://stringtest.oss-cn-hangzhou.aliyuncs.com";

function oss(path: string): string {
  return `${OSS_PUBLIC_BASE_URL}/${path.replace(/^\/+/, "")}`;
}

function muban(path: string): string {
  return oss(`muban/${path.replace(/^\/+/, "")}`);
}

function toolbox(path: string): string {
  return oss(`static/toolbox/${path.replace(/^\/+/, "")}`);
}

export const ossAssets = {
  brand: {
    logo: oss("logo.png"),
  },
  auth: {
    showcaseVideo: oss("test5.mp4"),
  },
  home: {
    backgroundVideo: muban("hero-bg.mp4"),
    heroSlides: [oss("static/banners/light2_轮播1.jpg"), oss("static/banners/light2_轮播2.jpg"), oss("static/banners/light2_轮播3.jpg")],
    features: {
      ecommerce: muban("feature-ecommerce.jpg"),
      script: muban("feature-script.jpg"),
      token: muban("feature-token.jpg"),
    },
  },
  toolbox: {
    imageBefore: toolbox("%E7%89%9B%E4%BB%94.webp"),
    imageAfter: toolbox("%E8%A5%BF%E8%A3%85.webp"),
    watermarkBefore: toolbox("%E5%8E%BB%E6%B0%B4%E5%8D%B0%E5%89%8D.webp"),
    watermarkAfter: toolbox("%E5%8E%BB%E6%B0%B4%E5%8D%B0%E5%90%8E.webp"),
  },
  community: {
    cardImages: [
      muban("dianshang1.png"),
      muban("dianshang2.png"),
      muban("dianshang3.png"),
      muban("wechat-7.png"),
      muban("wechat-8.png"),
      muban("wechat-9.png"),
    ],
    carouselVideos: [oss("test3.mp4"), oss("test4.mp4"), oss("test6.mp4")],
  },
  workflows: {
    caseImages: [
      muban("community/workflow-rain-night.jpg"),
      muban("community/workflow-character-look.jpg"),
      muban("community/workflow-skyline.jpg"),
      muban("community/workflow-lab.jpg"),
    ],
  },
  ecommerce: {
    generated: muban("ecommerce-carousel-generated.png"),
    slides: {
      slide4: muban("slide-4.png"),
      slide5: muban("slide-5.png"),
    },
    heroSlides: [
      muban("ecommerce-hero-carousel/slide-1.webp"),
      muban("ecommerce-hero-carousel/slide-2.webp"),
      muban("ecommerce-hero-carousel/slide-3.webp"),
      muban("ecommerce-hero-carousel/slide-4.webp"),
      muban("ecommerce-hero-carousel/slide-5.webp"),
    ],
    templateSlides: [
      muban("more-template-carousel/slide-1.jpg"),
      muban("more-template-carousel/slide-2.jpg"),
      muban("more-template-carousel/slide-3.jpg"),
      muban("more-template-carousel/slide-4.png"),
      muban("more-template-carousel/slide-5.gif"),
    ],
    templateCases: [
      muban("ecommerce/templates/case-1.png"),
      muban("ecommerce/templates/case-2.png"),
      muban("ecommerce/templates/case-3.png"),
      muban("ecommerce/templates/case-4.png"),
      muban("ecommerce/templates/case-5.png"),
      muban("ecommerce/templates/case-6.png"),
    ],
    productSet: {
      main: muban("ecommerce/product-set/main.webp"),
      scene: muban("ecommerce/product-set/scene.webp"),
      model: muban("ecommerce/product-set/model.webp"),
      detail: muban("ecommerce/product-set/detail.webp"),
      selling: muban("ecommerce/product-set/selling.webp"),
      hosting: muban("ecommerce/product-set/hosting.webp"),
    },
    tryOn: {
      dressA: muban("ecommerce/try-on/dress-a.webp"),
      dressB: muban("ecommerce/try-on/dress-b.webp"),
      modelWoman: muban("ecommerce/try-on/model-woman.webp"),
      modelMan: muban("ecommerce/try-on/model-man.webp"),
      modelAsian: muban("ecommerce/try-on/model-asian.webp"),
      tryA: muban("ecommerce/try-on/result-a.webp"),
      tryB: muban("ecommerce/try-on/result-b.webp"),
      jacket: muban("ecommerce/try-on/jacket.webp"),
      jacketResultA: muban("ecommerce/try-on/jacket-result-a.webp"),
      jacketResultB: muban("ecommerce/try-on/jacket-result-b.webp"),
      hat: muban("ecommerce/try-on/hat.webp"),
      hatResultA: muban("ecommerce/try-on/hat-result-a.webp"),
      hatResultB: muban("ecommerce/try-on/hat-result-b.webp"),
    },
    detail: {
      productA: muban("ecommerce/detail/product-a.webp"),
      productB: muban("ecommerce/detail/product-b.webp"),
      productC: muban("ecommerce/detail/product-c.webp"),
      longPage: muban("ecommerce/detail/long-page.webp"),
      gridA: muban("ecommerce/detail/grid-a.webp"),
      gridB: muban("ecommerce/detail/grid-b.webp"),
      gridC: muban("ecommerce/detail/grid-c.webp"),
      gridD: muban("ecommerce/detail/grid-d.webp"),
      gridE: muban("ecommerce/detail/grid-e.webp"),
      gridF: muban("ecommerce/detail/grid-f.webp"),
    },
  },
} as const;

export type ProductSetOssAssets = typeof ossAssets.ecommerce.productSet;
export type TryOnOssAssets = typeof ossAssets.ecommerce.tryOn;
export type DetailOssAssets = typeof ossAssets.ecommerce.detail;
