<head th:remove="tag" th:fragment="head">
  <script type="module" crossorigin src="/themes/howiehz-higan/assets/12.65.0BLvZPtu.js" integrity="sha384-glwQKZgXV9liWigD8pAos29T1HoDLlAGdzbPx0zBd494+0tR4GkwGRht9oISaL+E"></script>
</head>
<body
  th:remove="tag"
  th:fragment="body(storageKey, group, plural, nameAttribute, triggerSelector, countSelector, networkRequestFailedMsg)"
>
  <script
    data-upvote-runtime
    th:data-count-selector="${countSelector}"
    th:data-group="${group}"
    th:data-name-attribute="${nameAttribute}"
    th:data-network-request-failed-msg="${networkRequestFailedMsg}"
    th:data-plural="${plural}"
    th:data-storage-key="${storageKey}"
    th:data-trigger-selector="${triggerSelector}"
    type="application/json"
  ></script>
</body>
<th:block th:fragment="inlineInit">
  <script>
    (function () {
      document.querySelectorAll("script[data-upvote-runtime]").forEach(function (configElement) {
        const dataset = configElement.dataset;
        const storageKey = dataset.storageKey;
        const nameAttribute = dataset.nameAttribute;
        const triggerSelector = dataset.triggerSelector;
        if (!storageKey || !nameAttribute || !triggerSelector) {
          return;
        }
        try {
          const likedNames = JSON.parse(localStorage.getItem(storageKey) || "[]");
          if (!Array.isArray(likedNames)) {
            return;
          }
          likedNames.forEach(function (targetName) {
            if (typeof targetName !== "string" || targetName.trim() === "") {
              return;
            }
            document.querySelectorAll(triggerSelector).forEach(function (triggerElement) {
              if (triggerElement.getAttribute(nameAttribute) !== targetName) {
                return;
              }
              triggerElement.style.color = "var(--color-accent)";
              triggerElement.style.fontWeight = "500";
            });
          });
        } catch {}
      });
    })();
  </script>
</th:block>
