// source --> https://ink-my-tattoo.com/wp-content/themes/hubhood/assets/js/ajax-pagination.js?ver=93c8a1cf73d48b00a939fcbac0c8fbee 
/* Set '$' (from jQuery) to its existing value (if present) */

window.$ = window.$ || {};

( function ( $ ) {
    $( function () {

        // The current page of comments
        var page = 1;

        var
            theDocument = $( document ),
            theBody = $( 'body' );

        var
            theHTML = theDocument.find( 'html' ).eq( 0 );
        
        var        
            htmlAndBody = theHTML.add( theBody );

        // Handle clicks on pagination links
        $( 'body' ).on('click', '.hubhood-comments-navigation a', function(e) {
            e.preventDefault();
            page = $(this).data('page');

            $( '#cancel-comment-reply-link' ).each( function () {
                $( this )[0].click();
            } );

            $( '#comments' ).css( { opacity: 0.35 } );

            if ( $( '.hubhood-listing-single-reviews .hubhood-section-title' ).length ) {
                setTimeout( function () {
                    htmlAndBody.stop().animate( {
                        scrollTop : $( '.hubhood-listing-single-reviews .hubhood-section-title' ).offset().top - 140
                    }, 1 );
                }, 20 );                
            } else {
                $( '.hubhood-listing-single-reviews' ).css( { opacity: 0.4 } );

                setTimeout( function () {
                    htmlAndBody.stop().animate( {
                        scrollTop : $( '#comments .comments-title' ).offset().top - 110
                    }, 1 );
                }, 20 );
            }

            // Send AJAX request to get the next page of comments
            $.ajax({
            url: ajaxpagination.ajaxurl,
            type: 'post',
            data: {
                action: 'ajax_pagination',
                page: page,
                id: ajaxpagination.the_page_id
            },
            success: function(response) {
                // Update the comments section with the new comments
                $('.comment-list').html(response);

                $( '#comments' ).css( { opacity: 1 } );

                // Update the pagination buttons
                updatePaginationButtons();
            },
            error: function() {
                console.log('Error');
            }
            });
        });

        // Update the pagination buttons
        function updatePaginationButtons() {
            // Get the total number of pages
            var totalPages = parseInt($('.comment-pagination').data('total-pages'));

            // Remove the old pagination buttons
            $('.comment-pagination a, .comment-pagination span').remove();

            // Add new pagination buttons
            for (var i = 1; i <= totalPages; i++) {
                if (i === page) {
                    $('.comment-pagination').append('<span aria-current="page" class="page-numbers current">' + i + '</span>');
                } else {
                    $('.comment-pagination').append('<a href="#" class="page-numbers" data-page="' + i + '">' + i + '</a>');
                }
            }
        }

        // Update the pagination buttons when the page loads
        updatePaginationButtons();
        
        
    } );
} )( jQuery );
// source --> https://ink-my-tattoo.com/wp-content/plugins/mycred/addons/badges/assets/js/front.js?ver=1.3 
jQuery(document).ready(function(){

    //Badges Search Filter
    jQuery("#mycerd-badges-search").on("keyup", function() {
        var value = jQuery(this).val().toLowerCase();
        jQuery(".mycred-badges-list .mycred-badges-list-item").filter(function() {
            jQuery(this).toggle(jQuery(this).text().toLowerCase().indexOf(value) > -1)
        });
    });

    //Show Achieved Badges
    jQuery(document).on( 'click', '.mycred-achieved-badge-btn', function(e){
        e.preventDefault();
        jQuery('.not-earned').hide();
        jQuery('.earned').show();
    });

    //Show Not Achieved Badges
    jQuery(document).on( 'click', '.mycred-not-achieved-badge-btn', function(e){
        e.preventDefault();
        jQuery('.earned').hide();
        jQuery('.not-earned').show();
    });

    //Clear Filter Button
    jQuery(document).on( 'click', '.mycred-clear-filter-btn', function(e){
        e.preventDefault()
        jQuery('.earned').show();
        jQuery('.not-earned').show();
        jQuery('#mycerd-badges-search').val('');
    } )
});
// source --> https://ink-my-tattoo.com/wp-content/plugins/luckywp-table-of-contents/front/assets/main.min.js?ver=2.1.14 
!function(){var o,l,n,e,g,m=function(t,e){var i,n={};for(i in t)n[i]=t[i];for(i in e)n[i]=e[i];return n},t=function(t){return t},c=(o={duration:300,action:"close",startTime:null,startHeight:null,endHeight:null,easing:t},l=function(e,i){cancelAnimationFrame(e.getAttribute("data-lwptoc-animation-request-id")),e.setAttribute("data-lwptoc-animation-request-id",window.requestAnimationFrame(function(t){n(e,i,t)}))},n=function(t,e,i){e.startTime||(e.startTime=i);var n,o=i-e.startTime;o<e.duration?(t.style.height=((e.endHeight-e.startingHeight)*e.easing(o/e.duration)+e.startingHeight).toFixed(2)+"px",l(t,e)):("close"===e.action&&(t.style.display="none"),"open"===e.action&&(t.style.display="block"),(n=t).style.height=null,n.style.overflow=null)},function(t,e){if(window.requestAnimationFrame){var i=m(o,{});i.action=e,t.style.height?i.startingHeight=parseFloat(t.style.height):i.startingHeight="close"===e?t.scrollHeight:0,(n=t).style.display="block",n.style.overflow="hidden",i.endHeight="close"===e?0:(t.style.height="0px",t.scrollHeight),l(t,i)}else t.style.display="close"===e?"none":"block";var n}),a=function(t){for(var e,i=document.querySelectorAll('[id="'+t+'"]'),n=0;n<i.length;n++)if((e=i[n]).offsetWidth||e.offsetHeight||e.getClientRects().length)return i[n];return null},i=(e={offset:0,duration:500,easing:t,onComplete:function(t,e){}},g=function(t,e){var i=t.getBoundingClientRect().top+window.pageYOffset-e;return i<0?0:i},function(o,t){var l,a=m(e,t);if(window.requestAnimationFrame&&"smooth"!==window.getComputedStyle(document.getElementsByTagName("HTML")[0]).scrollBehavior){var r,s,c=window.pageYOffset,d=null,u=function(t){l=g(o,a.offset),r=l-c;var e=window.pageYOffset;if(!s||!(0<r&&e<s||r<0&&s<e)){s=e,d||(d=t-1);var i=t-d,n=((l-c)*a.easing(i/a.duration)+c).toFixed();window.scroll(0,n),i<a.duration?window.requestAnimationFrame(u):(window.scroll(0,l),a.onComplete(0,l))}};window.requestAnimationFrame(u)}else l=g(o,a.offset),window.scroll(0,l),a.onComplete(0,l)}),u={scrollTo:function(t,e){i(t,e)},registerScrollTrigger:function(t,i){for(var e=0;e<t.length;e++)t[e].addEventListener("click",function(t){t.preventDefault();var e=this.getAttribute("href"),c=e.substring(1),d=a(c);d&&(e!==document.location.hash&&(i.onComplete=function(t,e){var i,n,o,l,a,r,s;d.setAttribute("id",""),i=c,n=t,o=e,(s=document.createElement("a")).setAttribute("id",i),s.setAttribute("style","position:absolute;visibility:hidden;left:"+n+"px;top:"+o+"px;"),l=document.body,a=s,l.prepend?l.prepend(a):l.insertBefore(a,l.firstChild),document.location.hash=i,(r=s).remove?r.remove():r.parentNode.removeChild(r),d.setAttribute("id",c)}),u.scrollTo(d,i))})},init:function(t){if("1"!==t.getAttribute("data-lwptoc-initialized")){t.setAttribute("data-lwptoc-initialized","1");var a,r=t.getElementsByClassName("lwptoc_toggle_label")[0],s=t.getElementsByClassName("lwptoc_items")[0];if(r)r.addEventListener("click",function(t){var e,i,n,o,l;t.preventDefault(),a=r.getAttribute("data-label"),r.setAttribute("data-label",r.innerHTML),r.innerHTML=a,l="lwptoc_items-visible",-1<(" "+s.className+" ").indexOf(" "+l+" ")?(o="lwptoc_items-visible",(n=s).className=(" "+n.className+" ").replace(" "+o+" ","").trim(),c(s,"close")):(i="lwptoc_items-visible",(e=s).className=e.className.trim()+" "+i,c(s,"open"))});"1"===t.getAttribute("data-smooth-scroll")&&u.registerScrollTrigger(s.getElementsByTagName("A"),{offset:t.getAttribute("data-smooth-scroll-offset")})}},globalInit:function(){for(var t=document.getElementsByClassName("lwptoc"),e=0;e<t.length;e++)u.init(t[e])}};window.lwptoc=u,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",u.globalInit):u.globalInit()}();