{% include 'header.twig' %}
<div class="top-padding"></div>
<body>
<div class="container-fluid paid">
  <div class="row">
    <div class="col-md-12">
      <div class="page-header-lgin">
        <div class="contpghdr">
          <span class="bdghdr threedblue">{{ site["site_name"] }}</span>
          <h2>OUR <span>SERVICES</span></h2>
          <p>Providing exceptional service worldwide with unmatched quality and reliability for all your needs.</p>
        </div>
        <img src="https://cdn.mypanel.link/edeed4/tcz91mw3qruabug1.png">
      </div>
    </div>
  </div>
</div>
<div class="container-fluid">
  <div class="row">
    <div class="col-lg-12">
      <div class="ordertopfeats servtopfeats">
        <div class="search">
          <form action="/services" method="get" id="history-search">
            <i class="fas fa-search searchico"></i>
            <input type="text" name="search" class="form-control" placeholder="Search by ID or Name" data-search-service="#service-table" id="searchService">
          </form>
        </div>
        <div class="servgroupflex">
          <ul class="servFiltr servFilterservpage" id="filtrButns">
            <li>
              <button class="CatFltr active" onclick="filterButton('')">
                <!--<i class="fas fa-list"></i>-->
                <!--<i class="fas fa-stream"></i>-->
                <img src="https://cdn.mypanel.link/edeed4/uq6ysp8dhde9nom7.webp">
              </button>
            </li>
            <li>
              <button class="CatFltr insta" onclick="filterButton('Instagram')">
                <!--<i class="fab fa-instagram"></i>-->
                <!--<i class="fab fa-instagram"></i>-->
                <img src="https://cdn.mypanel.link/edeed4/gnm8gc3t2xfu3ne4.webp">
              </button>
            </li>
            <li>
              <button class="CatFltr yt" onclick="filterButton('YouTube')">
                <!--<i class="fab fa-telegram"></i>-->
                <!--<i class="fab fa-youtube"></i>-->
                <img src="https://cdn.mypanel.link/edeed4/asyk7bbs7enfzxx6.webp">
              </button>
            </li>
            <li>
              <button class="CatFltr fb" onclick="filterButton('Facebook')">
                <!--<i class="fab fa-youtube"></i>-->
                <!--<i class="fab fa-facebook-f"></i>-->
                <img src="https://cdn.mypanel.link/edeed4/9s2a84ypmamsf3l7.webp">
              </button>
            </li>
            <li>
              <button class="CatFltr tt" onclick="filterButton('Tiktok')">
                <!--<i class="fab fa-tiktok"></i>-->
                <!--<i class="fab fa-tiktok"></i>-->
                <img src="https://cdn.mypanel.link/edeed4/zxip80wb23u197n7.webp">
              </button>
            </li>
            <li>
              <button class="CatFltr sndcld" onclick="filterButton('Twitter')">
                <!--<i class="fab fa-soundcloud"></i>-->
                <!--<i class="fab fa-soundcloud"></i>-->
                <img src="https://cdn.mypanel.link/edeed4/piolbbna6yuanfcy.webp">
              </button>
            </li>
            <li>
              <button class="CatFltr sndcld" onclick="filterButton('Whatsapp')">
                <!--<i class="fab fa-soundcloud"></i>-->
                <!--<i class="fab fa-soundcloud"></i>-->
                <img src="https://cdn.mypanel.link/edeed4/r9xlpte90imhwjbb.webp">
              </button>
            </li>
            <li>
              <button class="CatFltr sndcld" onclick="filterButton('Twitch')">
                <!--<i class="fab fa-soundcloud"></i>-->
                <!--<i class="fab fa-soundcloud"></i>-->
                <img src="https://cdn.mypanel.link/edeed4/0ee47wykk9a0ab07.webp">
              </button>
            </li>
            <li>
              <button class="CatFltr sndcld" onclick="filterButton('Discord')">
                <!--<i class="fab fa-soundcloud"></i>-->
                <!--<i class="fab fa-soundcloud"></i>-->
                <img src="https://cdn.mypanel.link/edeed4/2ugq4oa2x5pfdi1o.webp">
              </button>
            </li>
            <li>
              <button class="CatFltr sndcld" onclick="filterButton('Spotify')">
                <!--<i class="fab fa-soundcloud"></i>-->
                <!--<i class="fab fa-soundcloud"></i>-->
                <img src="https://cdn.mypanel.link/edeed4/xdrxbg7noys8a1iu.webp">
              </button>
            </li>
            <li>
              <button class="CatFltr sndcld" onclick="filterButton('Play Store')">
                <!--<i class="fab fa-soundcloud"></i>-->
                <!--<i class="fab fa-soundcloud"></i>-->
                <img src="https://cdn.mypanel.link/edeed4/xd9gfuyzwytcdo8f.webp">
              </button>
            </li>
            <li>
              <button class="CatFltr sndcld" onclick="filterButton('Google')">
                <!--<i class="fab fa-soundcloud"></i>-->
                <!--<i class="fab fa-soundcloud"></i>-->
                <img src="https://cdn.mypanel.link/edeed4/21jad99pwxbk8d4y.webp">
              </button>
            </li>
            <li>
              <button class="CatFltr sndcld" onclick="filterButton('Linked')">
                <!--<i class="fab fa-soundcloud"></i>-->
                <!--<i class="fab fa-soundcloud"></i>-->
                <img src="https://cdn.mypanel.link/edeed4/lxf9roo5g037knmp.webp">
              </button>
            </li>
          </ul>

          <ul class="nav nav-pills catfiltrserv ">
            <li>
              <div class="dropdown">
                <button class="btn btn-primary dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  <span class="far fa-sort-amount-down"></span> Filters
                </button>
                <ul class="dropdown-menu">
                                                      <div class="favcheck">
                    <input type="checkbox" id="favoritesCheckbox">
                    <label for="favoritesCheckbox">Favorites</label>
                  </div>
                                    <li>
                    <a class="dropdown-item" href="#" data-filter-category-id="All">All</a>
                  </li>
                  
                 </ul>
              </div>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="container-fluid">
  <div class="row">
    <div class="col-md-12">
      <div class="services-grid">
        <div class="catcatservhead hidden">
          <strong>Your Favorite Services</strong>
        </div>
