<commit_before><% content_for :javascript do %>
  <script>
    window.app.product = new Product(<%= json @product, scope: current_user %>)
    window.app.setCurrentAnalyticsProduct(<%= ProductAnalyticsSerializer.new(@product, scope: (current_user || {})).to_json.html_safe %>);
  </script>
<% end %>

<%= render 'shared/navbar' %>

<!-- Flashes! -->

<% if current_user && @product.core_team?(current_user) && @product.stealth? %>
  <%= render 'products/stealth_reminder' %>
<% end %>

<% if flash[:first_assets_granted] %>
  <%= render 'products/assets_granted' %>
<% end %>

<% if flash[:assets_error] %>
  <%= render 'products/assets_error' %>
<% end %>

<% if flash[:applied_for_pitch_week] %>
  <%= render 'products/applied_for_pitch_week' %>
<% end %>

<% if flash[:no_bounty_description] %>
  <%= render 'products/no_bounty_description' %>
<% end %>

<!-- Back to our scheduled programming -->

<div id="product">
  <section class="product-header pt2 mb3 bg-white shadow-light tranx_m r600_mb6">
    <div>
      <div class="container pr0 pl0 r768_pr1 r768_pl1">
        <div class="block full-width pb2 r768_table r600_pb0">
          <div class="primary block full-width center py2 valign-mid r768_table-cell r768_left-align">
            <div class="app-icon-container center valign-top r768_table-cell r768_pr4">
              <a class="relative inline-block" href="<%= product_path(@product) %>">
                <%= react_component 'AppIcon', app: ProductSerializer.new(@product), size: 200 %>
              </a>
            </div>
            <div class="block valign-top r768_table-cell">
              <h1 class="p0 m0">
                <a class="black" href="<%= product_path(@product) %>"><%= @product.name %></a>
              </h1>
              <h4 class="p0 m0 regular gray-1">
                <%= truncate(@product.pitch, length: 60, separator: ' ') %>
              </h4>
              <ul class="list-reset tranx_m r768_m0" style="margin-bottom:5px;">
                <% if @product.homepage_url? %>
                <li class="inline-block">
                  <a href="<%= @product.homepage_url %>">
                    <%= inline_react_component 'Icon', icon: 'globe' %>
                    <%= URI(@product.homepage_url.downcase).host rescue 'invalid' %>
                  </a>
                </li>
                <% end %>
                <li class="inline-block ml1">
                  <a href="<%= product_repos_path(@product) %>">
                    <%= inline_react_component 'Icon', icon: 'github' %>
                    Code
                  </a>
                </li>
                <% if can?(:edit, @product) %>
                <li class="inline-block ml1">
                  <a href="<%= edit_product_path(@product) %>">
                    <%= inline_react_component 'Icon', icon: 'gear' %>
                    Edit product
                  </a>
                </li>
                <% end %>
              </ul>
            </div>
          </div>
          <div data-label="secondary" class="mcenter center valign-mid r768_table-cell r768_right-align" style="width:200px">
            <%= react_component('ProductFollowers', product_id: @product.id) %>
          </div>
        </div>
        <!--  -->

        <div class="tertiary clearfix">

          <ul class="nav nav-tabs r600_pl2 r600_float-left">
            <li class="<%= nav_active_class(:product) %>">
              <a class="px2 py2" href="<%= product_path(@product) %>">
                Activity
              </a>
            </li>

            <li class="<%= nav_active_class(:bounties) %>">
              <a class="px2 py2" href="<%= product_tasks_path(@product) %>">
                Bounties
              </a>
            </li>

            <li class="<%= nav_active_class(:posts) %>">
              <a class="px2 py2" href="<%= product_posts_path(@product) %>">
                Posts
              </a>
            </li>

            <li class="<%= nav_active_class(:assets) %> none r768_inline-block">
              <a class="px2 py2" href="<%= product_assets_path(@product) %>">
                Assets
              </a>
            </li>

            <% if @product.chat_rooms.any? %>
            <% chat_room = @product.chat_rooms.first %>
            <li class="<%= nav_active_class(:chat) %>">
              <a class="px2 py2" href="<%= chat_room_path(chat_room) %>">
                Chat
              </a>
            </li>
            <% end %>
          </ul>

          <script>
            var showCreateBounty = function() {
              window.analytics.track('product.wip.showed_bounty_modal', { product: "<%= @product.slug %>" });
              try {
                $('#create-bounty-modal').modal('show');
              } catch (e) {
            }

            React.render(
              CreateBounty({
                id: 'create-bounty-modal',
                product: { name: "<%= @product.name %>" },
                url: "<%= product_wips_path(@product) %>",
                maxOffer: "<%= (6 * @product.average_bounty).round(-4) %>",
                averageBounty: "<%= @product.average_bounty %>",
                coinsMinted: "<%= @product.coins_minted %>",
                profitLastMonth: "<%= @product.profit_last_month %>",
                steps: "<%= BountyGuidance::Valuations.suggestions(@product) %>",
              }),
              document.getElementById('create-bounty')
              );
            }
          </script>

          <div class="center-align mcenter dropdown pt2 pb2 w45 r600_float-right r600_pt0 r600_pb0 r600_mr2 r600_w35 r768_p0 r768_m0 r992_w45">
            <div class="pill-button-split">
              <% if nav_active?(:product) || nav_active?(:bounties) %>
                <a class="pill-button pill-button-theme-green pill-button-border" href="javascript:void(0);" onclick="javascript:showCreateBounty();">
                  <div class="title bold fs5 pr7 pill-button-text-shadow">Create <span class="r600_none r992_inline-block">a new</span> bounty</div>
                </a>
              <% elsif nav_active?(:posts) %>
                <a class="pill-button pill-button-theme-green pill-button-border" href="<%= new_product_post_path(@product) %>">
                  <div class="title bold fs5 pr7 pill-button-text-shadow">Create <span class="r600_none r992_inline-block">a new</span> post</div><commit_msg>fix bug in custom bounty value dialog<commit_after><% content_for :javascript do %>
  <script>
    window.app.product = new Product(<%= json @product, scope: current_user %>)
    window.app.setCurrentAnalyticsProduct(<%= ProductAnalyticsSerializer.new(@product, scope: (current_user || {})).to_json.html_safe %>);
  </script>
