<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">(function ($) {
  "use strict";
  /* =============================
    豕ｨ譁�ヵ繧ｩ繝ｼ繝�縺ｮ譁�ｭ怜喧縺大ｯｾ遲�
  ============================= */
  function setCharset() {
    $(".item__order__form form").attr("accept-charset", "Shift_JIS");
  }

  /* =============================
    繧ｫ繝ｼ繝医�繧ｿ繝ｳ縺ｫID繧剃ｻ倅ｸ�
  ============================= */
  function addCartId() {
    $('input[type="submit"][value="繧ｫ繝ｼ繝医∈"]').attr("id", "submitBtn");
  }

  /* =============================
    繝阪�繝�繝励Ξ繝ｼ繝磯∈謚槭�蜈･蜉帛宛蠕｡
  ============================= */
  // function nameplateControl() {
  //   const $nameplate = $('select[name="option01"]');
  //   const $nameplateName = $('input[name="option02"]');

  //   // 蛻晄悄迥ｶ諷九〒辟｡蜉ｹ蛹�
  //   $nameplate.prop("disabled", true);
  //   $nameplateName.prop("disabled", true);

  //   // 繝輔か繝ｼ繝�騾∽ｿ｡譎ゅ↓譛牙柑蛹厄ｼ医ョ繝ｼ繧ｿ繧帝√ｋ縺溘ａ��
  //   $("form").on("submit", function () {
  //     $nameplate.prop("disabled", false);
  //     $nameplateName.prop("disabled", false);
  //   });
  // }

  /* =============================
    PREMIUM繝阪�繝�繝励Ξ繝ｼ繝郁ｳｼ蜈･譎ゅ�縺ｿ縺雁錐蜑榊�蜉帙ヵ繧ｩ繝ｼ繝�繧呈怏蜉ｹ
  ============================= */
  function updateNameplateStatus() {
    const selectedValue = $('select[name="option01"]').val();
    $(".option02, input[name='option02']").toggleClass(
      "active",
      ["nameplate-boys", "nameplate-girls"].includes(selectedValue)
    );
  }

  function toggleNameplateInput() {
    $('select[name="option01"]').on("change", updateNameplateStatus); //option01驕ｸ謚樊凾縺ｫ繝√ぉ繝�け
    updateNameplateStatus(); // 繝壹�繧ｸ隱ｭ縺ｿ霎ｼ縺ｿ譎ゅ↓繧ゅメ繧ｧ繝�け
  }

  /* =============================
    豕ｨ譁�ヵ繧ｩ繝ｼ繝� 繝舌Μ繝��繧ｷ繝ｧ繝ｳ
  ============================= */
  function validateStampInput() {
    const $input = $('input[name="option02"]');

    function checkValidation() {
      $("p.val_error").remove();
      const value = $input.val();
      const isValid = /^[a-zA-Z\s.]+$/.test(value);
      const length = value.length;

      if (length &gt; 0 &amp;&amp; !isValid) {
        $input.after('&lt;p class="val_error"&gt;蜊願ｧ定恭謨ｰ縺ｧ蜈･蜉帙＠縺ｦ縺上□縺輔＞&lt;/p&gt;');
      }
      if (length &gt;= 16) {
        $input.after(
          '&lt;p class="val_error"&gt;繧ｹ繝壹�繧ｹ繝ｻ險伜捷蜷ｫ繧√※15譁�ｭ嶺ｻ･蜀�〒蜈･蜉帙＠縺ｦ縺上□縺輔＞&lt;/p&gt;'
        );
      }
    }

    $input.on("keyup", checkValidation);

    $input.on("blur", function () {
      if (!/^[a-zA-Z\s.]{1,15}$/.test($(this).val())) {
        $(this).val("");
      }
    });
  }

  /* =============================
    蝨ｨ蠎ｫ縺後↑縺�→縺阪き繝ｼ繝医�繧ｿ繝ｳ繧堤┌蜉ｹ蛹�
  ============================= */
  function toggleCartButton() {
    $('input[name="variation"]').on("change", function () {
      const isSold = $(this).closest("tr").hasClass("sold");
      $("#submitBtn, label[for='submitBtn']").toggleClass("is-sold", isSold);
    });
  }

  /* =============================
    繝励Ξ繝ｼ繧ｹ繝帙Ν繝繝ｼ繧定ｨｭ螳�
  ============================= */
  function setPlaceholders() {
    $('input[name="option02"]').attr("placeholder", "YOSHIKI.F");
    $('input[name="option04"]').attr("placeholder", "繧医＠縺�");
  }

  /* =============================
    蛻晄悄蛹門�逅�
  ============================= */
  $(function () {
    setCharset();
    addCartId();
    // nameplateControl();
    toggleNameplateInput();
    validateStampInput();
    toggleCartButton();
    setPlaceholders();
  });
})(jQuery);
</pre></body></html>