<tbody>
  {% for category in serviceCategory %}
  <div class="catservhead" data-filter-table-category-id="{{ category['category_name'] }}">
    <strong>{{ category['category_name'] }}</strong>
  </div>
  {% for service in category['services'] %}
  <div class="servgridchilds" data-filter-table-category-id="{{ category['category_name'] }}">
    <div class="serv-grid-2">
      <span role="button" class="servfavbtn" data-favorite-service-id="{{ service['service_id'] }}">
        <span data-favorite-icon class="far fa-star"></span>
      </span>
      <div data-filter-table-service-id="{{ service['service_id'] }}">
  <b>{{ service['service_id'] }}</b> - {{ service['service_name'] }} - [ Min: {{ service['service_min'] }} ] [ Max:
  {{ service['service_max'] }} ]
  <button class="servcpybtn" id="copyButton{{ service['service_id'] }}" onclick="copyServiceId('{{ service['service_id'] }}')">
    <i class="fad fa-copy"></i>
  </button>
      </div>
    </div>
    
<script>
  function copyServiceId(serviceId) {
    // Create a temporary input element
    var tempInput = document.createElement("input");
    tempInput.value = serviceId;
    document.body.appendChild(tempInput);
    
    // Select the text in the input and copy it
    tempInput.select();
    document.execCommand("copy");
    
    // Remove the temporary input element after copying
    document.body.removeChild(tempInput);
    
    // Optionally, alert the user or provide feedback
    alert("Service ID " + serviceId + " copied to clipboard!");
  }
</script>
    
    <div class="serv-grid-2 grid-2-serv">
      <div class="serv-min"><i class="fad fa-layer-minus"></i> Min: <b>{{ service['service_min'] }}</b></div>
      <div class="serv-max"><i class="fad fa-layer-plus"></i> Max: <b>{{ service['service_max'] }}</b></div>
      <div class="avg-time"><i class="fad fa-hourglass-start"></i> Est. Speed: <b>Not enough data</b>
      </div>
    </div>
    <div class="refbadgegrp">
      <div id="instastart" class="iconsref">
        <i class="ti ti-run"></i> Instant
      </div>
      <div id="guranteeicon" class="iconsref">
        <i class="ti ti-shield-chevron"></i> Refill
      </div>
      <div id="canclicon" class="iconsref">
        <i class="ti ti-square-rounded-minus"></i> Cancel
      </div>
    </div>
    <div class="serv-grid-2">
      <span class="servicerate" data-toggle="tooltip" data-placement="top">
          
          {% if user["auth"] == "1" %} 
{{service["service_price"]}}/1K