<% end %>

<%= render 'shared/navbar' %>

<!-- Flashes! -->

<% if current_user && @product.core_team?(current_user) && @product.stealth? %>
  <%= render 'products/stealth_reminder' %>
<% end %>

<% if flash[:first_assets_granted] %>
  <%= render 'products/assets_granted' %>
<% end %>

<% if flash[:assets_error] %>
  <%= render 'products/assets_error' %>
<% end %>

<% if flash[:applied_for_pitch_week] %>
  <%= render 'products/applied_for_pitch_week' %>
<% end %>

<% if flash[:no_bounty_description] %>
  <%= render 'products/no_bounty_description' %>
<% end %>

<!-- Back to our scheduled programming -->

<div id="product">
  <section class="product-header pt2 mb3 bg-white shadow-light tranx_m r600_mb6">
    <div>
      <div class="container pr0 pl0 r768_pr1 r768_pl1">
        <div class="block full-width pb2 r768_table r600_pb0">
          <div class="primary block full-width center py2 valign-mid r768_table-cell r768_left-align">
            <div class="app-icon-container center valign-top r768_table-cell r768_pr4">
              <a class="relative inline-block" href="<%= product_path(@product) %>">
                <%= react_component 'AppIcon', app: ProductSerializer.new(@product), size: 200 %>
              </a>
            </div>
            <div class="block valign-top r768_table-cell">
              <h1 class="p0 m0">
                <a class="black" href="<%= product_path(@product) %>"><%= @product.name %></a>
              </h1>
              <h4 class="p0 m0 regular gray-1">
                <%= truncate(@product.pitch, length: 60, separator: ' ') %>
              </h4>
              <ul class="list-reset tranx_m r768_m0" style="margin-bottom:5px;">
                <% if @product.homepage_url? %>
                <li class="inline-block">
                  <a href="<%= @product.homepage_url %>">
                    <%= inline_react_component 'Icon', icon: 'globe' %>
                    <%= URI(@product.homepage_url.downcase).host rescue 'invalid' %>
                  </a>
                </li>
                <% end %>
                <li class="inline-block ml1">
                  <a href="<%= product_repos_path(@product) %>">
                    <%= inline_react_component 'Icon', icon: 'github' %>
                    Code
                  </a>
                </li>
                <% if can?(:edit, @product) %>
                <li class="inline-block ml1">
                  <a href="<%= edit_product_path(@product) %>">
                    <%= inline_react_component 'Icon', icon: 'gear' %>
                    Edit product
                  </a>
                </li>
                <% end %>
              </ul>
            </div>
          </div>
          <div data-label="secondary" class="mcenter center valign-mid r768_table-cell r768_right-align" style="width:200px">
            <%= react_component('ProductFollowers', product_id: @product.id) %>
          </div>
        </div>
        <!--  -->

        <div class="tertiary clearfix">

          <ul class="nav nav-tabs r600_pl2 r600_float-left">
            <li class="<%= nav_active_class(:product) %>">
              <a class="px2 py2" href="<%= product_path(@product) %>">
                Activity
              </a>
            </li>

            <li class="<%= nav_active_class(:bounties) %>">
              <a class="px2 py2" href="<%= product_tasks_path(@product) %>">
                Bounties
              </a>
            </li>

            <li class="<%= nav_active_class(:posts) %>">
              <a class="px2 py2" href="<%= product_posts_path(@product) %>">
                Posts
              </a>
            </li>

            <li class="<%= nav_active_class(:assets) %> none r768_inline-block">
              <a class="px2 py2" href="<%= product_assets_path(@product) %>">
                Assets
              </a>
            </li>

            <% if @product.chat_rooms.any? %>
            <% chat_room = @product.chat_rooms.first %>
            <li class="<%= nav_active_class(:chat) %>">
              <a class="px2 py2" href="<%= chat_room_path(chat_room) %>">
                Chat
              </a>
            </li>
            <% end %>
          </ul>

          <script>
            var showCreateBounty = function() {
              window.analytics.track('product.wip.showed_bounty_modal', { product: "<%= @product.slug %>" });
              try {
                $('#create-bounty-modal').modal('show');
              } catch (e) {}

              React.render(
                CreateBounty({
                  id: 'create-bounty-modal',
                  product: { name: "<%= @product.name %>" },
                  url: "<%= product_wips_path(@product) %>",
                  maxOffer: <%= (6 * @product.average_bounty).round(-4) %>,
                  averageBounty: <%= @product.average_bounty %>,
                  coinsMinted: <%= @product.coins_minted %>,
                  profitLastMonth: <%= @product.profit_last_month %>,
                  steps: <%= BountyGuidance::Valuations.suggestions(@product) %>
                }),
                document.getElementById('create-bounty')
              );
            }
          </script>

          <div class="center-align mcenter dropdown pt2 pb2 w45 r600_float-right r600_pt0 r600_pb0 r600_mr2 r600_w35 r768_p0 r768_m0 r992_w45">
            <div class="pill-button-split">
              <% if nav_active?(:product) || nav_active?(:bounties) %>
                <a class="pill-button pill-button-theme-green pill-button-border" href="javascript:void(0);" onclick="javascript:showCreateBounty();">
                  <div class="title bold fs5 pr7 pill-button-text-shadow">Create <span class="r600_none r992_inline-block">a new</span> bounty</div>
                </a>
              <% elsif nav_active?(:posts) %>
                <a class="pill-button pill-button-theme-green pill-button-border" href="<%= new_product_post_path(@product) %>">
                  <div class="title bold fs5 pr7 pill-button-text-shadow">Create <span class="r600_none r992_inline-block">a new</span> post</div>
{'fraction_non_alphanumeric': 0.16102091788947862, 'fraction_numerical': 0.02294723696534499, 'mean_word_length': 1.8910198555956679, 'pattern_counts': {'":': 0, '<': 283, '<?xml version=': 0, '>': 283, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3203290', 'n_tokens_mistral': 4278, 'n_tokens_neox': 3748, 'n_words': 723}