<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">$(function() {
  // Amazonã‹ã‚‰æŒ‡å®šã—ãŸã‚µã‚¤ã‚ºã®ç”»åƒå–å¾—ã«å¤±æ•—ã—ãŸå&nbsp;´åˆã¯å…ƒã®ã‚µã‚¤ã‚ºã®ç”»åƒã‚’è¡¨ç¤ºã™ã‚‹
  // =======================================================
  $(".preface__sub").find("img").error(function() {
    var baseImage = $(this).data("base_image");
    if (baseImage) {
      $(this).attr('src', baseImage);
    }
  })
  .each(function() {
    $(this).attr('src', $(this).attr("src"));
  });

  // æƒ³ã„ã‚²ãƒ¼ã‚¸æŠ•ç¥¨
  // =======================================================
  var btnVotable = true;
  $(".voteBtn").on("click", function() {
    var cookie = JSON.parse(Sabel.Cookie.get("lyric_voted"));
    
    if (cookie != 1) {
      Sabel.Cookie.set("lyric_voted", 1, {"expire": 86400 * 365, "path": "/"});
      firstVoteAlert();
      return;
    }

    if (btnVotable === false) {
      return;
    }

    btnVotable = false;

    var data = {
      id        : LYRIC_ID,
      type      : $(this).data("type"),
      is_cancel : 0,
    }

    var self = $(this);
    if (self.hasClass("voted")) {
      data["is_cancel"] = 1;
    }

    if (data["is_cancel"] !== 1) {
      setTimeout(function() {
        var blinkCount = 0;
        var isBlinkOn  = false;

        var timer = setInterval(function() {
          if (isBlinkOn) {
            self.removeClass("voted");
            isBlinkOn = false;
          } else {
            self.addClass("voted");
            isBlinkOn = true;
          }

          blinkCount++;

          if (blinkCount &gt; 3) {
            self.addClass("voted");
            clearInterval(timer);
            setMostVotedTypeBtn();
            btnVotable = true;
          }
        }, 250);
      }, 300);
    }

    $.post("/lyric/vote", data, function() {
      if (data["is_cancel"] === 1) {
        self.removeClass("voted");
        setMostVotedTypeBtn();
        btnVotable = true;
      }
    });
  });

  // æœ€ã‚‚æŠ•ç¥¨ã•ã‚ŒãŸãƒœã‚¿ãƒ³ã‚’æ›´æ–°ã™ã‚‹
  function setMostVotedTypeBtn()
  {
    $.getJSON("/lyric/getMostVotedTypes", {id: LYRIC_ID}, function(data) {
      var mostVotedTypes = data;
      $(".voteBtn").each(function() {
        var type = $(this).data("type");
        if ($.inArray(type, mostVotedTypes) !== -1) {
          $(this).addClass("mostVoted");
        } else {
          $(this).removeClass("mostVoted");
        }
      });
    });
  }

  // æƒ³ã„ã‚²ãƒ¼ã‚¸æŠ•ç¥¨çµæžœ
  // =======================================================
  $(".openVoteResult, #voteResultClose").on("click", function() {
    var cookie = JSON.parse(Sabel.Cookie.get("lyric_voted"));

    if (cookie != 1) {
      Sabel.Cookie.set("lyric_voted", 1, {"expire": 86400 * 365, "path": "/"});
      firstVoteAlert();
      return false;
    }

    $('.artist_boxArea').fadeToggle(300);
  });

  function firstVoteAlert() {
    var message = "ã“ã®æ¥½æ›²ã«å¯¾ã™ã‚‹ã‚ãªãŸã®æ°—æŒã¡ã‚’ã‚¿ãƒƒãƒ—ã—ã¦ãã&nbsp;ã•ã„ã€‚"
                + "\n"
                + "ã¿ã‚“ãªã®æ°—æŒã¡ã‚’é›†ã‚ãŸçµæžœãŒè¡¨ç¤ºã•ã‚Œã¾ã™ã€‚";

    myAlert({
      title : 'æƒ³ã„ã‚²ãƒ¼ã‚¸ã«ã¤ã„ã¦',
      text  : message
    });
  }

  // æ­Œè©žæ¥½ã—ã¿ã§ã™ãƒœã‚¿ãƒ³
  // =======================================================
  $(".hopeVoteBtn").on("click", function() {
    var btn  = $(this);
    var data = {
      id : LYRIC_ID,
      token : $(this).data("token")
    }

    /*
    if (btn.data('voted')) {
      $('#reviewPopup').slideDown();
      return;
    }
    */

    btn.prop('disabled', true);

    $.post("/lyric/hopeVote", data, function(data) {
      if (data.status !== "SUCCESS") {
        if (data.message === 'reload') {
          location.reload();
          return;
        }

        myWarnAlert(data.message);
      } else {
        //btn.data('voted', true);
        $('#hopeVotePoint').text(data.point * 10);
        $('#reviewPopup').slideDown();
      }

      btn.prop('disabled', false);
    }, "json");
  });

  // iTunesãƒ—ãƒ¬ãƒ¼ãƒ¤ãƒ¼
  // =======================================================
  $(".showITunesPlayer").on("click", function() {
      $('#iTunesPlayerButton').toggleClass('newLyricSubpart__icon--off');
    if ($(this).data("status") === "pause") {
      $(this).data("status", "play");
      $('#audio').get(0).play();
    } else {
      $(this).data("status", "pause");
      $('#audio').get(0).pause();
    }

  });

  // å‹•ç”»
  // =======================================================
  $(".youtubeLinks").on("click", "a", function() {
    displayYoutubeVideo($(this).data('id'));

    return false;
  });

  var tonefuseOverlayClone = document.getElementById("cf_flex_mb");

  $("#youtubeContainerClose").on("click", function() {
    $("#youtubeContainer").find("iframe").attr("src", null);
    $("#youtubeContainer").css("display", "none");

    $('#JP_uta_sp_lyric_footeroverlay').css('visibility','visible');
    $('#geniee_overlay_outer').css('visibility','visible');

    var status = $("#tonefuseOverlay").attr("data-status");

    if (status == "on") {
      document.getElementById("tonefuseOverlay").appendChild(tonefuseOverlayClone);
    }
  });

  abbrHopePoint();
});

$(document).on("click", "#cf_flex_mb_close", function() {
  document.getElementById("tonefuseOverlay").setAttribute("data-status", "off");
});

function abbrHopePoint() {
  if ($('.hopeVotePointTxtWrap').width() &lt;= $('.hopeVotePointTxtinr').width()) {
    var point = $('#hopeVotePoint').data('point');

    if (point &gt;= 1000000) {
      point = Math.floor(point / 1000000) + 'M';
    } else if (point &gt;= 1000) {
      point = Math.floor(point / 1000) + 'K';
    }

    $('#hopeVotePoint').text(point);
  }
}

function displayYoutubeVideo(videoId) {
  var url = "https://www.youtube.com/embed/" + videoId + "?playsinline=1";

  $("#pageTopScrollBtn").hide();
  $("#youtubeContainer").find("iframe").attr("src", url);

  if ($("#cf_flex_mb").css("display") == "block") {
    document.getElementById("cf_flex_mb_close").parentNode.parentNode.removeChild(document.getElementById("cf_flex_mb"));
  }

  $('#JP_uta_sp_lyric_footeroverlay').css('visibility','hidden');
  $('#geniee_overlay_outer').css('visibility','hidden');
  $("#youtubeContainer").css("display", "block");
}</pre></body></html>