{% else %}
{{service["without_login_service_price"]}}/1K
{% endif %}
</span>
      <a data-href="/?select_service_id={{ service['service_id'] }}"
        onclick="window.location.href='/?select_service_id={{ service['service_id'] }}';" class="btnbuyserv">View /
        Buy</a>
    </div>
  </div>
  {% endfor %}
  {% endfor %}
</tbody>


        
        
        </div>
  </div>
  </div></div>
</div>


    <!-- Modal -->
    <div
      id="dripfeedModal"
      class="modal fade"
      tabindex="-1"
      role="dialog"
      aria-labelledby="dripfeedModallabel"
    >
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button
              type="button"
              class="close"
              data-dismiss="modal"
              aria-label="Close"
            >
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title" id="onboardingModalLabel">
              How do I turn on drip feed?
            </h4>
          </div>
          <div class="modal-body">
            <div class="swiper-container">
              <div class="swiper-wrapper">
                <div class="swiper-slide">
                  <div>Slide 1 Content</div>
                  <button class="btn btn-primary btn-next">Okay, next</button>
                </div>
                <div class="swiper-slide">
                  <div>Slide 2 Content</div>
                  <button class="btn btn-primary btn-next">Okay, next</button>
                </div>
                <div class="swiper-slide">
                  <div>Slide 3 Content</div>
                  <button class="btn btn-primary btn-next">Okay, next</button>
                </div>
                <div class="swiper-slide">
                  <div>Slide 4 Content</div>
                  <button class="btn btn-success btn-close">Close</button>
                </div>
              </div>
              <!-- Add Pagination -->
              <div class="swiper-pagination"></div>
            </div>
            <a href="#" class="btn btn-link">What is Drip Feed?</a>
          </div>
        </div>
      </div>
    </div>

    <!-- Subscription Modal -->
    <div
      id="subscriptionModal"
      class="modal modalfaqs fade"
      tabindex="-1"
      role="dialog"
      aria-labelledby="subscriptionModallabel"
    >
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button
              type="button"
              class="close"
              data-dismiss="modal"
              aria-label="Close"
            >
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title" id="subscriptionModalLabel">
              How do I subscribe?
            </h4>
          </div>
          <div class="modal-body">
            <div class="swiper-container-subscription">
              <div class="swiper-wrapper">
                <div class="swiper-slide">
                  <div>
                    <div class="steps">
                      <span class="numstep">1</span>
                      <div>
                        <h2>Step 1</h2>
                        <p>Choose the service according to your daily needs.</p>
                      </div>
                    </div>
                    <div class="steps">
                      <span class="numstep">2</span>
                      <div>
                        <h2>Step 2</h2>
                        <p>
                          Put your Social Media Profile Link ( Note : It must be
                          Public else we cannot fetch the new post links )
                        </p>
                      </div>
                    </div>
                  </div>
                  <button class="btn btn-nxt btn-next-subscription">
                    Okay, next
                  </button>
                </div>
                <div class="swiper-slide">
                  <div>
                    <div class="steps">
                      <span class="numstep">3</span>
                      <div>
                        <h2>Step 3</h2>
                        <p>
                          Put an Minimum and Maximum Quantity of Engagement you
                          want in your daily posts.
                        </p>
                      </div>
                    </div>
                    <div class="steps">
                      <span class="numstep">4</span>
                      <div>
                        <h2>Step 4</h2>
                        <p>Set an Expiry Date where the Campaign will End.</p>
                      </div>
                    </div>
                  </div>
                  <button class="btn btn-nxt btn-next-subscription">
                    Okay, next
                  </button>
                </div>
                <div class="swiper-slide">
                  <div>
                    <div class="recsub">
                      <span class="redrec">Recommendation</span>
                      <p>
                        Maintain an healthy wallet balance so that we can work
                        automatically with your new posts. Else the campaign
                        will be paused due to insufficient wallet balance.
                      </p>
                    </div>
                    <button class="btn btn-faqscls btn-close-subscription">
                      Close
                    </button>
                  </div>
                </div>
              </div>
              <div class="swiper-pagination-subscription"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
  


	</body>
{% include 'footer.twig' %}


