/*!
 * HelpNDoc HTML template
 * Copyright (C) IBE Software - All rights reserved.
 * Can only be used in documentation generated by HelpNDoc: http://www.helpndoc.com
 */
var __extends=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},Exception=function(e){function t(t){e.call(this,t),this.message=t,this.name="Exception",this.message=t}return __extends(t,e),t.prototype.toString=function(){return"["+this.name+']: "'+this.message+'"'},t}(Error),EInvalidHtmlElement=function(e){function t(t){e.call(this,t),this.message=t,this.name="EInvalidHtmlElement"}return __extends(t,e),t}(Exception),Hnd;!function(e){var t=function(){function e(){}return e}();e.AppOptions=t;var o=function(){function e(e){this.DEFAULTS={animationDelay:200,elHeadroom:"header",elMask:".mask",elSearchForm:"#search-form",elSearchInfo:"#search-info",elSearchInput:"#input-search",elToggler:".hnd-toggle",elTopicContainer:"article",elTopicContent:"#topic-content",elTreeContainers:".tree-container",elTreeSearch:"#search-tree",classNavExpandedSmall:"sm-nav-expanded",classNavExpandedMedium:"md-nav-expanded"},this.TRANSLATIONS={"Search term too short":"Search term too short","No results":"No results","Please enter 3 or more alpha-numeric characters":"Please enter 3 or more alpha-numeric characters","Word list not ready yet. Please wait until the word list is fully downloaded":"Word list not ready yet. Please wait until the word list is fully downloaded","Incorrect or corrupt search data. Please check your HelpNDoc template":"Incorrect or corrupt search data. Please check your HelpNDoc template","Related topics...":"Related topics...","Loading...":"Loading..."},this.options=$.extend({},this.DEFAULTS,e),this.Init()}return e.prototype._=function(e){var t=this.TRANSLATIONS[e];return t?t:e},e.prototype.getAnchor=function(){return window.location.hash.substr(1)},e.prototype.isExternalLink=function(e){var t=function(e){return 0===e.indexOf("//")&&(e=location.protocol+e),e.toLowerCase().replace(/([a-z])?:\/\//,"$1").split("/")[0]};if((e.indexOf(":")>-1||e.indexOf("//")>-1)&&t(location.href)!==t(e))return!0;var o=new URI(e);return["htm","html"].indexOf(o.suffix().toLowerCase())==-1},e.prototype.DoShowExternalUrl=function(e,t,o){window.open(t,o)},e.prototype.DoShowTopic=function(e,t,o){var n=this;this.$elTopicContainer.load(o+" "+this.options.elTopicContent,function(e,r,i){var a=$(n.options.elTopicContent),s=a.data("hnd-id");a.data("hnd-context");window.history.pushState({id:s,title:t},t,o),n.SelectTopicInToc(s,t,!1),n.DoScrollToAnchorIfNeeded(),n.DoHighlightText(n.searchTerm)})},e.prototype.DoHandleLink=function(e,t,o,n){"_blank"==n||this.isExternalLink(o)?this.DoShowExternalUrl(t,o,n):this.DoShowTopic(e,t,o)},e.prototype.DoHighlightText=function(e){try{this.$elTopicContainer.unmark(),e&&""!==e&&this.$elTopicContainer.mark(e,{accuracy:"exactly",diacritics:!1})}catch(e){console.error("[HND-APP] An error occurred while highlighting the search term =>",e.toString())}},e.prototype.DoScrollToAnchorIfNeeded=function(){var e=decodeURIComponent(this.getAnchor());if(""!==e){var t=$("a[name='"+e+"']");if(t&&t.offset&&t.offset()){var o=this.$elHeadroom.position().top<0?0:this.$elHeadroom.outerHeight(!0)+5;$("html,body").animate({scrollTop:t.offset().top-o},"fast")}else console.error("[HND-APP] Unkonwn or invalid anchor =>",e)}},e.prototype.InitHeadRoom=function(){if(this.$elHeadroom=$(this.options.elHeadroom),!this.$elHeadroom.length)throw new EInvalidHtmlElement("Invalid headroom element ["+this.options.elHeadroom+"]");this.$elHeadroom.headroom({offset:100,tolerance:5,classes:{initial:"animated",pinned:"slideDown",unpinned:"slideUp"},onUnPin:function(){$("body").addClass("header-up")},onPin:function(){$("body").removeClass("header-up")}})},e.prototype.InitMask=function(){var e=this;this.$elMask=$(this.options.elMask),this.$elMask.click(function(t){var o=e.$elMask.data("toggle");o&&$("body").removeClass(o)})},e.prototype.InitSearchEngine=function(){this.searchEngine=new HndJsSe},e.prototype.InitSearchForm=function(){var e=this;this.$elTreeSearch=$(this.options.elTreeSearch).first(),this.$elSearchForm=$(this.options.elSearchForm),this.$elSearchInfo=$(this.options.elSearchInfo),this.$elSearchInput=$(this.options.elSearchInput),this.$elSearchInfo.html(this._("Please enter 3 or more alpha-numeric characters")+"."),this.$elSearchInfo.show(),this.$elSearchInput.keyup(function(t){e.searchTerm=e.$elSearchInput.val(),e.DoHighlightText(e.searchTerm)}),this.$elSearchForm.submit(function(t){t.preventDefault();var o=e.$elTreeSearch.jstree(!0),n=$(t.target).find('input[type="text"]').first(),r=n.val();if(e.$elSearchInfo.hide(),o.delete_node(e.$elTreeSearch.find("li").toArray()),r.length<3)e.$elSearchInfo.html(e._("Search term too short")+". "+e._("Please enter 3 or more alpha-numeric characters")+"."),e.$elSearchInfo.show();else if(window.bSearchDataLoaded)if(oWl){e.searchEngine.ParseInput(r);var i=e.searchEngine.PerformSearch(oWl);if(0==i.length)e.$elSearchInfo.html(e._("No results")+". "+e._("Please enter 3 or more alpha-numeric characters")+"."),e.$elSearchInfo.show();else for(var a=0;a<i.length;a++)o.create_node("#",{parent:"#",text:decodeURIComponent(aTl[i[a][0]][1])+" ("+i[a][1]+")",a_attr:{href:aTl[i[a][0]][0]}})}else e.$elSearchInfo.html(e._("Incorrect or corrupt search data. Please check your HelpNDoc template")),e.$elSearchInfo.show();else e.$elSearchInfo.html(e._("Word list not ready yet. Please wait until the word list is fully downloaded.")),e.$elSearchInfo.show()})},e.prototype.InitToggler=function(){var e=this;this.$elToggler=$(this.options.elToggler),this.$elToggler.click(function(t){var o=window.matchMedia("(max-width: 768px)").matches?e.options.classNavExpandedSmall:e.options.classNavExpandedMedium;$("body").toggleClass(o)})},e.prototype.InitTrees=function(){var e=this;this.$elTreeContainers=$(this.options.elTreeContainers),this.$elTreeContainers.each(function(t,o){var n=$(o).data("url"),r=null;n&&(r={url:n}),$(o).on("changed.jstree",function(t,o,n,r){if("select_node"===o.action){var i=o.node.a_attr.href,a=o.node.id,s=o.node.text,l=o.node.a_attr.target||"_self",c=$(o.event.target).data("related");if(c&&c.length){for(var h='<ul class="popover-list">',p=0;p<c.length;p++)h=h+'<li><a href="'+c[p].url+'">'+c[p].title+"</a></li>";h+="</ul>",$(o.event.target).data("bs.popover")?$(o.event.target).popover("toggle"):($(o.event.target).popover({content:h,html:!0,placement:"auto bottom",title:e._("Related topics..."),trigger:"focus"}),$(o.event.target).popover("show"))}else $("body").removeClass("sm-nav-expanded"),e.DoHandleLink(a,s,i,l)}}).on("ready.jstree",function(t,n){e.SelectTopicInToc("","",!0);var r=parseInt($(o).data("openlvl"),10);r&&e.OpenTreeToLevel($(o),r)}).jstree({core:{animation:e.options.animationDelay,check_callback:$(o).is($(e.options.elTreeSearch)),multiple:!1,strings:{"Loading ...":e._("Loading...")},themes:{dots:!1,responsive:!0},data:r},types:{default:{icon:"icon-default"}},plugins:["types"]})})},e.prototype.InitHistory=function(){var e=this;window.onpopstate=function(t){e.$elTopicContainer.load(window.location+" "+e.options.elTopicContent,function(t,o,n){e.SelectTopicInToc("","",!1),e.DoScrollToAnchorIfNeeded()})}},e.prototype.InitLinks=function(){var e=this,t=function(t){t.preventDefault();var o=t.currentTarget;$("body").removeClass("sm-nav-expanded"),e.DoHandleLink("","",o.href,o.target)};this.$elTopicContainer.on("click","a",t),$("body").on("click",".popover a",t)},e.prototype.Init=function(){if(this.$elTopicContainer=$(this.options.elTopicContainer),!this.$elTopicContainer)throw new EInvalidHtmlElement("Invalid topic container element ["+this.options.elTopicContainer+"]")},e.prototype.Boot=function(){try{this.InitTrees(),this.InitLinks(),this.InitHistory(),this.InitToggler(),this.InitMask(),this.InitSearchEngine(),this.InitSearchForm(),this.InitHeadRoom()}catch(e){console.error("[HND-APP] An error occurred while booting the application =>",e.toString())}},e.prototype.OpenTreeToLevel=function(e,t){try{if(t){var o=$(e).jstree(!0);o&&$(o.get_json("#",{no_a_attr:!0,no_children:!1,no_data:!0,no_id:!1,no_li_attr:!0,no_state:!0,flat:!0})).each(function(e,n){var r=o.get_node(this.id);r.parents.length<=t&&o.open_node(r)})}}catch(e){console.error("[HND-APP] An error occurred while opening the tree =>",e.toString())}},e.prototype.SelectTopicInToc=function(e,t,o){void 0===o&&(o=!1),"string"==typeof e&&""!==e||(e=$(this.options.elTopicContent).data("hnd-id")),"string"==typeof t&&""!==t||(t=$(this.options.elTopicContent).data("hnd-title")),"string"==typeof e&&""!==e&&(this.$elTreeContainers.jstree("deselect_all",!0),this.$elTreeContainers.jstree("select_node",e,!0,!1),t&&""!==t&&(document.title=t),o&&setTimeout(function(){var t=document.getElementById(e+"_anchor");t&&t.scrollIntoView()},this.options.animationDelay+50))},e}();e.App=o}(Hnd||(Hnd={}));