{%- comment -%}
  ShiftSee public embed snippet for Shopify themes.
  Paste this into a custom liquid section or theme snippet, then set the
  data-profile-kind and data-profile-slug values for the business/shifter
  profile you want to show.
{%- endcomment -%}

<div
  class="shiftsee-profile-embed"
  data-profile-kind="b"
  data-profile-slug="your-business-slug"
  data-shiftsee-origin="https://shiftsee.com"
></div>

<script>
  (function () {
    var mounts = document.querySelectorAll('.shiftsee-profile-embed');
    mounts.forEach(function (mount) {
      if (mount.dataset.shiftseeMounted === '1') return;
      mount.dataset.shiftseeMounted = '1';

      var origin = (mount.dataset.shiftseeOrigin || 'https://shiftsee.com').replace(/\/$/, '');
      var kind = mount.dataset.profileKind || 'b';
      var slug = mount.dataset.profileSlug || '';
      if (!slug) {
        mount.textContent = 'ShiftSee profile slug is missing.';
        return;
      }

      var iframe = document.createElement('iframe');
      iframe.src = origin + '/embed/profile/' + encodeURIComponent(kind) + '/' + encodeURIComponent(slug);
      iframe.title = 'ShiftSee profile';
      iframe.loading = 'lazy';
      iframe.style.width = '100%';
      iframe.style.minHeight = '460px';
      iframe.style.border = '0';
      iframe.style.borderRadius = '8px';
      iframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin');
      mount.innerHTML = '';
      mount.appendChild(iframe);
    });
  }());
</script>