<script>
    $(document).ready(function () {
        // Initialize the selectpicker
        $("#payment_type").selectpicker();
    
        // Iterate through each option and add images and text to data-content
        $("#payment_type option").each(function () {
            let imgTag = '';
            if ($(this).text().includes("Phonepe")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198327/20240924_223703_pe2sud.jpg" class="img_addfunds" alt="img"> `;
            } else if ($(this).text().includes("Paytm")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198419/20240924_221314_nslulx.jpg" class="img_addfunds" alt="img"> `;
            } else if ($(this).text().includes("Gpay")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198289/20240924_224558_f2bmbh.jpg" class="img_addfunds" alt="img"> `;
            } else if ($(this).text().includes("Easypaisa")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198400/20240924_221530_sqtl7b.jpg" class="img_addfunds" alt="img"> `;
            } else if ($(this).text().includes("Jazzcash")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198455/20240924_221921_z38j0o.jpg" class="img_addfunds" alt="img"> `;
            } else if ($(this).text().includes("BKASH / NAGAD / ROCKET")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198364/20240924_223320_nbjjlr.jpg" class="img_addfunds" alt="img"> `;
            } else if ($(this).text().includes("Gcash")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198385/20240924_223441_t1ik2q.jpg" class="img_addfunds" alt="img"> `;
            } else if ($(this).text().includes("Binance")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198339/20240924_223229_dovzsv.jpg" class="img_addfunds" alt="img"> `;
            } else if ($(this).text().includes("Perfect Money")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198432/20240924_222700_fkb3fh.jpg" class="img_addfunds" alt="img"> `;
            } else if ($(this).text().includes("Crypto")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198303/20240924_224352_a6ief6.jpg" class="img_addfunds" alt="img"> `;
            } else if ($(this).text().includes("MasterCard")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198351/20240924_224525_n76acb.jpg" class="img_addfunds" alt="img"> `;
            } else if ($(this).text().includes("Voucher System")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727199101/20240924_230030_xkw7j2.jpg" class="img_addfunds" alt="img"> `;
            } else if ($(this).text().includes("PayPal")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198317/20240924_224450_hchxcz.jpg" class="img_addfunds" alt="img"> `;
            }
        
            else if ($(this).text().includes("Bkash | Nagad | Rocket")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198364/20240924_223320_nbjjlr.jpg" class="img_addfunds" alt="img"> `;
            }

            else if ($(this).text().includes("Touch n Go Manual")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198408/20240924_223356_ka6rtv.jpg" class="img_addfunds" alt="img"> `;
            }

            else if ($(this).text() == "Easypaisa Jazzcash Bank" || $(this).text().includes("Easypaisa Jazzcash Bank")) {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727198374/20240924_222306_ca4zml.jpg" class="img_addfunds" alt="img"> `;
            }

             else {
                imgTag = `<img src="https://res.cloudinary.com/dzogqeqlt/image/upload/v1727199531/20240924_230645_frqfzz.jpg" class="img_addfunds" alt="img"> `;
            }
    
            // Set the data-content attribute for each option
            $(this).attr('data-content', imgTag + $(this).text());
        });
    
        // Refresh the selectpicker to reflect changes
        $("#payment_type").selectpicker("refresh");
    });
    </script>
