/*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */
jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
var stacks = {};
stacks.jQuery = jQuery.noConflict(true);
stacks.stacks_in_8 = {};
stacks.stacks_in_8 = (function(stack) {
var jQuery = stacks.jQuery;var $ = jQuery;//
if(window.liveSearchDefined == null) {
  window.liveSearchDefined = true;
/*
  Tipue Search 5.0
  Copyright (c) 2015 Tipue
  Tipue Search is released under the MIT License
  http://www.tipue.com/search
  */

/* Tipue Search Copyright (c) 2015 Tipue

  Permission is hereby granted, free of charge, to any person obtaining
  a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including
  without limitation the rights to use, copy, modify, merge, publish,
    distribute, sublicense, and/or sell copies of the Software, and to
    permit persons to whom the Software is furnished to do so, subject to
    the following conditions:

  The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
      */
  var tipuesearch_pages = [];
  var tipuesearch_stop_words = ["zzzzzz"];
  //var tipuesearch_stop_words = ["a", "about", "above", "after", "again", "against", "all", "am", "an", "and", "any", "are", "aren't", "as", "at", "be", "because", "been", "before", "being", "below", "between", "both", "but", "by", "can't", "cannot", "could", "couldn't", "did", "didn't", "do", "does", "doesn't", "doing", "don't", "down", "during", "each", "few", "for", "from", "further", "had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he", "he'd", "he'll", "he's", "her", "here", "here's", "hers", "herself", "him", "himself", "his", "how", "how's", "i", "i'd", "i'll", "i'm", "i've", "if", "in", "into", "is", "isn't", "it", "it's", "its", "itself", "let's", "me", "more", "most", "mustn't", "my", "myself", "no", "nor", "not", "of", "off", "on", "once", "only", "or", "other", "ought", "our", "ours", "ourselves", "out", "over", "own", "same", "shan't", "she", "she'd", "she'll", "she's", "should", "shouldn't", "so", "some", "such", "than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", "this", "those", "through", "to", "too", "under", "until", "up", "very", "was", "wasn't", "we", "we'd", "we'll", "we're", "we've", "were", "weren't", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "who's", "whom", "why", "why's", "with", "won't", "would", "wouldn't", "you", "you'd", "you'll", "you're", "you've", "your", "yours", "yourself", "yourselves"];
  // Word replace
  var tipuesearch_replace = {'words': [
    {'word': 'tipua', 'replace_with': 'tipue'},
    {'word': 'javscript', 'replace_with': 'javascript'},
    {'word': 'jqeury', 'replace_with': '$'}
  ]};
  // Weighting
  var tipuesearch_weight = {'weight': [
    {'url': 'http://tipue.dev/search', 'score': 200},
    {'url': 'http://tipue.dev/about', 'score': 100},
    {'url': 'http://tipue.dev/tos', 'score': -1200}
  ]};
  // Stemming
  var tipuesearch_stem = {'words': [
    {'word': 'e-mail', 'stem': 'email'},
    {'word': 'javascript', 'stem': 'jQuery'},
    {'word': 'javascript', 'stem': 'js'}
  ]};

  //
  var tipuesearch_string_1 = 'No title';
  var tipuesearch_string_2 = 'Showing results for';
  var tipuesearch_string_3 = 'Search instead for';
  var tipuesearch_string_4 = '1 result';
  var tipuesearch_string_5 = 'results';
  var tipuesearch_string_6 = 'Prev';
  var tipuesearch_string_7 = 'Next';
  var tipuesearch_string_8 = 'Nothing found';
  var tipuesearch_string_9 = 'Common words are largely ignored';
  var tipuesearch_string_10 = 'Search too short';
  var tipuesearch_string_11 = 'Should be one character or more';
  var tipuesearch_string_12 = 'Should be 2 characters or more';
  var tipuesearch_string_13 = 'characters or more';
  //

  //

  //Tipue Search

  /*
  Tipue Search 5.0
  Copyright (c) 2015 Tipue
  Tipue Search is released under the MIT License
  http://www.tipue.com/search
  */


  (function($) {

    $.fn.tipuesearch = function(options) {

      var set = $.extend( {

        'show'                   : 7,
        'newWindow'              : false,
        'showURL'                : true,
        'showTitleCount'         : true,
        'minimumLength'          : 3,
        'descriptiveWords'       : 25,
        'highlightTerms'         : true,
        'highlightEveryTerm'     : false,
        'mode'                   : 'static',
        'liveDescription'        : '*',
        'liveContent'            : '*',
        'contentLocation'        : 'tipuesearch/tipuesearch_content.json',
        'debug'                  : false,
        'thisId'                 : 0

      }, options);

      return this.each(function() {

        var tipuesearch_in = {
          pages: []
        };
        $.ajaxSetup({
          async: true//modified from false
        });
        var tipuesearch_t_c = 0;

        //if (set.mode == 'live') {
  			function buildIndex() {
          //$.each(tipuesearch_pages, function(index, value) {
          var promises = [];
          $(".tipue_search_loading .ts-count-wrap .ts-total").html(tipuesearch_pages.length);
          $.each(tipuesearch_pages, function(index, val) {
            let thisUrl = this.replace(/#/g,"?LSHASH");
            promises.push($.get(thisUrl).always(function(html) {
  						let value = this.url;
              value = value.replace(/\?LSHASH/g,"#");
              window.customDesc = 0;
              var noSearch, cont, desc, tex;
  						var tempHtml = "<div><div class='liveSearchAll'>"+html+"</div></div>";
  						var ownerDocument = document.implementation.createHTMLDocument('virtual');
  						html = $(tempHtml, ownerDocument);
  						var htmlObj = html;
  						htmlObj.find("img").remove();
  						htmlObj.find("svg").remove();
  						htmlObj.find("video").remove();
  						htmlObj.find("script").remove();
  						htmlObj.find("style").remove();
  						htmlObj.find("link").remove();
  						htmlObj.find("nav").remove();
  						htmlObj.find("i").remove();
              htmlObj.find("li > a:not([href^='#'])").remove();
              htmlObj.find(".additional-pages").remove();
              htmlObj.find(".excluded-pages").remove();
  						htmlObj.find("code").remove();
  						htmlObj.find("pre").remove();
  						htmlObj.find("samp").remove();
  					  //Get title
  						if ($("title", htmlObj).length > 0) {
  							var tit = $("title", htmlObj).text();
              } else {
                var tit = value;
                desc = "";
              }
  						htmlObj.find("title").remove();
  						//Check for hashtags
              var hashLink = value.split('#')[1],
                  hasHashLink = false;
              if(typeof hashLink !== "undefined" && hashLink !== "") {
                hasHashLink = true;
                if("False" == "True") {
                  console.log("Hash link found: #" + hashLink);
                }
              }
  						//Find search container
              if(hasHashLink && htmlObj.find("#"+hashLink).length) {
                tex = htmlObj.find("#"+hashLink).text();
                if("False" == "True") {
                  console.log("Hash ID found in page, only searching ID element.");
                }
              } else if (hasHashLink && htmlObj.find('a[href="#'+hashLink+'"]:not(.ls-add-page)').length) {
                tex = htmlObj.find('a[href="#'+hashLink+'"]:not(.ls-add-page)').parent().text();
                if("False" == "True") {
                  console.log("Hash link found in page, only searching link's parent element.");
                }
              } else if (htmlObj.find("#container").length > 0) {
                if(hasHashLink && "False" == "True") {
                  console.log("ERROR: No matching hash link or element found. Searching #container instead.");
                }
                tex = htmlObj.find("#container").text();

              } else if (htmlObj.find(".stacks_top").length > 0) {
                if(hasHashLink && "False" == "True") {
                  console.log("ERROR: No matching hash link or element found. Searching .stacks_top instead.");
                }
                tex = htmlObj.find(".stacks_top").text();
              } else {
                if(hasHashLink && "False" == "True") {
                  console.log("ERROR: No matching hash link or element found. Searching entire page instead.");
                }
  							tex = htmlObj.text();
              }

              tex=tex.replace(/\s+/g," ");
              tex=tex.replace(/<!--LIVESEARCH-->[\s\S]*?<!--LIVESEARCH-->/g,"");
              tex=tex.replace(/<!--NOSEARCH-->[\s\S]*?<!--NOSEARCH-->/g,"");
              tex=tex.replace(/<!---NOSEARCH--->[\s\S]*?<!---NOSEARCH--->/g,"");
              tex=tex.replace(/<!—NOSEARCH—>[\s\S]*?<!—NOSEARCH—>/g,"");
              tex=tex.replace(/<!--&mdash;NOSEARCH&mdash;-->[\s\S]*?<!--&mdash;NOSEARCH&mdash;-->/g,"");
              tex=tex.replace(/<!---NOSE ARCH--->[\s\S]*?<!---NOSE ARCH--->/g,"");
              tex=tex.replace(/&nbsp;/g,"");

  						desc = tex;
  						cont = tex;

  						//custom description
              if (htmlObj.find(".live-search-description").parent().length > 0)   {
                desc = htmlObj.find(".live-search-description").parent().text() + desc;
                window.customDesc = 1;
              }

              //
              tit=tit.replace(/\|/g, "");

              if(noSearch == 1) {
                tit = " ";
                desc = " ";
                cont = " ";
                value = " ";
              }
              var getHash;
              if(value.includes('#')) {
                getHash = value.substring(value.indexOf('#'));
                value = value.substr(0, value.indexOf('#'));
              }
              if(getHash == undefined || getHash == "#") {
                getHash = "";
              }
              tipuesearch_in.pages.push(
                {
                  "title": tit,
                  "text": desc,
                  "tags": cont,
                  "url": value,
                  "url_base": value,
                  "hash": getHash
                });
                $(".tipue_search_loading .ts-count-wrap .ts-count").html(parseInt($(".tipue_search_loading .ts-count-wrap .ts-count").html())+1);
                if(!pagOn){getTipueSearch(loadPage, true);}
                if(parseInt($(".tipue_search_loading .ts-count-wrap .ts-count").html())+1 >= tipuesearch_pages.length) {
                  setTimeout(function() {
                    $(".tipue_search_spinner").remove();
                    $('#'+set.thisId+'_tipue_search_content').addClass("showWarning");
        						clearInterval(tipuesearch_in.updateResults);
        					},300);
                }
            }));
          });
        }

        if (set.mode == 'json')
        {
          $.getJSON(set.contentLocation)
            .done(function(json)
                  {
            tipuesearch_in = $.extend({}, json);
          });
        }

        if (set.mode == 'static')
        {
          tipuesearch_in = $.extend({}, tipuesearch);
        }

        var tipue_search_w = '';
        if (set.newWindow)
        {
          tipue_search_w = ' target="_blank"';
        }

        function getURLP(name) {
          return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20')) || null;
        }

        var built = 0,
            loadPage = 0,
            pagOn = false;
        $(this).keyup(function(event) {
          if(event.keyCode == '13') {//enter key pressed
  					if(built==0){
              $('#'+set.thisId+'_tipue_search_content .tipue_search_loading').html('<div class="tipue_search_spinner"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M434.67,285.59v-29.8C434.67,157.06,354.43,77,255.47,77a179,179,0,0,0-140.14,67.36m-38.53,82v29.8C76.8,355,157,435,256,435a180.45,180.45,0,0,0,140-66.92" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"></path><polyline points="32 256 76 212 122 256" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"></polyline><polyline points="480 256 436 300 390 256" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"></polyline></svg><div class="ts-count-wrap"><span class="ts-count">0</span>/<span class="ts-total"></span></div></div>');
  						buildIndex();
  						built=1;
  					} else {
  						getTipueSearch(0, true);
  					}
          }
        });
        $(this).next().on("click",function(event) {//submit button pressed
  					if(built==0){
              $('#'+set.thisId+'_tipue_search_content .tipue_search_loading').html('<div class="tipue_search_spinner"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M434.67,285.59v-29.8C434.67,157.06,354.43,77,255.47,77a179,179,0,0,0-140.14,67.36m-38.53,82v29.8C76.8,355,157,435,256,435a180.45,180.45,0,0,0,140-66.92" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"></path><polyline points="32 256 76 212 122 256" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"></polyline><polyline points="480 256 436 300 390 256" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"></polyline></svg><div class="ts-count-wrap"><span class="ts-count">0</span>/<span class="ts-total"></span></div></div>');
  						buildIndex();
  						built=1;
  					} else {
  						getTipueSearch(0, true);
  					}
        });
        if (getURLP('q')) {//page loaded with a query string
          $('#'+set.thisId+'_tipue_search_input').val(getURLP('q'));
          if(built==0){
            $("body").addClass("searching"+set.thisId);
            $('#'+set.thisId+'_tipue_search_content .tipue_search_loading').html('<div class="tipue_search_spinner"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M434.67,285.59v-29.8C434.67,157.06,354.43,77,255.47,77a179,179,0,0,0-140.14,67.36m-38.53,82v29.8C76.8,355,157,435,256,435a180.45,180.45,0,0,0,140-66.92" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"></path><polyline points="32 256 76 212 122 256" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"></polyline><polyline points="480 256 436 300 390 256" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"></polyline></svg><div class="ts-count-wrap"><span class="ts-count">0</span>/<span class="ts-total"></span></div></div>');
            buildIndex();
            built=1;
          } else {
              getTipueSearch(0, true);
          }
        }

        function getTipueSearch(start, replace)
        {
          $('#'+set.thisId+'_tipue_search_content').hide();
          $('#'+set.thisId+'_tipue_search_content').show();

          var out = '';
          var results = '';
          var show_replace = false;
          var show_stop = false;
          var standard = true;
          var c = 0;
          found = [];
          var d = $('#'+set.thisId+'_tipue_search_input').val().toLowerCase();
          var urlVar = "";
          var randomN = Math.floor(Math.random() * 10001)
          if("false" == "true") {
            urlVar = "?s=" + encodeURIComponent(d) + "&r=" + randomN;
          } else {
            urlVar = "?r=" + randomN;
          }
          d = $.trim(d);

          if ((d.match("^\"") && d.match("\"$")) || (d.match("^'") && d.match("'$")))
          {
            standard = false;
          }

          if (standard)
          {
            var d_w = d.split(' ');
            d = '';
            for (var i = 0; i < d_w.length; i++)
            {
              var a_w = true;
              for (var f = 0; f < tipuesearch_stop_words.length; f++)
              {
                if (d_w[i] == tipuesearch_stop_words[f])
                {
                  a_w = false;
                  show_stop = true;
                }
              }
              if (a_w)
              {
                d = d + ' ' + d_w[i];
              }
            }
            d = $.trim(d);
            d_w = d.split(' ');
          }
          else
          {
            d = d.substring(1, d.length - 1);
          }

          if (d.length >= set.minimumLength)
          {
            if (standard)
            {
              if (replace)
              {
                var d_r = d;
                for (var i = 0; i < d_w.length; i++)
                {
                  for (var f = 0; f < tipuesearch_replace.words.length; f++)
                  {
                    if (d_w[i] == tipuesearch_replace.words[f].word)
                    {
                      d = d.replace(d_w[i], tipuesearch_replace.words[f].replace_with);
                      show_replace = true;
                    }
                  }
                }
                d_w = d.split(' ');
              }

              var d_t = d;
              for (var i = 0; i < d_w.length; i++)
              {
                for (var f = 0; f < tipuesearch_stem.words.length; f++)
                {
                  if (d_w[i] == tipuesearch_stem.words[f].word)
                  {
                    d_t = d_t + ' ' + tipuesearch_stem.words[f].stem;
                  }
                }
              }
              d_w = d_t.split(' ');

              for (var i = 0; i < tipuesearch_in.pages.length; i++)
              {
                var score = 0;
                var s_t = tipuesearch_in.pages[i].text;
                //console.log(d_w);
                //console.log(s_t);
                for (var f = 0; f < d_w.length; f++)
                {
                  var pat = new RegExp(d_w[f], 'gi');
                  if (tipuesearch_in.pages[i].title.search(pat) != -1)
                  {
                    var m_c = tipuesearch_in.pages[i].title.match(pat).length;
                    score += (20 * m_c);
                  }
                  if (tipuesearch_in.pages[i].text.search(pat) != -1)
                  {
                    var m_c = tipuesearch_in.pages[i].text.match(pat).length;
                    score += (20 * m_c);
                  }

                  if (set.highlightTerms)
                  {
                    if (set.highlightEveryTerm)
                    {
                      var patr = new RegExp('(' + d_w[f] + ')', 'gi');
                    }
                    else
                    {
                      var patr = new RegExp('(' + d_w[f] + ')', 'i');
                    }
                    //console.log(s_t);
                    s_t = s_t.replace(patr, "<span class=\"h01\">$1</span>");
                    var s_t_check = s_t.split(/\s+/).slice(0,20).join(" ");
                    //if(s_t.includes("<span") ) {
                    if(s_t.indexOf("<span") >= 0) {
                      var s_t_start = s_t.split(/\s+/).slice(0,10).join(" "),// 10(9) words at the start of the search container
                          s_t_snip = s_t.substring(s_t.indexOf("<") - (30));// show 30 characters before the searched term
                      //if(!s_t_check.includes("<span")) {
                      if(s_t_check.indexOf("<span") < 0) {// if highlighted term is not inside of the first 10(9) words
                        s_t_snip = s_t_snip.substring(s_t_snip.indexOf(" ") + 1);
                        s_t = s_t_start + " ... " + s_t_snip;//first 10(9) words + ... + the rest of the searched text. It will be trimmed later by the set description length
                      }
                    }
                  }

                  if (tipuesearch_in.pages[i].tags.search(pat) != -1)
                  {
                    var m_c = tipuesearch_in.pages[i].tags.match(pat).length;
                    score += (10 * m_c);
                  }

                  if (tipuesearch_in.pages[i].url.search(pat) != -1)
                  {
                    score += 20;
                  }

                  if (score != 0)
                  {
                    for (var e = 0; e < tipuesearch_weight.weight.length; e++)
                    {
                      if (tipuesearch_in.pages[i].url == tipuesearch_weight.weight[e].url)
                      {
                        score += tipuesearch_weight.weight[e].score;
                      }
                    }
                  }

                  if (d_w[f].match('^-'))
                  {
                    pat = new RegExp(d_w[f].substring(1), 'i');
                    if (tipuesearch_in.pages[i].title.search(pat) != -1 || tipuesearch_in.pages[i].text.search(pat) != -1 || tipuesearch_in.pages[i].tags.search(pat) != -1)
                    {
                      score = 0;
                    }
                  }
                }

                if (score != 0)
                {
                  found.push(
                    {
                      "score": score,
                      "title": tipuesearch_in.pages[i].title + " " + tipuesearch_in.pages[i].hash,
                      "desc": s_t,
                      "url_base": tipuesearch_in.pages[i].url + tipuesearch_in.pages[i].hash,
                      "url": tipuesearch_in.pages[i].url + urlVar + tipuesearch_in.pages[i].hash
                    });
                  c++;
                }
              }
            }
            else
            {
              for (var i = 0; i < tipuesearch_in.pages.length; i++)
              {
                var score = 0;
                var s_t = tipuesearch_in.pages[i].text;
                var pat = new RegExp(d, 'gi');
                if (tipuesearch_in.pages[i].title.search(pat) != -1)
                {
                  var m_c = tipuesearch_in.pages[i].title.match(pat).length;
                  score += (20 * m_c);
                }
                if (tipuesearch_in.pages[i].text.search(pat) != -1)
                {
                  var m_c = tipuesearch_in.pages[i].text.match(pat).length;
                  score += (20 * m_c);
                }

                if (set.highlightTerms)
                {
                  if (set.highlightEveryTerm)
                  {
                    var patr = new RegExp('(' + d + ')', 'gi');
                  }
                  else
                  {
                    var patr = new RegExp('(' + d + ')', 'i');
                  }
                  //console.log(s_t);
                  s_t = s_t.replace(patr, "<span class=\"h01\">$1</span>");
                  var s_t_check = s_t.split(/\s+/).slice(0,20).join(" ");
                  //if(s_t.includes("<span") ) {
                  if(s_t.indexOf("<span") >= 0) {
                    var s_t_start = s_t.split(/\s+/).slice(0,10).join(" "),// 10(9) words at the start of the search container
                        s_t_snip = s_t.substring(s_t.indexOf("<") - (30));// show 30 characters before the searched term
                    //if(!s_t_check.includes("<span")) {
                    if(s_t_check.indexOf("<span") < 0) {// if highlighted term is not inside of the first 10(9) words
                      s_t_snip = s_t_snip.substring(s_t_snip.indexOf(" ") + 1);
                      s_t = s_t_start + " ... " + s_t_snip;//first 10(9) words + ... + the rest of the searched text. It will be trimmed later by the set description length
                    }
                  }
                }

                if (tipuesearch_in.pages[i].tags.search(pat) != -1)
                {
                  var m_c = tipuesearch_in.pages[i].tags.match(pat).length;
                  score += (10 * m_c);
                }

                if (tipuesearch_in.pages[i].url.search(pat) != -1)
                {
                  score += 20;
                }

                if (score != 0)
                {
                  for (var e = 0; e < tipuesearch_weight.weight.length; e++)
                  {
                    if (tipuesearch_in.pages[i].url == tipuesearch_weight.weight[e].url)
                    {
                      score += tipuesearch_weight.weight[e].score;
                    }
                  }
                }

                if (score != 0)
                {
                  found.push(
                    {
                      "score": score,
                      "title": tipuesearch_in.pages[i].title + " " + tipuesearch_in.pages[i].hash,
                      "desc": s_t,
                      "url_base": tipuesearch_in.pages[i].url + tipuesearch_in.pages[i].hash,
                      "url": tipuesearch_in.pages[i].url + urlVar + tipuesearch_in.pages[i].hash
                    });
                  c++;
                }
              }
            }

            if (c != 0)
            {
              if (set.showTitleCount && tipuesearch_t_c == 0)
              {
                var title = document.title;
                document.title = '(' + c + ') ' + title;
                tipuesearch_t_c++;
              }

              if (show_replace == 1)
              {
                out += '<div id="'+set.thisId+'_tipue_search_warning">' + tipuesearch_string_2 + ' ' + d + '. ' + tipuesearch_string_3 + ' <a id="'+set.thisId+'_tipue_search_replaced">' + d_r + '</a></div>';
              }
              if (c == 1)
              {
                out += '<div id="'+set.thisId+'_tipue_search_results_count">' + tipuesearch_string_4 + '</div>';
              }
              else
              {
                c_c = c.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
                out += '<div id="'+set.thisId+'_tipue_search_results_count">' + c_c + ' ' + tipuesearch_string_5 + '</div>';
              }

              found.sort(function(a, b) { return b.score - a.score } );

              var l_o = 0;
              for (var i = 0; i < found.length; i++)
              {
                if (l_o >= start && l_o < set.show + start)
                {
                  out += '<div class="tipue_search_content_title"><a href="' + found[i].url + '"' + tipue_search_w + '>' +  found[i].title + '</a></div>';

                  if (set.debug)
                  {
                    out += '<div class="tipue_search_content_debug">Score: ' + found[i].score + '</div>';
                  }

                  if (set.showURL)
                  {
                    var s_u = found[i].url.toLowerCase();
                    if(s_u.indexOf('http://') == 0)
                    {
                      s_u = s_u.slice(7);
                    }
                    out += '<div class="tipue_search_content_url"><a href="' + (found[i].url) + '"' + tipue_search_w + '>' + found[i].url_base + '</a></div>';
                  }

                  if (found[i].desc)
                  {
                    var t = found[i].desc;
                    var t_d = '';
                    var t_w = t.split(' ');
                    if (t_w.length < set.descriptiveWords){
                      t_d = t;
                    } else {
                      for (var f = 0; f < set.descriptiveWords; f++)
                      {
                        t_d += t_w[f] + ' ';
                      }
                    }
                    t_d = $.trim(t_d);
                    if (t_d.charAt(t_d.length - 1) != '.') {
                      t_d += ' ...';
                    }
                    out += '<div class="tipue_search_content_text">' + t_d + '</div>';
                  }
                }
                l_o++;
              }

              if (c > set.show)
              {
                var pages = Math.ceil(c / set.show);
                var page = (start / set.show);
                loadPage = start;
                out += '<div id="'+set.thisId+'_tipue_search_foot"><ul id="'+set.thisId+'_tipue_search_foot_boxes">';

                if (start > 0)
                {
                  out += '<li><a class="tipue_search_foot_box" id="' + (start - set.show) + '_' + replace + '">' + tipuesearch_string_6 + '</a></li>';
                }

                if (page <= 2)
                {
                  var p_b = pages;
                  if (pages > 3)
                  {
                    p_b = 3;
                  }
                  for (var f = 0; f < p_b; f++)
                  {
                    if (f == page)
                    {
                      out += '<li class="current">' + (f + 1) + '</li>';

                    }
                    else
                    {
                      out += '<li><a class="tipue_search_foot_box" id="' + (f * set.show) + '_' + replace + '">' + (f + 1) + '</a></li>';
                    }
                  }
                }
                else
                {
                  var p_b = page + 2;
                  if (p_b > pages)
                  {
                    p_b = pages;
                  }
                  for (var f = page - 1; f < p_b; f++)
                  {
                    if (f == page)
                    {
                      out += '<li class="current">' + (f + 1) + '</li>';
                    }
                    else
                    {
                      out += '<li><a class="tipue_search_foot_box" id="' + (f * set.show) + '_' + replace + '">' + (f + 1) + '</a></li>';
                    }
                  }
                }

                if (page + 1 != pages)
                {
                  out += '<li><a class="tipue_search_foot_box" id="' + (start + set.show) + '_' + replace + '">' + tipuesearch_string_7 + '</a></li>';
                }

                out += '</ul></div>';
              }
            }
            else
            {
              out += '<div id="'+set.thisId+'_tipue_search_warning">' + tipuesearch_string_8 + '</div>';
            }
          }
          else
          {
            if (show_stop)
            {
              out += '<div id="'+set.thisId+'_tipue_search_warning">' + tipuesearch_string_8 + '. ' + tipuesearch_string_9 + '</div>';
            }
            else
            {
              out += '<div id="'+set.thisId+'_tipue_search_warning">' + tipuesearch_string_10 + '</div>';
              if (set.minimumLength == 1)
              {
                out += '<div id="'+set.thisId+'_tipue_search_warning">' + tipuesearch_string_11 + '</div>';
              }
              else
              {
                out += '<div id="'+set.thisId+'_tipue_search_warning">' + tipuesearch_string_12 + '</div>';
              }
            }
          }

          $('#'+set.thisId+'_tipue_search_content').hide();
          $('#'+set.thisId+'_tipue_search_content .tipue_search_results').html(out);
          $('#'+set.thisId+'_tipue_search_content').slideDown(200);

          $('#'+set.thisId+'_tipue_search_replaced').click(function()
                                                 {
            getTipueSearch(0, false);
          });

          $('.tipue_search_foot_box').click(function() {
            pagOn = true;
            var id_v = $(this).attr('id');
            var id_a = id_v.split('_');

            getTipueSearch(parseInt(id_a[0]), id_a[1]);
          });
        }

      });
    };

  })(jQuery);
  /*!***************************************************
  * mark.js v8.11.1
  * https://markjs.io/
  * Copyright (c) 2014–2018, Julian Kühnel
  * Released under the MIT license https://git.io/vwTVl
  *****************************************************/
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Mark=t()}(this,function(){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},n=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(n){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;t(this,e),this.ctx=n,this.iframes=r,this.exclude=i,this.iframesTimeout=o}return n(e,[{key:"getContexts",value:function(){var e=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach(function(t){var n=e.filter(function(e){return e.contains(t)}).length>0;-1!==e.indexOf(t)||n||e.push(t)}),e}},{key:"getIframeContents",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=void 0;try{var i=e.contentWindow;if(r=i.document,!i||!r)throw new Error("iframe inaccessible")}catch(e){n()}r&&t(r)}},{key:"isIframeBlank",value:function(e){var t="about:blank",n=e.getAttribute("src").trim();return e.contentWindow.location.href===t&&n!==t&&n}},{key:"observeIframeLoad",value:function(e,t,n){var r=this,i=!1,o=null,a=function a(){if(!i){i=!0,clearTimeout(o);try{r.isIframeBlank(e)||(e.removeEventListener("load",a),r.getIframeContents(e,t,n))}catch(e){n()}}};e.addEventListener("load",a),o=setTimeout(a,this.iframesTimeout)}},{key:"onIframeReady",value:function(e,t,n){try{"complete"===e.contentWindow.document.readyState?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch(e){n()}}},{key:"waitForIframes",value:function(e,t){var n=this,r=0;this.forEachIframe(e,function(){return!0},function(e){r++,n.waitForIframes(e.querySelector("html"),function(){--r||t()})},function(e){e||t()})}},{key:"forEachIframe",value:function(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=t.querySelectorAll("iframe"),s=a.length,c=0;a=Array.prototype.slice.call(a);var u=function(){--s<=0&&o(c)};s||u(),a.forEach(function(t){e.matches(t,i.exclude)?u():i.onIframeReady(t,function(e){n(t)&&(c++,r(e)),u()},u)})}},{key:"createIterator",value:function(e,t,n){return document.createNodeIterator(e,t,n,!1)}},{key:"createInstanceOnIframe",value:function(t){return new e(t.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(e,t,n){if(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING){if(null===t)return!0;if(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}},{key:"getIteratorNode",value:function(e){var t=e.previousNode();return{prevNode:t,node:null===t?e.nextNode():e.nextNode()&&e.nextNode()}}},{key:"checkIframeFilter",value:function(e,t,n,r){var i=!1,o=!1;return r.forEach(function(e,t){e.val===n&&(i=t,o=e.handled)}),this.compareNodeIframe(e,t,n)?(!1!==i||o?!1===i||o||(r[i].handled=!0):r.push({val:n,handled:!0}),!0):(!1===i&&r.push({val:n,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(e,t,n,r){var i=this;e.forEach(function(e){e.handled||i.getIframeContents(e.val,function(e){i.createInstanceOnIframe(e).forEachNode(t,n,r)})})}},{key:"iterateThroughNodes",value:function(e,t,n,r,i){for(var o,a=this,s=this.createIterator(t,e,r),c=[],u=[],l=void 0,h=void 0;void 0,o=a.getIteratorNode(s),h=o.prevNode,l=o.node;)this.iframes&&this.forEachIframe(t,function(e){return a.checkIframeFilter(l,h,e,c)},function(t){a.createInstanceOnIframe(t).forEachNode(e,function(e){return u.push(e)},r)}),u.push(l);u.forEach(function(e){n(e)}),this.iframes&&this.handleOpenIframes(c,e,n,r),i()}},{key:"forEachNode",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=this.getContexts(),a=o.length;a||i(),o.forEach(function(o){var s=function(){r.iterateThroughNodes(e,o,t,n,function(){--a<=0&&i()})};r.iframes?r.waitForIframes(o,s):s()})}}],[{key:"matches",value:function(e,t){var n="string"==typeof t?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){var i=!1;return n.every(function(t){return!r.call(e,t)||(i=!0,!1)}),i}return!1}}]),e}(),o=function(){function e(n){t(this,e),this.opt=r({},{diacritics:!0,synonyms:{},accuracy:"partially",caseSensitive:!1,ignoreJoiners:!1,ignorePunctuation:[],wildcards:"disabled"},n)}return n(e,[{key:"create",value:function(e){return"disabled"!==this.opt.wildcards&&(e=this.setupWildcardsRegExp(e)),e=this.escapeStr(e),Object.keys(this.opt.synonyms).length&&(e=this.createSynonymsRegExp(e)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),this.opt.diacritics&&(e=this.createDiacriticsRegExp(e)),e=this.createMergedBlanksRegExp(e),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.createJoinersRegExp(e)),"disabled"!==this.opt.wildcards&&(e=this.createWildcardsRegExp(e)),e=this.createAccuracyRegExp(e),new RegExp(e,"gm"+(this.opt.caseSensitive?"":"i"))}},{key:"escapeStr",value:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createSynonymsRegExp",value:function(e){var t=this.opt.synonyms,n=this.opt.caseSensitive?"":"i",r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var i in t)if(t.hasOwnProperty(i)){var o=t[i],a="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(i):this.escapeStr(i),s="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(o):this.escapeStr(o);""!==a&&""!==s&&(e=e.replace(new RegExp("("+this.escapeStr(a)+"|"+this.escapeStr(s)+")","gm"+n),r+"("+this.processSynonyms(a)+"|"+this.processSynonyms(s)+")"+r))}return e}},{key:"processSynonyms",value:function(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}},{key:"setupWildcardsRegExp",value:function(e){return(e=e.replace(/(?:\\)*\?/g,function(e){return"\\"===e.charAt(0)?"?":""})).replace(/(?:\\)*\*/g,function(e){return"\\"===e.charAt(0)?"*":""})}},{key:"createWildcardsRegExp",value:function(e){var t="withSpaces"===this.opt.wildcards;return e.replace(/\u0001/g,t?"[\\S\\s]?":"\\S?").replace(/\u0002/g,t?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(e){return e.replace(/[^(|)\\]/g,function(e,t,n){var r=n.charAt(t+1);return/[(|)\\]/.test(r)||""===r?e:e+"\0"})}},{key:"createJoinersRegExp",value:function(e){var t=[],n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&t.push(this.escapeStr(n.join(""))),this.opt.ignoreJoiners&&t.push("\\u00ad\\u200b\\u200c\\u200d"),t.length?e.split(/\u0000+/).join("["+t.join("")+"]*"):e}},{key:"createDiacriticsRegExp",value:function(e){var t=this.opt.caseSensitive?"":"i",n=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"],r=[];return e.split("").forEach(function(i){n.every(function(n){if(-1!==n.indexOf(i)){if(r.indexOf(n)>-1)return!1;e=e.replace(new RegExp("["+n+"]","gm"+t),"["+n+"]"),r.push(n)}return!0})}),e}},{key:"createMergedBlanksRegExp",value:function(e){return e.replace(/[\s]+/gim,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(e){var t=this,n=this.opt.accuracy,r="string"==typeof n?n:n.value,i="";switch(("string"==typeof n?[]:n.limiters).forEach(function(e){i+="|"+t.escapeStr(e)}),r){case"partially":default:return"()("+e+")";case"complementary":return"()([^"+(i="\\s"+(i||this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿")))+"]*"+e+"[^"+i+"]*)";case"exactly":return"(^|\\s"+i+")("+e+")(?=$|\\s"+i+")"}}}]),e}(),a=function(){function a(e){t(this,a),this.ctx=e,this.ie=!1;var n=window.navigator.userAgent;(n.indexOf("MSIE")>-1||n.indexOf("Trident")>-1)&&(this.ie=!0)}return n(a,[{key:"log",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"debug",r=this.opt.log;this.opt.debug&&"object"===(void 0===r?"undefined":e(r))&&"function"==typeof r[n]&&r[n]("mark.js: "+t)}},{key:"getSeparatedKeywords",value:function(e){var t=this,n=[];return e.forEach(function(e){t.opt.separateWordSearch?e.split(" ").forEach(function(e){e.trim()&&-1===n.indexOf(e)&&n.push(e)}):e.trim()&&-1===n.indexOf(e)&&n.push(e)}),{keywords:n.sort(function(e,t){return t.length-e.length}),length:n.length}}},{key:"isNumeric",value:function(e){return Number(parseFloat(e))==e}},{key:"checkRanges",value:function(e){var t=this;if(!Array.isArray(e)||"[object Object]"!==Object.prototype.toString.call(e[0]))return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(e),[];var n=[],r=0;return e.sort(function(e,t){return e.start-t.start}).forEach(function(e){var i=t.callNoMatchOnInvalidRanges(e,r),o=i.start,a=i.end;i.valid&&(e.start=o,e.length=a-o,n.push(e),r=a)}),n}},{key:"callNoMatchOnInvalidRanges",value:function(e,t){var n=void 0,r=void 0,i=!1;return e&&void 0!==e.start?(r=(n=parseInt(e.start,10))+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&r-t>0&&r-n>0?i=!0:(this.log("Ignoring invalid or overlapping range: "+JSON.stringify(e)),this.opt.noMatch(e))):(this.log("Ignoring invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:n,end:r,valid:i}}},{key:"checkWhitespaceRanges",value:function(e,t,n){var r=void 0,i=!0,o=n.length,a=t-o,s=parseInt(e.start,10)-a;return(r=(s=s>o?o:s)+parseInt(e.length,10))>o&&(r=o,this.log("End range automatically set to the max value of "+o)),s<0||r-s<0||s>o||r>o?(i=!1,this.log("Invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)):""===n.substring(s,r).replace(/\s+/g,"")&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:s,end:r,valid:i}}},{key:"getTextNodes",value:function(e){var t=this,n="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(e){r.push({start:n.length,end:(n+=e.textContent).length,node:e})},function(e){return t.matchesExclude(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},function(){e({value:n,nodes:r})})}},{key:"matchesExclude",value:function(e){return i.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(e,t,n){var r=this.opt.element?this.opt.element:"mark",i=e.splitText(t),o=i.splitText(n-t),a=document.createElement(r);return a.setAttribute("data-markjs","true"),this.opt.className&&a.setAttribute("class",this.opt.className),a.textContent=i.textContent,i.parentNode.replaceChild(a,i),o}},{key:"wrapRangeInMappedTextNode",value:function(e,t,n,r,i){var o=this;e.nodes.every(function(a,s){var c=e.nodes[s+1];if(void 0===c||c.start>t){if(!r(a.node))return!1;var u=t-a.start,l=(n>a.end?a.end:n)-a.start,h=e.value.substr(0,a.start),f=e.value.substr(l+a.start);if(a.node=o.wrapRangeInTextNode(a.node,u,l),e.value=h+f,e.nodes.forEach(function(t,n){n>=s&&(e.nodes[n].start>0&&n!==s&&(e.nodes[n].start-=l),e.nodes[n].end-=l)}),n-=l,i(a.node.previousSibling,a.start),!(n>a.end))return!1;t=a.end}return!0})}},{key:"wrapGroups",value:function(e,t,n,r){return r((e=this.wrapRangeInTextNode(e,t,t+n)).previousSibling),e}},{key:"separateGroups",value:function(e,t,n,r,i){for(var o=t.length,a=1;a<o;a++){var s=e.textContent.indexOf(t[a]);t[a]&&s>-1&&r(t[a],e)&&(e=this.wrapGroups(e,s,t[a].length,i))}return e}},{key:"wrapMatches",value:function(e,t,n,r,i){var o=this,a=0===t?0:t+1;this.getTextNodes(function(t){t.nodes.forEach(function(t){t=t.node;for(var i=void 0;null!==(i=e.exec(t.textContent))&&""!==i[a];){if(o.opt.separateGroups)t=o.separateGroups(t,i,a,n,r);else{if(!n(i[a],t))continue;var s=i.index;if(0!==a)for(var c=1;c<a;c++)s+=i[c].length;t=o.wrapGroups(t,s,i[a].length,r)}e.lastIndex=0}}),i()})}},{key:"wrapMatchesAcrossElements",value:function(e,t,n,r,i){var o=this,a=0===t?0:t+1;this.getTextNodes(function(t){for(var s=void 0;null!==(s=e.exec(t.value))&&""!==s[a];){var c=s.index;if(0!==a)for(var u=1;u<a;u++)c+=s[u].length;var l=c+s[a].length;o.wrapRangeInMappedTextNode(t,c,l,function(e){return n(s[a],e)},function(t,n){e.lastIndex=n,r(t)})}i()})}},{key:"wrapRangeFromIndex",value:function(e,t,n,r){var i=this;this.getTextNodes(function(o){var a=o.value.length;e.forEach(function(e,r){var s=i.checkWhitespaceRanges(e,a,o.value),c=s.start,u=s.end;s.valid&&i.wrapRangeInMappedTextNode(o,c,u,function(n){return t(n,e,o.value.substring(c,u),r)},function(t){n(t,e)})}),r()})}},{key:"unwrapMatches",value:function(e){for(var t=e.parentNode,n=document.createDocumentFragment();e.firstChild;)n.appendChild(e.removeChild(e.firstChild));t.replaceChild(n,e),this.ie?this.normalizeTextNode(t):t.normalize()}},{key:"normalizeTextNode",value:function(e){if(e){if(3===e.nodeType)for(;e.nextSibling&&3===e.nextSibling.nodeType;)e.nodeValue+=e.nextSibling.nodeValue,e.parentNode.removeChild(e.nextSibling);else this.normalizeTextNode(e.firstChild);this.normalizeTextNode(e.nextSibling)}}},{key:"markRegExp",value:function(e,t){var n=this;this.opt=t,this.log('Searching with expression "'+e+'"');var r=0,i="wrapMatches";this.opt.acrossElements&&(i="wrapMatchesAcrossElements"),this[i](e,this.opt.ignoreGroups,function(e,t){return n.opt.filter(t,e,r)},function(e){r++,n.opt.each(e)},function(){0===r&&n.opt.noMatch(e),n.opt.done(r)})}},{key:"mark",value:function(e,t){var n=this;this.opt=t;var r=0,i="wrapMatches",a=this.getSeparatedKeywords("string"==typeof e?[e]:e),s=a.keywords,c=a.length;this.opt.acrossElements&&(i="wrapMatchesAcrossElements"),0===c?this.opt.done(r):function e(t){var a=new o(n.opt).create(t),u=0;n.log('Searching with expression "'+a+'"'),n[i](a,1,function(e,i){return n.opt.filter(i,t,r,u)},function(e){u++,r++,n.opt.each(e)},function(){0===u&&n.opt.noMatch(t),s[c-1]===t?n.opt.done(r):e(s[s.indexOf(t)+1])})}(s[0])}},{key:"markRanges",value:function(e,t){var n=this;this.opt=t;var r=0,i=this.checkRanges(e);i&&i.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(i)),this.wrapRangeFromIndex(i,function(e,t,r,i){return n.opt.filter(e,t,r,i)},function(e,t){r++,n.opt.each(e,t)},function(){n.opt.done(r)})):this.opt.done(r)}},{key:"unmark",value:function(e){var t=this;this.opt=e;var n=this.opt.element?this.opt.element:"*";n+="[data-markjs]",this.opt.className&&(n+="."+this.opt.className),this.log('Removal selector "'+n+'"'),this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,function(e){t.unwrapMatches(e)},function(e){var r=i.matches(e,n),o=t.matchesExclude(e);return!r||o?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}},{key:"opt",set:function(e){this._opt=r({},{element:"",className:"",exclude:[],iframes:!1,iframesTimeout:5e3,separateWordSearch:!0,acrossElements:!1,ignoreGroups:0,each:function(){},noMatch:function(){},filter:function(){return!0},done:function(){},debug:!1,log:window.console},e)},get:function(){return this._opt}},{key:"iterator",get:function(){return new i(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}}]),a}();return function(e){var t=this,n=new a(e);return this.mark=function(e,r){return n.mark(e,r),t},this.markRegExp=function(e,r){return n.markRegExp(e,r),t},this.markRanges=function(e,r){return n.markRanges(e,r),t},this.unmark=function(e){return n.unmark(e),t},this}});
  function stringIsEmpty(value) {
    return value ? value.trim().length == 0 : true;
  }
  function highlight() {
    var liveSearchTerm = location.search.split('s=')[1];
    if (liveSearchTerm == null){

    } else if (liveSearchTerm.includes('&')) {
      liveSearchTerm = liveSearchTerm.substring(0, liveSearchTerm.indexOf('&'));
    }
    liveSearchTerm = decodeURIComponent(liveSearchTerm);
    if("False" == "True") {
      console.log("Search Term/s: " + liveSearchTerm);
    }
    if(!stringIsEmpty(liveSearchTerm)) {
      var markInstance;
      if ($("#container").length > 0 ) {
        markInstance = new Mark(document.querySelector("#container"));
        markInstance.mark(liveSearchTerm, { wildcards: "enabled", exclude: ["nav *"],
                                           done: function() {
                                             if($('mark').length) {
                                               $("html, body").animate({ scrollTop: $('mark').offset().top - 300 }, 300);
                                             }
                                           }
                                          });
        if($('mark').length) {
          $('html, body').scrollTop($("mark").offset().top - $('html, body').offset().top + $('html, body').scrollTop());
        }
      } else if ($(".stacks_top").length > 0){
        markInstance = new Mark(document.querySelector("div.stacks_top"));
        markInstance.mark(liveSearchTerm, { wildcards: "enabled", exclude: ["nav *"],
                                           done: function() {
                                             if($('mark').length) {
                                               $("html, body").animate({ scrollTop: $('mark').offset().top - 300 }, 300);
                                             }
                                           }
                                          });
      } else {
        markInstance = new Mark(document.querySelector("body"));
        markInstance.mark(liveSearchTerm, { wildcards: "enabled", exclude: ["nav *"],
                                           done: function() {
                                             if($('mark').length) {
                                               $("html, body").animate({ scrollTop: $('mark').offset().top - 300  }, 300);
                                             }
                                           }
                                          });
      }
    }
  }
  function cleanString(input) {
    var output = "";
    for (var i=0; i<input.length; i++) {
      if (input.charCodeAt(i) <= 127) {
        output += input.charAt(i);
      }
    }
    return output;
  }
  function searchFinalize() {
    if("False" == "True") {
      if ($("#container").length > 0) {
        console.log("Search Container: #container");
      } else if ($(".stacks_top").length > 0){
        console.log("Search Container: .stacks_top");
      } else {
        console.log("Search Container: None");
      }
      console.log("Automatically identified pages:");
      for (i = 0; i < tipuesearch_pages.length; i++){
        console.log(tipuesearch_pages[i]);
      }
    }

    //  jQuery.each(pages, function(index, value) {
    //      tipuesearch_pages.push(this);
    //  });
    //

    //Exclude pages
    //
    var tipuesearch_pages_remove = [];
    $('.excluded-pages a').each(function (index, value){
      var pageIndex = tipuesearch_pages.indexOf(this.href);
      if (pageIndex > -1) {
        tipuesearch_pages.splice(pageIndex, 1);
      }
      tipuesearch_pages_remove.push(this.href);
    });
    if("False" == "True") {
      console.log("Excluded pages:");
      for (i = 0; i < tipuesearch_pages_remove.length; i++){
        console.log(tipuesearch_pages_remove[i]);
      }
    }
    //

    //Remove duplicates
    var arrayUnique = function (arr) {
      return arr.filter(function(item, index){
        return arr.indexOf(item) >= index;
      });
    };
    tipuesearch_pages = arrayUnique(tipuesearch_pages);

    $.when(tipuesearch_pages).done(function() {
      if("False" == "True") {
        console.log("Final list of pages to search:");
      }
      //Remove URL variables
      for (i = 0; i < tipuesearch_pages.length; i++){
        tipuesearch_pages[i] = tipuesearch_pages[i].replace(/\?.*\#/, '#');
        var hasVar = tipuesearch_pages[i].indexOf('?');
        tipuesearch_pages[i] = tipuesearch_pages[i].substring(0, hasVar != -1 ? hasVar : tipuesearch_pages[i].length);
        if("False" == "True") {console.log(tipuesearch_pages[i]);}
      }
    });
    searchEventsstacks_in_8();
    jQuery("body").addClass("tipue_search_loaded");
  }
  function searchInit(data) {

    let sitemapUrls = [],
        xmlReqPromises = [];
    //
    sitemapUrls.push(window.liveSearchBaseUrl + "sitemap.xml");
    $.when.apply($, sitemapUrls.map(function(val) {
      let thisUrl = val.trim();
      xmlReqPromises.push(
      new Promise(function(resolve, reject) {
        $.ajax({
          type: "GET",
          url: thisUrl,
          dataType: "xml",
          cache: false
        }).done(function( data ) {
          if("False" == "True") {
            console.log("Sitemap found: " + thisUrl + "sitemap.xml");
          }
          let xmlPages = $(data).find("url");
          $(xmlPages).each(function(){
            tipuesearch_pages.push($(this).find("loc").text());
          }).promise().done(function() {
            resolve();
          });
        }).fail( function(xhr, textStatus, errorThrown) {
          if("False" == "True") {
            console.log("Sitemap not found: " + thisUrl + "sitemap.xml");
          }
          resolve();
        });
      }));
    })).then(function() {
      Promise.all(xmlReqPromises).then(function() {
        if(tipuesearch_pages.length < 1) {
          console.log("No sitemap.xml files found");
          //Get folder path
          var path = jQuery(".stacks_in_8_pages").html();
          path = path.split('href="');
          window.folderPath = "";
          jQuery.each(path, function(index, value) {
            var newArr = this.split('"');
            if (index == 1 && newArr[0] != "./") {
              if (newArr[0].match("^../../../../../")) {
                window.folderPath = "../../../../../";
              } else if (newArr[0].match("^../../../../")) {
                window.folderPath = "../../../../";
              }  else if (newArr[0].match("^../../../")) {
                window.folderPath = "../../../";
              }  else if (newArr[0].match("^../../")) {
                window.folderPath = "../../";
              }  else if (newArr[0].match("^../")) {
                window.folderPath = "../";
              }
              newArr = newArr[0];
            }
          });
          //Get all links
          var pages = [], duplicates;
          for (var i= document.links.length; i-->0;) {
            if (document.links[i].hostname===location.hostname) {
              var href = document.links[i].href;
              href = href.replace(/\?.*/,'');
              href = href.replace(/\#.*/,'');
              if (href.match(/\.(jpeg|jpg|gif|pdf|png)$/) == null) {
                duplicates = document.links[i].href;
                if(duplicates.substr(duplicates.indexOf("#") + 1) == "") {
                  duplicates = duplicates.replace(/\#.*/,'');
                }
                if($.inArray(duplicates, tipuesearch_pages) === -1) {
                  tipuesearch_pages.push(document.links[i].href);
                }
              }
            }
          }
          searchFinalize();
        } else {
          searchFinalize();
        }
      });
    });
  }
  jQuery(window).load(function() {
    highlight();
  });
}
function searchEventsstacks_in_8() {
  //More results
  if ($(".live-search-results").length && $(window).width() > 768) {
    $("#stacks_in_8_tipue_search_content").appendTo(".live-search-results");
  } else if ($(".live-search-results-mobile").length) {
    $("#stacks_in_8_tipue_search_content").appendTo(".live-search-results-mobile");
  }
  //Search
  jQuery('#stacks_in_8_tipue_search_input').tipuesearch({
    'mode': 'live', //The mode for loading content. The value can be 'static', 'live' or 'json'. The default is 'static'.
    'liveDescription': '*', // the element containing the descriptive text
    //
    //
    'liveContent': '*',
    //
    'show': 10, //The number of results displayed. The default is 7.
    'newWindow': false, //The search result opens in a new browser tab if set to true. The default is false.
    'showURL': false, //The URL is displayed in each search result if set to true. The default is true.
    'showTitleCount': true, //The number of search results is displayed in the document title if set to true. The default is true.
    'minimumLength': 3, //The minimum length of characters in a search query. The default is 3.
    'descriptiveWords': 60, //The number of words displayed in the descriptive text in the search search. The default is 25.
    'highlightTerms': true, //Search terms are highlighted if set to true. The default is true. The highlight CSS is set in the h01 class.
    'highlightEveryTerm': true, //Every occurrence of search terms are highlighted if set to true. The default is false.
    'thisId': 'stacks_in_8'
  });
  jQuery('form#stacks_in_8_live-search').on('submit', function() {
    jQuery("body").addClass("searchingstacks_in_8");
    return false;
  });
  jQuery('#stacks_in_8_tipue_search_input, #stacks_in_8_tipue_search_content').on('click', function(e) {
    e.stopPropagation();
  });
  jQuery(document).on('click', function (e) {
    jQuery("body").removeClass("searchingstacks_in_8");
  });
}
//
jQuery(document).ready( function() {
  //
  //
  //
  if(window.liveSearchInitialized == null) {
    searchInit();
    window.liveSearchInitialized = true;
  } else {
    searchEventsstacks_in_8();
  }
  //
});

return stack;})(stacks.stacks_in_8);