class LocalSim extends Sim {
  overlays;

  constructor(product, showDate) {
    super(product, showDate);
  }

  init() {
    if (this.product.data.overlays?.length > 0) {
      this.overlays = this.product.data.overlays.map((overlay) => ({
        overlay_name: overlay.overlay_name,
        overlay_images: overlay.overlay_images.map(
          (img) => `${overlay.overlay_path}/${img}`
        ),
      }));
    }

    this.htmlContent = parseHanis(
      this.product.name,
      this.availableImages
        .slice(0, 1)
        .map((displayedImg) => displayedImg.fullPath),
      this.availableImages
        .slice(0, 1)
        .map((displayedImg) => displayedImg.startTime),
      this.overlays?.map((overlay) => ({
        ...overlay,
        overlay_images: overlay.overlay_images.slice(0, 1),
      })),
      this.showDate,
      false
    );
  }

  open() {
    super.open();
    $("#main").html(this.htmlContent);
  }
}