<script
    type="text/javascript"
    src="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"
  ></script>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script>
    if(document.getElementsByClassName('status_checker')){
     
        function checkStatus() {
            const input = document.getElementById('u-statusInput').value.toLowerCase();
            const statusCard = document.getElementById('u-statusCard');
            const getInfoBtn = document.getElementById('getInfoBtn');

            if (!input) {
                statusCard.textContent = "Please enter a valid input.";
                statusCard.className = 'u-card failure';
                statusCard.style.display = 'block';
                return;
            }

            // Disable button and show loading state
            getInfoBtn.disabled = true;
            getInfoBtn.textContent = "Loading...";

            const post_data = `actionType=verify-spam-check&apiKey=&id=2331&link=${encodeURIComponent(input)}`;
            const xhttp = new XMLHttpRequest();

            xhttp.onreadystatechange = function () {
                if (this.readyState === 4) {
                    getInfoBtn.disabled = false;
                    getInfoBtn.textContent = "Get Info";

                    if (this.status === 200) {
                        try {
                            const data = JSON.parse(this.responseText);

                            if (data.success === 1) {
                                statusCard.textContent = `Spam filter is off.`;
                                statusCard.className = 'u-card';
                            } else {
                                if (data.message === "private_account") {
                                    statusCard.textContent = "The account is private";
                                } else if (data.message === "Spam Filter is not disabled yet.") {
                                    statusCard.textContent = "Spam filter is on.";
                                } else {
                                    statusCard.textContent = data.message || "Unknown error occurred.";
                                }

                                statusCard.className = 'u-card failure';
                            }
                        } catch (error) {
                            statusCard.textContent = `Error parsing response: ${error.message}`;
                            statusCard.className = 'u-card failure';
                        }
                    } else {
                        statusCard.textContent = `Error: Unable to complete the request. Status ${this.status}`;
                        statusCard.className = 'u-card failure';
                    }

                    statusCard.style.display = 'block';
                }
            };

            xhttp.open("POST", '/api', true);
            xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
            xhttp.send(post_data);
        }

        // Function to fetch followers count
        function fetchFollowers() {
            const input = document.getElementById('u-userInput').value.toLowerCase();
            const userCard = document.getElementById('u-userCard');
            const fetchButton = document.querySelector('#u-rightBox button');

            if (!input) {
                userCard.textContent = "Please enter a valid username or link.";
                userCard.className = 'u-card failure';
                userCard.style.display = 'block';
                return;
            }

            // Disable button and show loading state
            fetchButton.disabled = true;
            fetchButton.textContent = "Loading...";

            const xhttp = new XMLHttpRequest();
            xhttp.onreadystatechange = function () {
                if (this.readyState === 4) {
                    fetchButton.disabled = false;
                    fetchButton.textContent = "Get Info";

                    if (this.status === 200) {
                      
                        try {
                            const data = JSON.parse(this.responseText);
                           
                            if (data) {
                                const details = data.profile_data;
                             
                                userCard.innerHTML = `
                                       <p><strong>Full Name:</strong> ${details.full_name}</p>
                                       <p><strong>Followers:</strong> ${details.followers}</p>
                                   `;
                                userCard.className = 'u-card';
                            } else {
                                if (data.message === "private_account") {
                                    userCard.textContent = "The account is private";
                                } else if (data.message === "Spam Filter is not disabled yet.") {
                                    userCard.textContent = "Spam filter is on.";
                                } else {
                                    userCard.textContent = data.message || "Unknown error occurred.";
                                }
                                userCard.className = 'u-card failure';
                            }
                        } catch (error) {
                            userCard.textContent = `Error parsing response: ${error.message}`;
                            userCard.className = 'u-card failure';
                        }
                    } else {
                        userCard.textContent = `Error: Unable to complete the request. Status ${this.status}`;
                        userCard.className = 'u-card failure';
                    }

                    userCard.style.display = 'block';
                }
            };

            const post_data = `actionType=verify-spam-check&apiKey=&id=2331&link=${encodeURIComponent(input)}`;


            xhttp.open("POST", '/api', true);
            xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
            xhttp.send(post_data);
        }

    }
$(window).on("scroll", function () {
            if ($(window).scrollTop()) {
                $('nav').addClass('black')
            } else {
                $('nav').removeClass('black')
            }
        });
$(window).on("scroll", function() {
            if ($(this).scrollTop() > 200) {
                $(".scroll-to-top").fadeIn(200);
            } else {
                $(".scroll-to-top").fadeOut(200);
            }
        });

        // Animate the scroll to top
        $(".scroll-to-top").on("click", function(event) {
            event.preventDefault();
            $("html, body").animate({scrollTop: 0}, 300);
        });

        var lastTouchEnd = 0;
        document.addEventListener('touchend', function (event) {
            var now = (new Date()).getTime();
            if (now - lastTouchEnd <= 300) {
                event.preventDefault();
            }
            lastTouchEnd = now;
        }, false);

        document.addEventListener('touchmove', function (event) {
            if (event.scale !== 1) { 
                event.preventDefault(); 
            }
        }, false); 
</script> 
<script>
					if( (self.parent && !(self.parent===self))
						&&(self.parent.frames.length!=0)){
						self.parent.location=document.location
					}
					</script>

<script>;
		
