import o from "gsap";
function n(a, t) {
  try {
    const e = o.timeline();
    e.delay(0), e.addLabel("camera", 0.5), e.addLabel("pathLine", 0.5), e.addLabel("focusMap", 0.5), e.addLabel("focusMap2", 0.5), e.addLabel("border", 0.5), e.add(o.to(a.camera.instance.position, {
      duration: 1,
      delay: 0,
      x: t.camera.position.x + (t.scene.translateX || 0),
      y: t.camera.position.y + (t.scene.translateY || 0),
      z: t.camera.position.z + (t.scene.translateZ || 0),
      ease: "circ.out",
      onComplete: () => {
        a.camera.controls.saveState(), a.onCallBack.onMapAnimationSuccess(), a.isMapAnimationSuccess = !0;
      }
    }), "camera"), a.pathLine && e.add(o.to(a.pathLine.options.material, {
      duration: 0.2,
      opacity: 1
    }), "pathLine"), a.mapBackgroundImgMaterial && e.add(o.to(a.mapBackgroundImgMaterial, {
      duration: 2,
      opacity: 1
    }), "pathLine"), a.gaoguangMesh && e.add(o.to(a.gaoguangMesh.material, {
      duration: 0.5,
      opacity: 1
    }), "pathLine"), e.add(o.to(a.areaMapGroup, {
      duration: 1,
      delay: 0.5,
      visible: !0
    }), "focusMap"), e.add(o.to(a.areaMapGroup.position, {
      duration: 1,
      delay: 0.5,
      x: 0,
      y: 0,
      z: 0
    }), "focusMap"), e.add(o.to(a.areaMapGroup.scale, {
      duration: 1,
      delay: 0.5,
      x: 1,
      y: 1,
      z: 1,
      ease: "circ.out"
    }), "focusMap"), e.add(o.to(a.rotateBorder1.scale, {
      duration: 0.5,
      x: 1,
      y: 1,
      z: 1,
      ease: "circ.out"
    }), "border"), e.add(o.to(a.rotateBorder2.scale, {
      duration: 0.5,
      x: 1,
      y: 1,
      z: 1,
      ease: "circ.out"
    }), "border"), a.option.map.arealabel.show && (a.allAreaLabel.map((r, c) => {
      const l = r.element.querySelector(".area-label>p.label");
      l.style.opacity = 0;
    }), a.allAreaLabel.map((r, c) => {
      const l = r.element.querySelector(".area-label>p.label");
      e.add(o.to(l, {
        duration: 0.5,
        delay: 0.05 * c,
        opacity: 1,
        ease: "circ.out"
      }), "focusMap2");
    })), setTimeout(() => {
      try {
        if (a.option.map.titleLabel.show) {
          a.mapTitleLabel.element.style.opacity = 0, e.add(o.to(a.mapTitleLabel.element, {
            duration: 0.5,
            delay: 0.03,
            opacity: 1,
            ease: "circ.out"
          }), "focusMap2");
          const r = a.mapTitleLabel.element.querySelector(".map-label>.other-label");
          e.add(o.to(r, {
            duration: 0.5,
            delay: 0.03,
            translateY: 0,
            ease: "circ.out"
          }), "focusMap2");
        }
      } catch {
      }
    }, 1e3);
  } catch {
  }
}
export {
  n as createTimeLine
};
