text: function popUp() {
      var popUpBox = document.getElementById("popUp");
      var property = window.getComputedStyle(popUpBox).display;
      setTimeout(() => {
          if (property.toString() === "none") {
              popUpBox.style.display = "block";
              popUpBox.style.animationPlayState = "running";
              popUpBox.style.zIndex = 500;
          }
  
      }, 1000);
  
      var button = document.getElementById("btn-close");
  
      if (button) {
          button.onclick = () => {
              property = window.getComputedStyle(popUpBox).display;
              if (property.toString() === "block") {
                  popUpBox.style.display = "none";
                  popUpBox.style.zIndex = -15;
              }
  
          }
      }
  
  }
  
  // js code for availaibility
  
  function Active(clickValue) {
      localStorage.setItem("active", clickValue);
  
      if (clickValue.toString() === "0") {
          document.querySelectorAll(".btn-active").forEach((btn) => {
              btn.classList.add("btn-success");
          })
          document.querySelectorAll(".btn-unactive").forEach((btn) => {
              btn.classList.remove("btn-success");
          })
      } else {
          document.querySelectorAll(".btn-active").forEach((btn) => {
              btn.classList.remove("btn-success");
          })
          document.querySelectorAll(".btn-unactive").forEach((btn) => {
              btn.classList.add("btn-success");
          })
      }
  
  }
  
  var active = localStorage.getItem("active");
  
  if (!active) {
      active = 0;
  }
  
  if (active.toString() === "0") {
      document.querySelectorAll(".btn-active").forEach((btn) => {
          btn.classList.add("btn-success");
      })
      document.querySelectorAll(".btn-unactive").forEach((btn) => {
          btn.classList.remove("btn-success");
      })
  } else {
      document.querySelectorAll(".btn-active").forEach((btn) => {
          btn.classList.remove("btn-success");
      })
      document.querySelectorAll(".btn-unactive").forEach((btn) => {
          btn.classList.add("btn-success");
      })
  }
  
  
  
  (function($) {
      // USE STRICT
      "use strict";
      var navbars = ['header', 'aside'];
      var  hrefSelector  =  'a:not([target="_blank"]):not([href^="#"]):not([class^="chosen-single"])';
      var linkElement = navbars.map(element => element + ' ' + hrefSelector).join(', ');
      $(".animsition").animsition({
          inClass: 'fade-in',
          outClass: 'fade-out',
          inDuration: 900,
          outDuration: 900,
          linkElement: linkElement,
          loading: true,
          loadingParentElement: 'html',
          loadingClass: 'page-loader',
          loadingInner: '<div class="page-loader__spin"></div>',
          timeout: false,
          timeoutCountdown: 5000,
          onLoadEvent: true,
          browser: ['animation-duration', '-webkit-animation-duration'],
          overlay: false,
          overlayClass: 'animsition-overlay-slide',
          overlayParentElement: 'html',
          transition: function(url) {
              window.location.href = url;
          }
      });
  
  
  })(jQuery);
  
  (function($) {
      // Use Strict
      "use strict";
      try {
          var progressbarSimple = $('.js-progressbar-simple');
          progressbarSimple.each(function() {
              var that = $(this);
              var executed = false;
              $(window).on('load', function() {
  
                  that.waypoint(function() {
                      if (!executed) {
                          executed = true;
                          /*progress bar*/
                          that.progressbar({
                              update: function(current_percentage, $this) {
                                  $this.find('.js-value').html(current_percentage + '%');
                              }
                          });
                      }
                  }, {
                      offset: 'bottom-in-view'
                  });
  
              });
          });
      } catch (err) {
          console.log(err);
      }
  })(jQuery);
  (function($) {
      // USE STRICT
      "use strict";
  
      // Scroll Bar
      try {
          var jscr1 = $('.js-scrollbar1');
          if (jscr1[0]) {
              const ps1 = new PerfectScrollbar('.js-scrollbar1');
          }
  
          var jscr2 = $('.js-scrollbar2');
          if (jscr2[0]) {
              const ps2 = new PerfectScrollbar('.js-scrollbar2');
  
          }
  
      } catch (error) {
          console.log(error);
      }
  
  })(jQuery);
  (function($) {
      // USE STRICT
      "use strict";
  
      // Select 2
      try {
  
          $(".js-select2").each(function() {
              $(this).select2({
                  minimumResultsForSearch: 20,
                  dropdownParent: $(this).next('.dropDownSelect2')
              });
          });
  
      } catch (error) {
          console.log(error);
      }
  
  
  })(jQuery);
  (function($) {
      // USE STRICT
      "use strict";
  
      // Dropdown 
      try {
          var menu = $('.js-item-menu');
          var sub_menu_is_showed = -1;
  
          for (var i = 0; i < menu.length; i++) {
              $(menu[i]).on('click', function(e) {
                  e.preventDefault();
                  $('.js-right-sidebar').removeClass("show-sidebar");
                  if (jQuery.inArray(this, menu) == sub_menu_is_showed) {
                      $(this).toggleClass('show-dropdown');
                      sub_menu_is_showed = -1;
                  } else {
                      for (var i = 0; i < menu.length; i++) {
                          $(menu[i]).removeClass("show-dropdown");
                      }
                      $(this).toggleClass('show-dropdown');
                      sub_menu_is_showed = jQuery.inArray(this, menu);
                  }
              });
          }
          $(".js-item-menu, .js-dropdown").click(function(event) {
              event.stopPropagation();
          });
  
          $("body,html").on("click", function() {
              for (var i = 0; i < menu.length; i++) {
                  menu[i].classList.remove("show-dropdown");
              }
              sub_menu_is_showed = -1;
          });
  
      } catch (error) {
          console.log(error);
      }
  
      var wW = $(window).width();
      // Right Sidebar
      var right_sidebar = $('.js-right-sidebar');
      var sidebar_btn = $('.js-sidebar-btn');
  
      sidebar_btn.on('click', function(e) {
          e.preventDefault();
          for (var i = 0; i < menu.length; i++) {
              menu[i].classList.remove("show-dropdown");
          }
          sub_menu_is_showed = -1;
          right_sidebar.toggleClass("show-sidebar");
      });
  
      $(".js-right-sidebar, .js-sidebar-btn").click(function(event) {
          event.stopPropagation();
      });
  
      $("body,html").on("click", function() {
          right_sidebar.removeClass("show-sidebar");
  
      });
  
  
      // Sublist Sidebar
      try {
          var arrow = $('.js-arrow');
          arrow.each(function() {
              var that = $(this);
              that.on('click', function(e) {
                  e.preventDefault();
                  that.find(".arrow").toggleClass("up");
                  that.toggleClass("open");
                  that.parent().find('.js-sub-list').slideToggle("250");
              });
          });
  
      } catch (error) {
          console.log(error);
      }
  
  
      try {
          // Hamburger Menu
          $('.hamburger').on('click', function() {
              $(this).toggleClass('is-active');
              $('.navbar-mobile').slideToggle('500');
          });
          $('.navbar-mobile__list li.has-dropdown > a').on('click', function() {
              var dropdown = $(this).siblings('ul.navbar-mobile__dropdown');
              $(this).toggleClass('active');
              $(dropdown).slideToggle('500');
              return false;
          });
      } catch (error) {
          console.log(error);
      }
  })(jQuery);
  (function($) {
      // USE STRICT
      "use strict";
  
      // Load more
      try {
          var list_load = $('.js-list-load');
          if (list_load[0]) {
              list_load.each(function() {
                  var that = $(this);
                  that.find('.js-load-item').hide();
                  var load_btn = that.find('.js-load-btn');
                  load_btn.on('click', function(e) {
                      $(this).text("Loading...").delay(1500).queue(function(next) {
                          $(this).hide();
                          that.find(".js-load-item").fadeToggle("slow", 'swing');
                      });
                      e.preventDefault();
                  });
              })
  
          }
      } catch (error) {
          console.log(error);
      }
  
  })(jQuery);
  (function($) {
      // USE STRICT
      "use strict";
  
      try {
  
          $('[data-toggle="tooltip"]').tooltip();
  
      } catch (error) {
          console.log(error);
      }
  
      // Chatbox
      try {
          var inbox_wrap = $('.js-inbox');
          var message = $('.au-message__item');
          message.each(function() {
              var that = $(this);
  
              that.on('click', function() {
                  $(this).parent().parent().parent().toggleClass('show-chat-box');
              });
          });
  
  
      } catch (error) {
          console.log(error);
      }
  
  })(jQuery);