function fn60sec() {
var xhttp = new XMLHttpRequest();xhttp.onreadystatechange = function() 
{if (this.readyState == 4 && this.status == 200) {console.log("Yes");}};xhttp.open("GET", "check-auth", true);xhttp.setRequestHeader("Content-type", "application/json");xhttp.send();
}
(function() {

$(".placeorder-btn").click(function(e) {
var href= e.currentTarget.dataset.href;
window.location.href = href;
});

})();
</script>
<script>
  function filterButton(searchTerm){
    $("#searchService").val(searchTerm);
    $( "#searchService" ).keyup();
  }
</script>
<script>
  // Wait for the DOM to be ready
  $(document).ready(function() {
    // Add an event listener to the search input field
    $('#searchService').on('keyup', function() {
      var searchKeyword = $(this).val().toLowerCase();

      // Loop through all .servgridchilds elements and filter based on the searchKeyword
      $('.servgridchilds').each(function() {
        var serviceName = $(this).find('[data-filter-table-service-id]').text().toLowerCase();

        if (serviceName.includes(searchKeyword)) {
          $(this).show(); // Show the element if the keyword is found
        } else {
          $(this).hide(); // Hide the element if the keyword is not found
        }
      });

      // Loop through all .catservhead elements
      $('.catservhead').each(function() {
        var categoryId = $(this).data('filter-table-category-id');
        // Check if any .servgridchilds with the same category ID is visible
        var hasVisibleServices = $('.servgridchilds[data-filter-table-category-id="' + categoryId + '"]').filter(':visible').length > 0;

        if (hasVisibleServices) {
          $(this).show(); // Show the category header if any child is visible
        } else {
          $(this).hide(); // Hide the category header if no child is visible
        }
      });
    });
  });
</script>
<script>
        document.getElementById('copyButton{{ service['service_id'] }}').addEventListener('click', function () {
          var serviceID = '{{ service['service_id'] }}';
          var tempTextArea = document.createElement('textarea');
          tempTextArea.value = serviceID;
          document.body.appendChild(tempTextArea);
          tempTextArea.select();
          tempTextArea.setSelectionRange(0, 99999);
          document.execCommand('copy');
          document.body.removeChild(tempTextArea);
          alert('Copied: ' + serviceID);
        });
      </script>
<script>
  document.addEventListener('DOMContentLoaded', function () {
    // Event listener for category dropdown items
    document.querySelectorAll('.dropdown-item[data-filter-category-id]').forEach(function (item) {
      item.addEventListener('click', function (event) {
        event.preventDefault();

        // Get the selected category ID and name
        var selectedCategoryId = this.getAttribute('data-filter-category-id');
        var selectedCategoryName = this.getAttribute('data-filter-category-name');

        // Update the active category name in the button
        document.querySelector('[data-filter-active-category]').textContent = this.textContent;

        // Show/Hide services based on the selected category ID or name
        document.querySelectorAll('.servgridchilds').forEach(function (serviceItem) {
          if (selectedCategoryId === 'All' || 
              serviceItem.getAttribute('data-filter-table-category-id') === selectedCategoryId || 
              serviceItem.getAttribute('data-filter-table-category-name') === selectedCategoryName) {
            serviceItem.classList.remove('hidden');
          } else {
            serviceItem.classList.add('hidden');
          }
        });

        // Show/Hide category headers based on the selected category ID or name
        document.querySelectorAll('.catservhead').forEach(function (categoryHeader) {
          if (selectedCategoryId === 'All' || 
              categoryHeader.getAttribute('data-filter-table-category-id') === selectedCategoryId || 
              categoryHeader.getAttribute('data-filter-table-category-name') === selectedCategoryName) {
            categoryHeader.classList.remove('hidden');
          } else {
            categoryHeader.classList.add('hidden');
          }
        });
      });
    });

    // Event listener for favorites filter
    document.querySelectorAll('.dropdown-item[data-filter-attribute="favorites"]').forEach(function (item) {
      item.addEventListener('click', function (event) {
        event.preventDefault();

        // Update the active category name in the button
        document.querySelector('[data-filter-active-category]').textContent = this.textContent;

        // Show/Hide services based on the favorite attribute
        document.querySelectorAll('.servgridchilds, .catservhead').forEach(function (serviceItem) {
          if (serviceItem.hasAttribute('favorite')) {
            serviceItem.classList.remove('hidden');
          } else {
            serviceItem.classList.add('hidden');
          }
        });

        // Hide all category headers when filtering by favorites
        document.querySelectorAll('.catservhead').forEach(function (categoryHeader) {
          categoryHeader.classList.add('hidden');
        });
      });
    });
  });
</script>
<script>
  document.addEventListener('DOMContentLoaded', function () {
    // Event listener for clicking on the div with class 'favcheck'
    document.addEventListener('click', function (event) {
      if (event.target.closest('.favcheck')) {
        // Prevent default  to stop the dropdown from closing
        event.preventDefault();

        // Toggle the checkbox
        var checkbox = document.getElementById('favoritesCheckbox');
        if (checkbox) {
          checkbox.checked = !checkbox.checked;

          // Trigger the change event on the checkbox to apply filtering
          var changeEvent = new Event('change');
          checkbox.dispatchEvent(changeEvent);
        }
      }
    });

    // Event listener for the checkbox
    var favoritesCheckbox = document.getElementById('favoritesCheckbox');
    if (favoritesCheckbox) {
      favoritesCheckbox.addEventListener('change', function (event) {
        // Hide all grid elements that don't have the 'favorite' class
        var gridItems = document.querySelectorAll('.servgridchilds');
        for (var i = 0; i < gridItems.length; i++) {
          if (!gridItems[i].classList.contains('favorite')) {
            gridItems[i].style.display = this.checked ? 'none' : '';
          }
        }
      });
    }
  });
</script>
<script>
  // Event listener for clicking on the div with class 'favcheck'
  document.querySelector('.favcheck').addEventListener('click', function () {
    // Toggle the 'hidden' class on all elements with class 'catservhead' and 'catcatservhead'
    document.querySelectorAll('.catservhead, .catcatservhead').forEach(function (item) {
      item.classList.toggle('hidden');
    });
  });
</script>
<script>
  document.addEventListener("DOMContentLoaded", function() {
    // Function to get the value of a URL parameter
    function getParameterByName(name) {
      const urlParams = new URLSearchParams(window.location.search);
      return urlParams.get(name);
    }

    // Get the 'serv' parameter value
    const servValue = getParameterByName('serv');

    // Set the value to the input field with id 'searchService'
    if (servValue) {
      const searchServiceInput = document.getElementById('searchService');
      if (searchServiceInput) {
        searchServiceInput.value = servValue;
      }
    }
    setTimeout(function(){
      $( "#searchService" ).keyup();
    }, 10);
  });
</script>
<script>
      document.addEventListener('DOMContentLoaded', function() {
          change_cat(); 
      
      
          document.getElementById('orderCategory').addEventListener('change', function() {
              change_cat();
          });
      
          document.getElementById('OrderService').addEventListener('load', function() {
              let service_ID = this.getAttribute('data-id');
              addon_details(service_ID);
          });
      });
      
        </script>

<script>
      function getUrlParameter(sParam) {
        var sPageURL = decodeURIComponent(window.location.search.substring(1));
        var sURLVariables = sPageURL.split("&");
        var sParameterName;
        var i;
        for (i = 0; i < sURLVariables.length; i++) {
          sParameterName = sURLVariables[i].split("=");
          if (sParameterName[0] === sParam) {
            return sParameterName[1] === undefined ? true : sParameterName[1];
          }
        }
      }

      var select_service_id = getUrlParameter("buy");
      if (select_service_id) {
        var selectSerCatID =
          window.modules.siteOrder.services[select_service_id].cid;
        let orderCat = document.getElementById("orderCategory");
        let orderSer = document.getElementById("OrderService");

        $(function () {
          orderCat.querySelector("[selected]").removeAttribute("selected");
          console.log(selectSerCatID);
          orderCat
            .querySelector('[value="' + selectSerCatID + '"]')
            .setAttribute("selected", "selected");
          orderCat.value = selectSerCatID;

          var event = document.createEvent("HTMLEvents");
          event.initEvent("change", true, false);
          orderCat.dispatchEvent(event);

          setTimeout(() => {
            let controlSel = orderSer.querySelector("[selected]");
            if (controlSel) {
              controlSel.removeAttribute("selected");
            }
            console.log(select_service_id);
            orderSer
              .querySelector('[value="' + select_service_id + '"]')
              .setAttribute("selected", "selected");
            orderSer.value = select_service_id;
            orderSer.dispatchEvent(event);
          }, 500);
        });
      }
    </script>

