/* Copyright © 2017 Adobe Systems Incorporated. All rights reserved. Generated by Adobe RoboHelp 2017 */ (function(){var a,b,c,d,rh;rh=window.rh,b=rh._,a=rh.$,c=rh.consts,d=rh.model,b.getRootUrl=function(){var a;return a=null,function(){return null!=a?a:a=""+b.getHostFolder()+c("START_FILEPATH")}}(),b.runTopicLoadingAnimation=function(){var a,e;return a=null,e=!1,function(f){return e=f,f?(null==a&&(a=b.debounce(function(){return d.publish(c("EVT_TOPIC_LOADING"),e)},700)),a()):(a=null,d.publish(c("EVT_TOPIC_LOADING"),!1))}}(),b.getTopicFrame=function(){var b;return b=window.gTopicFrameName||"rh_default_topic_frame_name",a("[name="+b+"]",0)}}).call(this),function(){var a,b,c,d,e,f,g,rh;rh=window.rh,b=rh._,a=rh.$,c=rh.consts,e=rh.model,e.publish(c("KEY_SHOW_TAGS"),"true"===rh._params.showtags),e.publish(c("KEY_IFRAME_EVENTS"),{click:!0}),f={},d=function(){var a;return a=b.hashParams(),e.publish(c("EVT_HASH_CHANGE"),{oldMap:f,newMap:a},{sync:!0}),f=a},g=function(){var a,d,e,f,g,h;if(g=b.extractParamString(document.location.href),f=b.urlParams(g),d=b.extractHashString(document.location.href),a=b.hashParams(d),e=c("RHMAPNO"),h=c("HASH_KEY_TOPIC"),!(e in f||h in a))return document.location=c("DEFAULT_TOPIC")},b.addEventListener(window,"hashchange",d),b.addEventListener(window,"orientationchange",function(a){var d,f;if(e.publish(c("EVT_ORIENTATION_CHANGE"),null),e.get(c("KEY_SCREEN_IPAD"))&&(f=b.getTopicFrame()))return d=f.style.display,f.style.display="none",f.offsetHeight,b.defer(function(){return f.style.display=d,b.delay(function(){return f.offsetHeight,b.delay(function(){return f.offsetHeight},500)},200)})}),e.subscribe(c("EVT_WIDGET_LOADED"),function(){var a,f,h,i,j,k;return e.subscribe(c("KEY_MERGED_FILTER_KEY"),function(){return new rh.widgets.ExpressionBuilder}),new rh.widgets.BrowseSequenceBuilder,d(),rh.layoutPrint=window.print,window.print=function(){return e.publish(c("EVT_PRINT_TOPIC"),null)},j=b.getFileName(document.location.href),j===c("TOPIC_FILE")&&(i=g())?i:(k=b.getTopicFrame())?k.onload=function(){return e.publish(c("EVT_TOPIC_LOADED"),null)}:(h=b.extractParamString(document.location.href),f=b.urlParams(h),a=c("RHMAPNO"),a in f?document.location=c("TOPIC_FILE")+"?"+h:void 0)}),e.subscribe(c("EVT_BOOKMARK")+"#content_top_placeholder",function(){return e.publish(c("EVT_SCROLL_TO_TOP"),null)}),e.subscribe(c("KEY_PROJECT_LIST"),function(){return rh.filterObject=new rh.MergeProj}),e.subscribe(c("EVT_PROJECT_LOADED"),function(){var a;return a="deviceready",document.addEventListener(a,function(){if(null!=window.cordova)return e.publish(c("KEY_MOBILE_APP_MODE"),!0)})})}.call(this),function(){var a,b,c,d,rh;rh=window.rh,d=rh.model,b=rh._,c=rh.consts,a=function(){function a(){this.tagCombs=[],this.idmap={},this.filter=[],this.grpType="group",this.dataLoaded=!1,this.loadTagData(d.get(c("KEY_PROJECT_LIST"))),this.caption=this.type=this.defFilter=void 0}var e,f;return a.prototype.updateTagCombs=function(a){var e,f;if(f=d.get(c("KEY_PROJECT_TAG_COMBINATIONS")),null!=f)return a=b.parseProjectName(a),null!=(e=this.idmap)[a]?e[a]:e[a]=f},a.prototype.lookup=function(a,b,c){var d,e,f,g,h;if(null==c&&(c=!0),null!=a&&null!=b)for(g=0,h=a.length;g-1)return this.filter.splice(this.filter.indexOf(c),1)},a.prototype.updateFilter=function(){var a,b,e,f,g;for(a=d.get(c("KEY_TEMP_DATA"))||[],this.caption||(this.caption=a.caption),this.type||(this.type=a.type),"undefined"==typeof this.defFilter&&(this.defFilter=a["default"]),a=a.tags||[],d.publish(c("KEY_TEMP_DATA")),g=[],e=0,f=a.length;e0&&a.push({c:e,u:this.getUnchecked(d,e)}),a},[],this),rh.model.publish(d("KEY_TAG_EXPRESSION"),b)):rh.model.publish(d("KEY_TAG_EXPRESSION"),[])},a.prototype.handleTagStates=function(a){return null==a&&(a={}),this.computeExpression(a),e.persist("tag_states",a)},a.prototype.prepareTagStates=function(){return rh.model.subscribe(d("KEY_PROJECT_FILTER_TYPE"),function(a){return function(){var g,h;if(f&&(g=rh.model.get(d("KEY_MERGED_FILTER_KEY")),h=a.parseUrlFilter(g,f.split(b))),h||(h=e.fetch("tag_states")),h||(h=c.clone(rh.model.get(d("KEY_DEFAULT_FILTER")))),h)return rh.model.publish(d("KEY_PROJECT_TAG_STATES"),h)}}(this))},a.prototype.parseFilterElemnt=function(a,b){var d,e,f,g;return g=b.split(h),f=g[0],d=g[1]&&g[1].split(i),e=c.findIndex(a,function(a){return null!=d==(null!=a.children)&&a.display===f}),{index:e,elements:d}},a.prototype.parseUrlFilter=function(a,b){var e,f;if(b||b.length)return f="radio"===rh.model.get(d("KEY_PROJECT_FILTER_TYPE")),e=!0,c.reduce(b,function(b,c,d){var g,h,i;return i=this.parseFilterElemnt(a,c),d=i.index,g=i.elements,d!==-1&&(h=a[d],h.children?b[d]=this.parseUrlFilter(h.children,g):f&&!e||(e=!1,b[d]=h.name)),b},{},this)},a}(),rh.widgets.ExpressionBuilder=b}.call(this),function(){var a,b,c,rh;rh=window.rh,c=rh._,a=rh.$,b=function(){function a(){var a,b;a=function(a){var b,d,e,f;if(b=rh.model.get("t.brsmap"),null!=b)return e=b.n&&b.n[0]||"",f=b.p&&b.p[0]||"",d=window.decodeURI(document.location.href),c.isEmptyString(e)||(e=window._getRelativeFileName(d,e)),c.isEmptyString||(f=window._getRelativeFileName(d,f)),rh.model.publish("l.brsBack",f),rh.model.publish("l.brsNext",e)},b=function(){var a,b,c,d;return d=rh.model.get(rh.consts("KEY_UI_MODE")),b=rh.model.get("l.brsBack"),a=rh.model.get("l.brsNext"),c=!(d||!b&&!a),rh.model.publish("l.show_brs",c)},rh.model.subscribe("t.topicurl",c.debounce(a,200)),rh.model.subscribe("t.brsmap",c.debounce(a,200)),rh.model.subscribe("l.brsBack",b),rh.model.subscribe("l.brsNext",b),rh.model.subscribe(rh.consts("KEY_UI_MODE"),b)}return a}(),rh.widgets.BrowseSequenceBuilder=b}.call(this),function(){var a,b,c,d,rh,e,f;rh=window.rh,b=rh._,a=rh.$,c=rh.consts,d=rh.model,e=rh.rhs,f=null,f=d.subscribe(c("KEY_TAG_EXPRESSION"),function(){var a;return a=!1,function(){if(f&&f(),!a)return a=!0,d.subscribe(c("KEY_SEARCHED_TERM"),function(){return d.publish(c("KEY_ONSEARCH_TAG_EXPR"),JSON.stringify(d.get(c("KEY_TAG_EXPRESSION"))))})}}()),d.subscribe(c("EVT_SEARCH_TERM"),function(){var a,e,f;return a=d.get(c("KEY_CAN_HANDLE_SEARCH")),f=d.get(c("KEY_SEARCH_TERM"))||null,e={},e[c("HASH_KEY_RH_SEARCH")]=f,e[c("HASH_KEY_UIMODE")]="search",a!==!0?document.location=window.gRootRelPath+"/"+(window.gSearchPageFilePath||c("START_FILEPATH"))+("?#"+b.mapToEncodedString(e)):(d.publish(c("EVT_QUERY_SEARCH_RESULTS"),!0),b.defer(function(){return b.updateHashMap(e,!0)}))}),d.subscribe(c("EVT_PROJECT_LOADED"),function(){return window.readSetting&&window.readSetting(RHANDSEARCH,function(a){return d.publish(c("KEY_AND_SEARCH"),a)}),d.subscribe(c("KEY_AND_SEARCH"),function(a){return saveSetting(RHANDSEARCH,"1"===a?"1":"0",!0)})}),d.subscribe(c("EVT_QUERY_SEARCH_RESULTS"),function(){if(!e.doSearch())return window.doSearch()})}.call(this),function(){var a,b,c,rh;rh=window.rh,b=rh._,a=rh.$,c=rh.consts,rh.model.subscribe(c("EVT_WIDGET_BEFORELOAD"),function(){var b;if(null!==a("a.wShow",0))return b=a(".contenttopic",0),a.setAttribute(b,"data-rhwidget","Basic"),a.setAttribute(b,"data-class","govt_csh:@.l.csh_mode;govt_nocsh:!@.l.csh_mode")})}.call(this),function(){var a,b,c,d,rh,e=function(a,b){return function(){return a.apply(b,arguments)}};rh=window.rh,c=rh._,a=rh.$,d=rh.consts,b=function(){function b(a){this.widget=a,this.click=e(this.click,this)}var f,g,h;return f="group",g="item",h=d("KEY_PROJECT_FILTER_TYPE"),b.prototype.click=function(a){var b,e,f,g,h;return h=a.currentTarget,b=a.target,e=this.getItemNode(b,h),g=""+d("KEY_PROJECT_TAG_STATES")+this.getItemKey(e),f=this.widget.get(g),"radio"!==this.filterType()?this.handleCheckboxClick(e,g,f):this.handleRadioClick(e,g,f),c.preventDefault(a)},b.prototype.handleRadioClick=function(a,b,d){var e,f,g,h;if(!this.isGroupNode(a)&&!d)return h=c.splitKey(b),g=h.parentKey,e=h.key,f={},f[e]=this.getItemValue(a),this.widget.publish(g,f)},b.prototype.handleCheckboxClick=function(a,b,d){var e,f;return this.isGroupNode(a)?(e=c.any(d,function(a){return a}),f=e?void 0:this.getGroupItemExprs(a),this.widget.publish(b,f)):(f=d?void 0:this.getItemValue(a),this.widget.publish(b,f))},b.prototype.getItemNode=function(b,d){return c.findParentNode(b,d,function(b){return"LI"===a.nodeName(b)})},b.prototype.getItemValue=function(b){return a.dataset(b,"itemvalue")},b.prototype.getGroupItemExprs=function(b){var d,e;return e=a.dataset(b,"itemkey"),d=this.widget.get(""+this.widget.key+e),c.map(d.children,function(a){return a.name})},b.prototype.getItemKey=function(b){return a.dataset(b,"itemkey")},b.prototype.isGroupNode=function(b){return a.hasClass(b,f)},b.prototype.isItemNode=function(b){return a.hasClass(b,g)},b.prototype["class"]=function(a){return a.children?f:g},b.prototype.value=function(a){return a.children?null:a.name},b.prototype.filterType=function(){return this.widget.get(h)||"checkbox"},b.prototype.inputType=function(a){var b;return b=this.filterType(),a.children&&"radio"===b&&(b=void 0),b},b}(),rh.controller("FilterController",b)}.call(this),function(){var a,b=function(a,b){return function(){return a.apply(b,arguments)}};a=function(){function a(a){this.widget=a,this.triggerDelayLoadWidgets=b(this.triggerDelayLoadWidgets,this),this.init(),this.subscribeActiveTab(),this.subscribeToLocations(),this.subscribeScreens(),this.widget.subscribe(p("EVT_PROJECT_LOADED"),function(a){return function(){return a.subscribeUIMode(),a.subscribeMergedFilter(),a.subscribeTopicClick(),a.subscribeTopicScroll(),a.subscribForSearchResult(),a.subscribeTopicNavigate(),a.subscribeToDelayLoadEvents(),a.widget.publish(p("KEY_IFRAME_EVENTS"),{click:!0,scroll:!1})}}(this))}var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,rh,r,s;return rh=window.rh,o=rh._,c=rh.$,p=rh.consts,f=p("KEY_FEATURE"),g=p("KEY_FILTER_LOCATION"),i=p("KEY_SEARCH_LOCATION"),e=p("KEY_ACTIVE_TAB"),k=p("KEY_UI_MODE"),h=p("KEY_MOBILE_TOC_DRILL_DOWN"),j=p("KEY_TOC_DRILL_DOWN"),d="desktop",n="tablet",l="phone",m="filter"!==rh._params.hideUI,s={desktop:["toc","idx","glo","filter","fts"],tablet:["toc","idx","glo","filter","fts"],phone:["toc","idx","glo","filter","fts"]},r={desktop:["toc","idx","glo","filter","fts"],tablet:["toc","idx","glo","filter","fts"],phone:["toc","idx","glo"]},q={idx:{evt:"EVT_LOAD_IDX",f_key:"delay_load_idx"},glo:{evt:"EVT_LOAD_GLO",f_key:"delay_load_glo"}},a.prototype.init=function(){return this.screens=this.widget.get(p("KEY_SCREEN_NAMES")),rh.storage.init(p("HELP_ID")),this.activeScreen=o.find(this.screens,function(a){return this.widget.get(p("KEY_SCREEN")+"."+a+".attached")},this),null==this.activeScreen&&(this.activeScreen=this.widget.get(p("KEY_DEFAULT_SCREEN"))),this.assureLocations(this.activeScreen),this.initDefauls(),this.initActiveTab()},a.prototype.initDefauls=function(){var a;return a=this.widget.get(p("KEY_DEFAULT_TAB")),this.hasFeature(a)||(a=null),this.defaultTabs={},o.each(this.screens,function(b){return s[b]=o.filter(s[b],function(a){return this.hasFeature(a)},this),r[b]=o.filter(r[b],function(a){return this.hasFeature(a)},this),this.defaultTabs[b]=a&&-1!==s[b].indexOf(a)?a:s[b][0]},this)},a.prototype.initActiveTab=function(){var a;if(a=rh.storage.fetch("activetab"),void 0!==a&&a&&this.hasFeature(a))return this.widget.publish(e,a)},a.prototype.isValidTab=function(a,b){return null==b&&(b=this.activeScreen),!(!a||!this.hasFeature(a))&&((b!==d||!("filter"===a&&"content"===this.widget.get(g)||"fts"===a&&"content"===this.widget.get(i)))&&-1!==s[b].indexOf(a))},a.prototype.defaultTab=function(a){var b;return null==a&&(a=this.activeScreen),b=this.defaultTabs[a],this.isValidTab(b)||(b=o.find(s[a],function(a){return this.isValidTab(a)},this)),b},a.prototype.assureValidActiveTab=function(a){var b;if(null==a&&(a=this.activeScreen),b=this.widget.get(e),a===d||b)return this.isValidTab(b)||(b=this.defaultTab()),this.widget.publish(e,b)},a.prototype.toggleSideBar=function(){return this.widget.get(e)?this.widget.publish(e,null):this.widget.publish(e,this.lastMobileTab||this.defaultTab())},a.prototype.toggleActiveTab=function(a){return this.widget.publish(e,this.isDesktopScreen()||a!==this.widget.get(e)?a:null)},a.prototype.triggerDelayLoadWidgets=function(a){var b;if(b=q[a],b&&this.hasFeature(b.f_key))return this.widget.publish(p(b.evt),!0)},a.prototype.subscribeToDelayLoadEvents=function(){return this.widget.subscribe(e,this.triggerDelayLoadWidgets)},a.prototype.filterDone=function(){return this.widget.publish(e,this.searchMode?"fts":null)},a.prototype.hasFeature=function(a){return void 0===a||!1!==this.widget.get(f+"."+a)},a.prototype.subscribeUIMode=function(){var a;if(a=function(a){return function(){if(a.isValidTab("fts"))return a.isDesktopScreen()&&"tabbar"!==a.widget.get(i)?void 0:a.widget.publish(e,"fts")}}(this),this.widget.subscribe(k,function(a){return function(b){return a.widget.publish("active_content",b)}}(this)),this.widget.subscribe("active_content",function(b){return function(c){return b.isMobileScreen()&&!c?b.widget.publish(e,null):"search"===c?a():void 0}}(this),{initDone:!0}),"search"===this.widget.get("active_content"))return a()},a.prototype.subscribeMergedFilter=function(){var a;if(this.widget.get(a=f+".filter"))return this.widget.subscribe(p("KEY_MERGED_FILTER_KEY"),function(b){return function(c){return b.widget.publish(a,!!(c&&c.length&&m)),b.assureValidActiveTab()}}(this))},a.prototype.subscribeTopicClick=function(){return this.widget.subscribe(p("EVT_CLICK_INSIDE_IFRAME"),function(a){return function(){if(a.activeScreen===l&&a.widget.get(e))return a.toggleSideBar()}}(this))},a.prototype.subscribeTopicNavigate=function(){return this.widget.subscribe(p("EVT_NAVIGATE_TO_URL"),function(a){return function(b){if(b.absUrl&&o.isUrlAllowdInIframe(b.absUrl))return a.widget.publish("active_content",null)}}(this))},a.prototype.subscribeTopicScroll=function(){return this.widget.subscribe(p("EVT_SCROLL_INSIDE_IFRAME"),function(a){return function(b){var c,d;return c="down"===b.dir||b.scrollTop>10,a.widget.publish("hide_header",c),d="down"===b.dir&&b.scrollTop>10,a.widget.publish("hide_mobile_functions",d)}}(this))},a.prototype.subscribeActiveTab=function(){return this.widget.subscribe(e,function(a){return function(b){return rh.storage.persist("activetab",b),a.isMobileScreen()?(a.isSidebarTab(b)&&(a.lastMobileTab=b),a.searchMode="fts"===b||a.searchMode&&"filter"===b):a.searchMode=!1}}(this))},a.prototype.subscribeScreens=function(){return o.each(this.screens,function(a){var b;return b=p("KEY_SCREEN")+"."+a+".attached",this.widget.get(b)&&this.handleScreen(!0,a),this.widget.subscribe(b,function(b){return function(c){return b.handleScreen(c,a)}}(this),{initDone:!0})},this)},a.prototype.subscribeToLocations=function(){return this.widget.subscribe(i,function(a){return function(){return a.assureValidActiveTab(a.activeScreen)}}(this)),this.widget.subscribe(g,function(a){return function(){return a.assureValidActiveTab(a.activeScreen)}}(this))},a.prototype.subscribForSearchResult=function(){var a;return a=function(a){return function(){var b,c;if(c=a.widget.get(p("KEY_TAG_EXPRESSION")),b=a.widget.get(p("KEY_ONSEARCH_TAG_EXPR")),b&&b!==JSON.stringify(c))return a.widget.publish(p("EVT_SEARCH_TERM"),!0)}}(this),this.widget.subscribe(p("KEY_TAG_EXPRESSION"),o.debounce(function(b){return function(){if((!b.isValidTab("fts")||"fts"===b.widget.get(e))&&b.isSearchMode(b.widget.get(e)))return a()}}(this),300)),this.widget.subscribe(e,function(b){if("fts"===b)return a()})},a.prototype.isMobileScreen=function(){return this.activeScreen===l},a.prototype.isDesktopScreen=function(){return this.activeScreen===d},a.prototype.isTabletScreen=function(){return this.activeScreen===n},a.prototype.isSidebarTab=function(a){return a&&-1!==r[this.activeScreen].indexOf(a)},a.prototype.isSearchMode=function(a){var b;return b=this.widget.get("active_content"),"fts"===a||"search"===b&&this.isDesktopScreen()&&"content"===this.widget.get(i)},a.prototype.handleScreen=function(a,b){return a?(this.activeScreen=b,this.handleAttached(b)):this.handleDetached(b)},a.prototype.handleDetached=function(a){return o.defer(function(b){return function(){if(a===d)return b.widget.publish(e,"search"===b.widget.get("active_content")&&b.isValidTab("fts")?"fts":null)}}(this))},a.prototype.handleAttached=function(a){return this.assureLocations(a),this.assureValidActiveTab(a),this.assureTOCMode(a)},a.prototype.assureLocations=function(a){return null==a&&(a=this.activeScreen),this.widget.publish(i,a===d?this.widget.get(p("KEY_DEFAULT_SEARCH_LOCATION")):a===n?"tabbar":"content"),this.widget.publish(g,a===d||a===n?"tabbar":"content")},a.prototype.assureTOCMode=function(a){return null==a&&(a=this.activeScreen),this.widget.publish(j,a!==d&&this.widget.get(h))},a.prototype.newSearch=function(a,b,c){var d;if(13===b&&(d=this.widget.get(p("KEY_SEARCH_TERM")),d!==a&&this.widget.publish(p("KEY_SEARCH_TERM"),a),this.widget.publish(p("EVT_SEARCH_TERM"),!0),null!=c?c.target:void 0))return c.target.blur()},a.prototype.isTagStatesChanged=function(){var a,b;return a=o.compactObject(this.widget.get(p("KEY_PROJECT_TAG_STATES"))),b=o.compactObject(this.widget.get(p("KEY_DEFAULT_FILTER"))),!o.isEqual(a,b)},a.prototype.setDefaultTagStates=function(){var a;return a=this.widget.get(p("KEY_DEFAULT_FILTER")),this.widget.publish(p("KEY_PROJECT_TAG_STATES"),o.clone(a))},a}(),window.rh.controller("ModernLayoutController",a)}.call(this),function(){var a;a=function(){function a(a,d){var e;e=(null!=d?d.removeClasses:void 0)||["hide-children","loading"],c.each(e,function(c){return b.removeClass(a.node,c)}),c.each(null!=d?d.addClasses:void 0,function(c){return b.addClass(a.node,c)})}var b,c,rh;return rh=window.rh,b=rh.$,c=rh._,a}(),window.rh.controller("JsLoadingController",a)}.call(this),function(){var a,b,c,d,rh;rh=window.rh,b=rh._,d=rh.model,c=rh.consts,a=function(){function a(){l.push("."),m.push("."),h()}var e,f,g,h,i,j,k,l,m;return l=[],m=[],k="projectdata.js",f="remote",e="project",g="url",MERGEDCHILDID="mergedchildid",j=0,i=function(a){var i;return i=a+"/"+k,window.xmlJsReader.loadFile(i,function(a,i){var k,n,o;k=0,j++,null!=a&&(n=a.getElementsByTagName(e)[0],o=n.getElementsByTagName(f),k=o.length);var p=[];if(b.each(o,function(a){var b,c;return b=i+"/"+a.getAttribute(g),c=a.getAttribute(MERGEDCHILDID),p.push({path:b,id:c}),m.push(b)}),l=l.concat(sortProjectList(p)),h(),0===m.length&&j===l.length)return d.publish(c("KEY_PROJECT_LIST"),l),d.publish(c("KEY_MASTER_PROJECT_LIST"),["."])},a)},sortProjectList=function(a){return a=a.sort(function(a,b){var c=getProjectSortData(a),d=getProjectSortData(b),e=comparePrefix(c.prefix,d.prefix);return 0!==e?e:c.childOrder>d.childOrder?1:c.childOrderb[e]?1:a[e]b.length?1:0:c}return 1}return-1}return 0},h=function(){var a,b;for(b=[];m.length>0;)a=m.splice(0,1),b.push(i(a));return b},a}(),d.subscribe(c("EVT_PROJECT_LOADED"),function(){return b.defer(function(){if(!d.get(c("KEY_PUBLISH_MODE"))&&!window.gbPreviewMode)return new a})})}.call(this),function(a,b,c){"use strict";function d(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var h=function(){function a(a,b){for(var c=0;c0&&(d="#"+d);var e=g.urlParams(g.extractParamString(b)),f=!0,j=!1,k=void 0;try{for(var l,m=Array.from(p)[Symbol.iterator]();!(f=(l=m.next()).done);f=!0){var n=l.value;null!=a[n]&&(e[n]=a[n])}}catch(q){j=!0,k=q}finally{try{!f&&m["return"]&&m["return"]()}finally{if(j)throw k}}i.get(h("KEY_SCREEN_IOS"))&&(e[o]=g.uniqueId());var r=g.mapToEncodedString(e);return r.length>0&&(r="?"+r),""+c+r+d},r=g.queueUpdateHashMap,s=function(a){return null==a&&(a={}),a[l]=null,a[o]=null,a[m]||(a[m]=null),a[n]||(a[n]=null),a},t=function(a,b){a=g.fixRelativeUrl(a);var c=g.urlParams(g.extractParamString(a));return c[k]=g.stripParam(a),c=s(c),r(c,b)},u=function(a,b){var c={};return c[k]=a,c=s(c),r(c,b)},v=function(b){var c=void 0,d=b.newMap,e=b.oldMap,f=e[l],o=d[l];if(j in d){var p=d[j];c=p!==i.get(h("KEY_SEARCHED_TERM")),i.publish(h("KEY_SEARCH_TERM"),p,{sync:!0})}if("search"===o&&c&&a.gHost&&i.publish(h("EVT_QUERY_SEARCH_RESULTS"),!0),!o||d[k]){var r=void 0,s=i.get(h("KEY_TOPIC_IN_IFRAME"));k in d&&(r=d[k]),r||(r=s);var t=rh.model.get(rh.consts("KEY_FEATURE"));r||t&&t.showDefTopic===!1||(r=null!=a.gDefaultTopic?a.gDefaultTopic.substring(1):void 0);var u=r&&(r!==s||f!==o||e[n]!==d[n]||e[m]!==d[m]);u&&(g.stripBookmark(r)!==g.stripBookmark(s)&&g.runTopicLoadingAnimation(!0),i.publish(h("KEY_TOPIC_IN_IFRAME"),r),a.loadTopic(q(d,r)))}return i.publish(h("KEY_UI_MODE"),d[l])},w=function(c){var d=g.hashParams();if(c&&!d[l]){var e=decodeURI(b.location.href),f=a._getRelativeFileName(e,c),j=d[k];if(!j||g.filePath(f)!==g.filePath(j))return i.publish(h("KEY_TOPIC_IN_IFRAME"),f),t(f,!1)}},x=function(a){var c=a.absUrl;if(!g.isRootUrl()){if(!g.isRootUrl(c)){var d=void 0,e=void 0,f=g.getRootUrl();g.isExternalUrl(c)?e=c:(d=g.getParamsForRoot(c),e=g.fixRelativeUrl(g.makeRelativePath(c,f))),c=""+f+d+"#t="+encodeURIComponent(e)}return b.location.href=c}if(!g.isUrlAllowdInIframe(c))return u(c,!0);if(c=g.makeRelativeUrl(g.fixRelativeUrl(c)),g.isHomeUrl(c))return b.location.href=c;var i=c&&g.filePath(c);if(i===h("START_FILEPATH")?c=c.substring(i.length):c||(c="#ux"),"#"===c[0]||"?"===c[0]){var j=g.hashParams(g.extractHashString(c));return l in j||(j[l]=null),r(j,!0)}return c?t(c,!0):void 0};i.subscribe(h("EVT_WIDGET_LOADED"),function(){return g.addEventListener(b,"click",g.hookClick),i.subscribe(h("EVT_HASH_CHANGE"),v),i.subscribe(h("KEY_TOPIC_URL"),w),i.subscribe(h("EVT_NAVIGATE_TO_URL"),x),i.subscribe(h("KEY_TOPIC_IN_IFRAME"),function(c){if(""+a.gHost+a.gHostPath!="/"&&(a.setTopic&&a.setTopic(),a.changeTopicLink))return a.changeTopicLink(b.location.toString())}),i.subscribe(h("EVT_TOPIC_LOADED"),function(){return g.runTopicLoadingAnimation(!1)}),i.subscribe(h("EVT_INSIDE_IFRAME_DOM_CONTENTLOADED"),function(){return g.runTopicLoadingAnimation(!1)})})},{}],2:[function(b,c,d){var i=a,rh=i.rh,j=rh.model,k=rh._,l=rh.consts,m=(rh.http,function(){var a=void 0;return m=function(b){function c(a){e(this,c);var b=f(this,(c.__proto__||Object.getPrototypeOf(c)).call(this));return b.data=[],b.chunkCount=0,b.count=0,b.keys="",b.alhpabet="",b.loadNavData("glo"),b.filter="",b.widget=a,b.widget.publish("show",{}),b}return g(c,b),h(c,null,[{key:"initClass",value:function(){a="entrys"}}]),h(c,[{key:"addElement",value:function(b,c){var d=this;return function(){var e=[];return k.each(b[a],function(a){null!=a&&(d.lookup(c,a)?e.push(void 0):e.push(c.push(a)))},d),e}()}},{key:"exists",value:function(a){var b=this.alphaText(a);return this.alhpabet.indexOf(b)>-1||(this.alhpabet+=b,!1)}},{key:"isFiltered",value:function(a,b){var c=b?j.get(b):this.filter;return c&&a.toLocaleLowerCase().indexOf(c.toLocaleLowerCase())===-1}},{key:"alphaText",value:function(a){return a.toUpperCase().charAt(0)}},{key:"filterGlo",value:function(a){return this.filter=a.toLocaleLowerCase(),this.alhpabet="",j.publish(l("PROJECT_GLOSSARY_DATA"),j.get(l("PROJECT_GLOSSARY_DATA")))}}]),c}(rh.NavController),m.initClass(),m}());rh.controller("GlossaryController",m)},{}],3:[function(c,i,j){function k(a,b){return"undefined"!=typeof a&&null!==a?b(a):void 0}var l=a,rh=l.rh,m=rh.model,n=rh._,o=rh.consts,p=rh.http,q=rh.rhs,r="topics",s=function(){function b(){e(this,b),this.updateData=this.updateData.bind(this)}return h(b,[{key:"lookup",value:function(a,b){var c=void 0;return null!=a&&null!=b&&n.any(a,function(a){if(null!=a)return b.type===a.type&&b.name===a.name&&n.isEqual(b.url,a.url)&&(c=a),null!=c},this),c}},{key:"sort",value:function(b){return b.sort(function(b,c){return a.compare(b.name,c.name)})}},{key:"updateData",value:function(a,b){var c=m.get(o("KEY_TEMP_DATA"))||[];if(m.publish(o("KEY_TEMP_DATA")),this.addElement(c,this.data,b,this.keys),0===--this.chunkCount&&0===this.count)return this.sort(this.data),m.publish(o(a),this.data)}},{key:"getChunkData",value:function(a,b){this.count--;var c=k(m.get(o("KEY_TEMP_DATA")),function(a){return a.chunkinfos})||[];return this.chunkCount+=c.length,n.each(c,function(c){var d=this;return a&&(a=n.ensureSlash(a)),n.loadScript(a+"whxdata/"+c.node+".new.js",!1,function(){return d.updateData(b,a)})},this)}},{key:"loadNavData",value:function(a){var b=this;return m.subscribe(o("KEY_PROJECT_LIST"),function(c){return b.alhpabet="",b.count+=c.length,n.each(c,function(b){var c=this;return b&&(b=n.ensureSlash(b)),n.loadScript(b+"whxdata/"+("ndx"===a?"idx":"glo")+".new.js",!1,function(){return c.getChunkData(b,"ndx"===a?"PROJECT_INDEX_DATA":"PROJECT_GLOSSARY_DATA")})},b)})}}]),b}();rh.NavController=s;var t=function(){var a=void 0;return t=function(c){function i(a){e(this,i);var b=f(this,(i.__proto__||Object.getPrototypeOf(i)).call(this));return b.data=[],b.chunkCount=0,b.count=0,b.alhpabet="",b.filter="",b.keys="keys",b.widget=a,m.subscribeOnce(o("EVT_PROJECT_LOADED"),function(){return b.loadNavData("ndx"),b.getIndexData(),m.subscribe(o("KEY_INDEX_FILTER"),function(){return b.alhpabet=""})}),b}return g(i,c),h(i,null,[{key:"initClass",value:function(){a=""}}]),h(i,[{key:"addElement",value:function(b,c,d,e){var f=this;if(null!=b[e])return function(){var g=[];return n.each(b[e],function(b){if(null!=b){var e;if(!(e=f.lookup(c,b))){var h={type:b.type,name:b.name};b["data-rhtags"]&&(h["data-rhtags"]=b["data-rhtags"]+"+"+d),b.url||(h[r]=[]);var i=n.makeRelativeUrl(""+d,a);null!=b.url&&(h.url=""+encodeURI(i)+b.url),null==b.url&&(h[f.keys]=[]),c.push(h),e=c[c.length-1]}f.addElement(b,e[f.keys],d,f.keys),g.push(f.addElement(b,e[r],d,r))}},f),g}()}},{key:"showItem",value:function(a){var b=m.get(o("KEY_INDEX_FILTER"));return!b||a.toLocaleLowerCase().indexOf(b.toLocaleLowerCase())!==-1}},{key:"showCategory",value:function(a,b){if(b>0)return!1;var c=this.alphaText(a);return!(this.alhpabet.indexOf(c)>-1)&&(this.alhpabet+=c,!0)}},{key:"showNextLevel",value:function(a){for(var b=a.getAttribute("data-indexid"),c=this.widget.get("show."+b),e=d({},b,!c);b;)b=b.substr(0,b.lastIndexOf("_")),e[b]=!0;return this.widget.publish("show",e)}},{key:"alphaText",value:function(a){return a.toUpperCase().charAt(0)}},{key:"getIndexData",value:function(){return m.subscribeOnce(o("KEY_PUBLISH_BASE_URL"),function(){try{var a=m.get(o("KEY_PUBLISH_BASE_URL")),c=b.location.origin,d=a.substr(c.length);n.parentPath(n.filePath(n.getRootUrl()));if(d&&!n.isEmptyString(d)){var e=n.mapToEncodedString(n.extend(n.addPathNameKey({area:q.area(),prj:q.project(),type:q.type(),agt:"ndx",mgr:"agm"})));return p.get(d+"?"+e).success(function(a,b){a=JSON.parse(a);var c=[],d=[],e=a.allProjects,f=a,g=f.masterProjects;e.length&&(e[0]=n.ensureSlash(e[0]));var h=function(a,b){return n.each(a,function(a){return b.push(n.makeRelativeUrl(a,e[0]))})};h(e,c),h(g,d);var i=function(a,b,c){n.isEmptyString(a)&&(c[b]=".")};return n.each(c,i),n.each(d,i),m.publish(o("KEY_PROJECT_LIST"),c),m.publish(o("KEY_MASTER_PROJECT_LIST"),d)})}}catch(f){if(rh._debug)return rh._d("warn",f.message)}})}}]),i}(rh.NavController),t.initClass(),t}();rh.controller("IndexController",t)},{}],4:[function(a,b,c){var rh=a("../../src/lib/rh"),d=rh._;d.findEditDist=function(a,b){if(a==b)return 0;for(var c=[],d=[],e=0;e0?"@"+c.join("@"):""}),a},[]),b=g.splitAndTrim(a.topicID||"0","_"),this.bookNos=g.map(b.shift().split("."),function(a){return g.parseInt(a,0)}),this.pageNo=g.parseInt(b.shift(),0)}},{key:"syncToProjectToc",value:function(a,b,c){var d=void 0,e=void 0,f=void 0;if(this.tocPath.length>0){if(d=0,f=this.tocPath.shift(),e=g.findIndex(b,function(b){var c=void 0;return c=i.dataset(b,"childorder")||"",!(c!==f.order||!a.isBookNode(b)||(d++,d!==f.bookNo))}),e!==-1)return a.openBook(b[e],!0,function(d){return function(){return g.defer(function(){var f=void 0,g=void 0;if(f=b[e+1],g=f.children&&f.children[0])return d.syncToProjectToc(a,g.children,c)})}}(this))}else if(c)return c(b)}},{key:"syncToTocItem",value:function(a,b,c){var d=void 0,e=void 0,f=void 0;return null==c&&(c=1),e=0,d=0,f=null,g.any(b,function(b){return function(h){var j=void 0,k=void 0,l=void 0,n=void 0,o=void 0;if(k=i.dataset(h,"childorder")||"",k===b.order&&(a.isBookNode(h)&&(j=h,f=j),j&&d++,b.bookNos[0]===d)){if(a.isPageNode(h)&&(n=h),n&&e++,1===b.bookNos.length)0===b.pageNo?(o=h,f&&a.openBook(f,!0,function(){return a.updateBookInfo()})):n&&e===b.pageNo&&(o=h),a.updateBookInfo(),o&&a.selectLink(o,!0,c);else if(f&&(l=i.hasClass(h,"child")))return b.bookNos.shift(),a.openBook(f,!0,function(){return g.defer(function(){var c=void 0;if(c=h.children&&h.children[0])return b.syncToTocItem(a,c.children,m)})}),!0;return null!=o}}}(this))}}]),a}();return a}(),o=function(){var a=void 0,b=void 0,c=void 0,o=void 0,p=void 0,q=void 0,r=void 0,s=void 0,t=void 0,u=void 0,v=void 0,w=void 0;c="expanded",a="active",b="collapsing",o="expanding",v="loading-book",w="selected",t="show_child",r="bookid",p="active_bookid",s="level",q="active_level",u=".p.toc";var x="curtoc",y="data-tocitem",z=k("KEY_TOC_BREADCRUMBS"),A=function(){function A(a){var b=this;e(this,A),this.widget=a,this.subscribeTopicID=d(this.subscribeTopicID,this),this.onClick=d(this.onClick,this),this.updateBookInfo=d(this.updateBookInfo,this),this._data={},this.projectAbsRef=[],null==this.syncToc&&(this.syncToc=new n),this.widget.publish(s,0),this.widget.publish(r,"_"),rh.model.subscribe(u,function(a){b.widget.publish(x,a),b.widget.publish("curlevel",0)}),this.widget.subscribe(k("KEY_TOC_SELECT_ITEM"),this.selectTocItem.bind(this)),j.subscribeOnce([k("EVT_PROJECT_LOADED"),k("KEY_TOC_ORDER")],function(a){return function(){return j.get(k("KEY_PUBLISH_MODE"))?a.getTOCData():a.loadToc(u,"",function(){return a.widget.publish(k("EVT_TOC_LOADED"),!0),g.defer(function(){return a.widget.subscribe(rh.consts("KEY_TOPIC_ID"),a.subscribeTopicID)})})}}(this))}return h(A,[{key:"expandBook",value:function(a,b,c,d){this.selectTocItem({id:b});var e=i.getAttribute(c,"data-itemkey");rh.model.publish("EVT_TOC_LOADEDgototab",{tab:0,key:e,item:d})}},{key:"updateBookInfo",value:function(){var a=void 0,b=void 0;if(a=this.widget.get(p),null!=a&&a!==this.widget.get(r)&&this.widget.publish(r,a),b=this.widget.get(q),null!=b&&b!==this.widget.get(s))return this.widget.publish(s,b)}},{key:"updateActiveBookInfo",value:function(a,b){return this.widget.publish(p,b),this.widget.publish(q,a)}},{key:"getText",value:function(a){return a.textContent.trim()}},{key:"_getPreviousItemNode",value:function(a){var b=this.pid(i.getAttribute(a,"data-itemid"));return i.find(this.widget.node,'[data-itemid="'+b+'"]')[0]}},{key:"updateBreadcrumbInfo",value:function(a){var b=a,c=void 0,d=[];if(this.isTOCItem(a)){for(d.push(this._createBreadcrumbItem(b));c=this._getPreviousItemNode(b);)d.push(this._createBreadcrumbItem(c)),b=c;d.reverse(),d.length>0&&(d[d.length-1].lastNode=!0),d.curlevel=this.widget.get("curlevel"),this.widget.publish(z,d)}}},{key:"_createBreadcrumbItem",value:function(a){var b=a;this.hasTOCItemLink(a)||(b=this._findFirstLink(a));var c=b&&(i.getAttribute(b,"href")||i.getAttribute(b,"link"))||"#";return{id:i.getAttribute(a,"data-itemid"),text:this.getText(a),url:c,hasUrl:this.hasTOCItemLink(a),lastNode:!1}}},{key:"isTOCItem",value:function(a){return"LI"===i.nodeName(a)||i.getAttribute(a,y)}},{key:"_findFirstLink",value:function(a){var b={that:this},c=f.parentNode(a);return b.bookid=i.getAttribute(a,"data-itemid"),i.traverseNode(c,this._findLinkFn,null,null,b),b.linkNode}},{key:"_isParentTocItem",value:function(a){return this.bookNode!==a&&this.that.isTOCItem(a)}},{key:"_findLinkFn",value:function(a){var b=i.getAttribute(a,"data-itemid");return b===this.bookid&&(this.bookFound=!0),!this.bookFound||!this.that.hasTOCItemLink(a)||void 0!==this.linkNode||(this.linkNode=a,!1)}},{key:"nextLevel",value:function(a){var b=void 0;return b=g.parseInt(i.dataset(a,"itemlevel"),0),i.hasClass(a,c)?b:b+1}},{key:"onClick",value:function(a){var b=void 0,c=void 0,d=void 0,e=void 0;if(e=a.currentTarget,b=a.target,c=this.hasLink(b),d=this.getItemNode(b,e),this.isBookNode(d)&&(c&&this.selectedNode!==d&&this.isOpenBook(d)||(this.toggleBook(d,!1),this.updateBreadcrumbInfo(d))),!(!c||this.isUrlNode(d)&&this.hasExternalLink(b)))return this.selectLink(d,!1)}},{key:"selectLink",value:function(a,b,c){if(null==c&&(c=m),this.selectedNode&&i.removeClass(this.selectedNode,w),b&&this.selectedNode!==a&&g.delay(function(){return a.scrollIntoView(!1)},c),this.selectedNode=a,a)return this.updateBreadcrumbInfo(a),i.addClass(a,w)}},{key:"selectTocItem",value:function(a){var b=a.id+"_0";if(b){for(var c={},d=-1;b;)d++,c[b]=!0,b=b.substr(0,b.lastIndexOf("_"));this.widget.publish("show_child",c),this.widget.publish("curlevel",d),a.url&&rh.model.publish("EVT_TOC_LOADEDgototab",{tab:0,item:{url:a.url}})}}},{key:"getItemNode",value:function(a,b){return g.findParentNode(a,b,this.isTOCItem)}},{key:"getChildItemNode",value:function(a,b){return i.find(a,function(a){return"LI"===i.nodeName(a)||i.getAttribute(a,y)})}},{key:"hasTOCItemLink",value:function(a){var b=i.getAttribute(a,"data-haslink");return"true"===b}},{key:"hasLink",value:function(a){var b=void 0;return b=i.getAttribute(a,"href"),b&&"#"!==b}},{key:"isBookNode",value:function(a){return i.hasClass(a,"book")}},{key:"isTopicNode",value:function(a){return i.hasClass(a,"item")}},{key:"isUrlNode",value:function(a){return i.hasClass(a,"url")}},{key:"isPageNode",value:function(a){return this.isTopicNode(a)||this.isUrlNode(a)}},{key:"isOpenBook",value:function(b){return this.widget.get(l)?i.hasClass(b,a):i.hasClass(b,c)}},{key:"hasExternalLink",value:function(a){var b=void 0;return b=i.getAttribute(a,"href"),!(!b||g.isRelativeUrl(b))&&!g.isUrlAllowdInIframe(b)}},{key:"getBookNode",value:function(a,b){var c=void 0;return c=this.getItemNode(a,b),this.isBookNode(c)?c:null}},{key:"animateCollapse",value:function(a){return g.each([a,a.nextElementSibling],function(a){return i.addClass(a,b),g.delay(function(){return i.removeClass(a,b)},m)})}},{key:"animateExpand",value:function(a){return g.each([a,a.nextElementSibling],function(a){return i.addClass(a,o),g.delay(function(){return i.removeClass(a,o)},m)})}},{key:"toggleBook",value:function(a,b){return null==b&&(b=!0),this.isOpenBook(a)?this.closeBook(a):this.openBook(a,b)}},{key:"closeBook",value:function(a){var b=void 0,d=void 0;if(b=i.dataset(a,"itemid"),d=""+t+b,!1!==this.widget.get(d)&&this.widget.publish(d,!1),this.updateActiveBookInfo(this.nextLevel(a),this.pid(b)),this.updateBookInfo(),i.hasClass(a,c))return i.removeClass(a,c),this.animateCollapse(a)}},{key:"openBook",value:function(a,b,d){var e=void 0,f=void 0,g=void 0,h=void 0;return null==d&&(d=this.updateBookInfo),g=i.dataset(a,"itemkey"),f=i.dataset(a,"itemid"),e=i.dataset(a,"childorder"),h=""+t+f,!0!==this.widget.get(h)&&this.widget.publish(h,!0),this.updateActiveBookInfo(this.nextLevel(a),f),this.widget.get(g)?(i.hasClass(a,c)||(i.addClass(a,c),this.animateExpand(a)),d()):(i.addClass(a,v),b&&a.scrollIntoView(!1),this.loadToc(g,e,function(b){return function(){return i.removeClass(a,v),i.addClass(a,c),b.animateExpand(a),d()}}(this)))}},{key:"extractTempData",value:function(){var a=void 0;return a=this.widget.get(rh.consts("KEY_TEMP_DATA")),this.widget.publish(rh.consts("KEY_TEMP_DATA")),a}},{key:"loadToc",value:function(a,b,c){var d=void 0,e=void 0,f=void 0,h=void 0;return h=this.parseKey(a),d=h.absRef,e=h.key,f=d?d+"/":"",g.loadScript(f+"whxdata/"+e+".new.js",!0,function(e){return function(){var f=void 0;return f=e.extractTempData()||[],g.each(f,function(a){if(a.absRef=d,b)return a.childOrder=b}),e.loadRefToc(f,function(b){if(e.widget.publish(a,b),c)return c()})}}(this))}},{key:"loadRefToc",value:function(a,b){var c=void 0,d=void 0,e=void 0;if(null==a&&(a=[]),d=g.findIndex(a,function(a){if(a.ref)return!0}),d!==-1){e=a[d],c=e.absRef||"",c&&(c+="/"),c+=e.ref;var f=j.get(k("KEY_TOC_ORDER")),h=f[c].order;return g.loadScript(c+"/whxdata/toc.new.js",!0,function(e){return function(){var f=void 0;return f=e.extractTempData()||[],g.each(f,function(a){if(a.absRef=c,h)return a.childOrder=h}),Array.prototype.splice.apply(a,[d,1].concat(f)),e.loadRefToc(a,b)}}(this))}if(b)return b(a)}},{key:"getTOCData",value:function(){return j.subscribeOnce(k("KEY_PUBLISH_BASE_URL"),function(a){return function(){var b;try{return j.subscribe(k("KEY_PROJECT_LIST"),function(b){return j.subscribe(k("KEY_MASTER_PROJECT_LIST"),function(c){var d,e;return e=c.length,d=[],g.each(c,function(a){return a=g.makeRelativeUrl(a,b[0]),a&&(a+="/"),g.loadScript(a+"whxdata/toc.new.js",!0,function(b){return function(){var c;return c=b.extractTempData()||[],g.each(c,function(b){b.absRef=a}),b.loadRefToc(c,function(a){if(e--,d=d.concat(a),0===e)return b.widget.publish(u,d),b.widget.publish(k("EVT_TOC_LOADED"),!0),b.widget.subscribe(rh.consts("KEY_TOPIC_ID"),b.subscribeTopicID)})}}(this))},a)})})}catch(c){if(b=c,rh._debug)return rh._d("warn",b.message)}}}(this))}},{key:"nextChildOrder",value:function(a){var b=void 0;return b=a.split("@"),b[b.length-1]=1+g.parseInt(b[b.length-1],0),b.join("@")}},{key:"childOrder",value:function(a){return a?a+"@1":"@1"}},{key:"pid",value:function(a){var b=void 0;return b=a.split("_"),b.pop(),b.join("_")||"_"}},{key:"key",value:function(a,b){var c=void 0;return null==a&&(a=""),c=g.findIndex(this.projectAbsRef,function(b){return b===a}),c===-1&&(c=this.projectAbsRef.length,this.projectAbsRef.push(a)),".p.child_toc."+c+"."+b}},{key:"parseKey",value:function(a){var b=void 0,c=void 0,d=void 0;return a=a.substring(3),c=a.split("."),d=c.pop(),b=this.projectAbsRef[c.pop()]||"",{key:d,absRef:b}}},{key:"url",value:function B(a,b){var c=void 0,d=void 0,e=void 0,f=void 0,B=void 0;return a.url?"remoteitem"===a.type?encodeURI(a.url):(f=a.absRef?g.ensureSlash(a.absRef):"",B=""+f+a.url,c=g.extractHashString(B),c.length>0&&(c="#"+c,d=g.filePath(B),e=g.extractParamString(B),e.length>0&&(e+="&"),e="?"+e+"rhtocid="+b,B=""+d+e+c),encodeURI(B)):"#"}},{key:"tags",value:function(a){var b=void 0;return b=a.absRef?"+"+a.absRef:"",a["data-rhtags"]?a["data-rhtags"]+b:""}},{key:"subscribeTopicID",value:function(a){var b=this,c=void 0,d=void 0;null==a&&(a={}),d=g.hashParams().rhtocid,d?(c=this.getPathfromId(d),this.selectTocById(c,this.widget.node)):rh.model.subscribe(rh.consts("KEY_MASTER_PROJECT_LIST"),function(c){if(c&&c.length<2)return b.syncToc.sync(b,a)})}},{key:"subscribeBookId",value:function(a){var b=void 0,c=void 0;if(a)return c=this.getPathfromId(a),this.selectTocById(c,this.widget.node,null,b)}},{key:"getPathfromId",value:function(a){var b=void 0;return b=a.split("_"),b.shift(),b=g.map(b,function(a){return g.parseInt(a,0)})}},{key:"selectTocById",value:function(a,b,c,d){var e=void 0,f=void 0;if(null==c&&(c=1),b&&b.children&&(f=a.shift(),e=g.find(b.children,function(a){if(this.isBookNode(a)||this.isPageNode(a)){if(0===f)return!0;f--}return!1},this)))return 0===a.length&&this.selectLink(e,!0,c),this.isBookNode(e)?this.openBook(e,!0,function(b){return function(){return g.defer(function(){var c=void 0,d=void 0;return 0===a.length?b.updateBookInfo():(c=e.nextElementSibling,d=c.children&&c.children[0],b.selectTocById(a,d,m))})}}(this)):this.updateBookInfo()}}]),A}();return A.prototype["class"]=function(a){return"remoteitem"===a.type?"url":a.type},A}(),rh.controller("TocController",o)},{"../../src/lib/rh":8,"../../src/responsive_help/utils/node_utils":37}],6:[function(a,b,c){var rh=a("../../src/lib/rh"),d=rh._,f=(rh.$,rh.model),g=rh.consts,i=function(){function a(){var b=this;e(this,a),this.data={"":{order:"",nextChild:0}},f.subscribeOnce(g("KEY_PROJECT_LIST"),function(a){d.each(a,function(c){c=d.makeRelativeUrl(b.trimFirst(c,"."),a[0]),b.childOrder(c)}),f.publish(g("KEY_TOC_ORDER"),b.data)})}return h(a,[{key:"trimFirst",value:function(a,b){return a=a.length&&a[0]===b&&a[1]!==b?a.substring(1):a}},{key:"childOrder",value:function(a){if(a=this.trimFirst(a,"/"),!this.data[a]){var b=a;b=b.substring(0,b.lastIndexOf("/")),b=b.substring(0,b.lastIndexOf("/"));var c=this.data[b];c.nextChild++,this.data[a]={order:c.order+"@"+c.nextChild,nextChild:0}}return this.data[a].order}}]),a}();new i},{"../../src/lib/rh":8}],7:[function(c,d,f){var g=a,rh=g.rh,i=rh.model,j=rh._,k=rh.consts,l=rh.http,m=rh.rhs,n=function(){var a=void 0;return n=function(){function c(){e(this,c);var b=3e3;i.subscribeOnce(k("EVT_PROJECT_LOADED"),function(){return i.subscribeOnce(k("KEY_PUBLISH_MODE"),function(c){if(c){var d=d||a(),e=[],f=j.debounce(function(){return l.post(d,JSON.stringify(e)).error(function(a,b){if(rh._debug)return rh._d("error","Filter report status ",b)})},b,!1);return i.subscribe(k("KEY_TAG_EXPRESSION"),function(a){e=[];var b=rh.model.get(k("KEY_MERGED_FILTER_KEY")),c=!0,d=!1,g=void 0;try{for(var h,i=Array.from(a)[Symbol.iterator]();!(c=(h=i.next()).done);c=!0){var j=h.value,l=!0,m=!1,n=void 0;try{for(var o,p=Array.from(j.c)[Symbol.iterator]();!(l=(o=p.next()).done);l=!0){var q,r=o.value;(q=rh.filterObject.lookup(b,r,!1))&&e.push(q.display)}}catch(s){m=!0,n=s}finally{try{!l&&p["return"]&&p["return"]()}finally{if(m)throw n}}}}catch(s){d=!0,g=s}finally{try{!c&&i["return"]&&i["return"]()}finally{if(d)throw g}}if(e.length>0)return f()})}})})}return h(c,null,[{key:"initClass",value:function(){a=function(){var a=b.location.origin,c=i.get(k("KEY_PUBLISH_BASE_URL")).substr(a.length);if(c&&!j.isEmptyString(c)){var d=j.mapToEncodedString(j.extend(j.addPathNameKey({area:m.area(),prj:m.project(),type:m.type(),agt:"fltRpt",mgr:"agm"})));return c+"?"+d}}}}]),c}(),n.initClass(),n}();new n},{}],8:[function(b,c,d){(function(a){void 0===a.rh&&(a.rh={}),c.exports=a.rh}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof a?a:{})},{}],9:[function(a,b,c){a("../lib/rh"),a("./layout/ui/carousel"),a("./layout/home_controller"),a("../../lenient_src/layout/search_util"),a("./layout/search/search_controller"),a("./layout/favorites_controller"),a("./layout/toc_breadcrumbs_controller.js"),a("../../lenient_src/layout/toc_order"),a("../../lenient_src/layout/toc_controller"),a("../../lenient_src/layout/index_controller"),a("../../lenient_src/layout/glossary_controller"),a("../../lenient_src/layout/event_handlers"),a("./layout/rh2017layoutcontroller"),a("./layout/modal_dialog"),a("./layout/search_result_controller.js"),a("../../lenient_src/robohelp/layout/filter_handler")},{"../../lenient_src/layout/event_handlers":1,"../../lenient_src/layout/glossary_controller":2,"../../lenient_src/layout/index_controller":3,"../../lenient_src/layout/search_util":4,"../../lenient_src/layout/toc_controller":5,"../../lenient_src/layout/toc_order":6,"../../lenient_src/robohelp/layout/filter_handler":7,"../lib/rh":8,"./layout/favorites_controller":10,"./layout/home_controller":11,"./layout/modal_dialog":12,"./layout/rh2017layoutcontroller":13,"./layout/search/search_controller":30,"./layout/search_result_controller.js":34,"./layout/toc_breadcrumbs_controller.js":35,"./layout/ui/carousel":36}],10:[function(a,c,d){var rh=a("../../lib/rh"),f=rh.consts,g=function(){function a(b){var c=this;e(this,a),this.widget=b,this.favStorage=new rh.Storage,this._loadFromStorage=!1,this._favMemoryStore=void 0,rh.model.subscribeOnce(f("EVT_PROJECT_LOADED"),function(){c.init()})}return h(a,[{key:"_getUniqueId",value:function(){function a(a){var b=(Math.random().toString(16)+"000000000").substr(2,8);return a?"-"+b.substr(0,4)+"-"+b.substr(4,4):b}return a()+a(!0)+a(!0)+a()}},{key:"numberOfItems",value:function(a){return Object.keys(a).length}},{key:"_getFavHTMLElements",value:function(a){for(var c=b.getElementsByTagName("div"),d=[],e=0;e=a.pageWidth&&a.imageHeight<=a.pageHeight?{height:a.pageWidth/b,width:a.pageWidth}:a.imageWidth<=a.pageWidth&&a.imageHeight>=a.pageHeight?{height:a.pageHeight,width:a.pageHeight*b}:a.imageWidth>=a.pageWidth&&a.imageHeight>=a.pageHeight?this._calculateFullyExceedSize(a,b):void 0}},{key:"_calculateFullyExceedSize",value:function(a,b){var c=a.pageWidth/a.pageHeight;return b=0?e:0,f=f>=0?f:0;var g={imageWidth:c,imageHeight:d,pageWidth:e,pageHeight:f},h=this.calculateImageSize(g);c=h.width,d=h.height;var i=Math.max(5,(e-c)/2),j=Math.max(5,(f-d)/2);return{left:i,top:j,width:c,height:d,pageWidth:e,pageHeight:f}}},{key:"initialStyle",value:function(){return this.isImage?'style="display:none"':""}},{key:"ShowModal",value:function(a){this.isImage=a.isImage,this.createChildWidget(),this.widget.subscribe("close",this._close.bind(this)),this.widget.publish("content",a.content),j.defer(this.setOnImageLoad.bind(this))}},{key:"setImageSize",value:function(a,b){this.imageWidth>a&&i.css(this.img,"width",Math.round(a)+"px"),this.imageHeight>b&&i.css(this.img,"height",Math.round(b)+"px")}},{key:"_close",value:function(){this.widget.destruct(),this.widget=void 0,g.removeChild(this.node),this.node=void 0}},{key:"template",get:function(){var a=this.initialStyle();return'\n
\n
\n
\n
\n
\n
'}}]),c}();rh.model.csubscribe("SHOW_MODAL",function(a){var b=new k;b.ShowModal(a)})},{"../../lib/rh":8,"../utils/node_utils":37}],13:[function(a,c,f){var rh=a("../../lib/rh"),g=rh.$,i=rh._,j=rh.consts,k=function(){function a(b){e(this,a),this.widget=b,this.topicFrame=".topic-container iframe",this.initLayout(),this.initModal()}return h(a,[{key:"isLayoutMode",value:function(a){var b=a||i.hashParams(),c=b[rh.consts("HASH_KEY_TOPIC")];return b[rh.consts("HASH_KEY_UIMODE")]!==j("HELP_SEARCH_MODE")&&(!c||"true"===b[rh.consts("HASH_HOMEPAGE_MODE")]||b[rh.consts("HASH_KEY_RH_TOCID")])}},{key:"initLayout",value:function(){var a=this;rh.model.subscribe(j("EVT_HASH_CHANGE"),function(b){var c=b.newMap,e=b.oldMap;a.isLayoutMode()?a.widget.publish(rh.consts("KEY_VIEW_MODE"),rh.consts("HELP_LAYOUT_MODE")):"search"===c[rh.consts("HASH_KEY_UIMODE")]?(a.widget.publish(rh.consts("KEY_VIEW_MODE"),rh.consts("HELP_SEARCH_MODE")),i.queueUpdateHashMap(d({},j("HASH_HOMEPAGE_MODE"),!1),!1)):a.widget.publish(rh.consts("KEY_VIEW_MODE"),rh.consts("HELP_TOPIC_MODE"));var f=rh.model.get(rh.consts("KEY_FEATURE"));f&&f.showDefTopic===!1&&!c[rh.consts("HASH_KEY_RH_TOCID")]&&!e[rh.consts("HASH_KEY_TOPIC")]&&c[rh.consts("HASH_KEY_TOPIC")]?i.queueUpdateHashMap(d({},j("HASH_HOMEPAGE_MODE"),"false"),!1):e[rh.consts("HASH_KEY_TOPIC")]&&!c[rh.consts("HASH_KEY_RH_TOCID")]&&e[rh.consts("HASH_KEY_TOPIC")]!==c[rh.consts("HASH_KEY_TOPIC")]&&"true"===c[rh.consts("HASH_HOMEPAGE_MODE")]&&e[rh.consts("HASH_HOMEPAGE_MODE")]===c[rh.consts("HASH_HOMEPAGE_MODE")]&&i.queueUpdateHashMap(d({},j("HASH_HOMEPAGE_MODE"),"false"),!1)});var b=i.hashParams();this.isLayoutMode()&&"true"!==b[rh.consts("HASH_HOMEPAGE_MODE")]&&i.queueUpdateHashMap(d({},j("HASH_HOMEPAGE_MODE"),!0),!1),rh.model.subscribe("EVT_TOC_LOADEDgototab",function(b){b.key&&rh.model.subscribe(b.key,function(a,c,d){d(),b.item&&b.item.url&&!a[0].added&&(a.unshift({type:"item",url:b.item.url,name:b.item.name,added:!0}),rh.model.publish(b.key,a))}),b.item.url&&a.viewTopicInLayoutMode(b.item.url)})}},{key:"viewTopicInLayoutMode",value:function(a){var b=d({homepage:"true"},rh.consts("HASH_KEY_RH_TOCID"),!0);a&&"#"!==a&&(b.t=a),i.queueUpdateHashMap(b,!1)}},{key:"initModal",value:function(){var a=!1;b.addEventListener("keydown",function(a){27===a.keyCode&&rh._.each(g.find(".modal"),function(a){g.addClass(a,"rh-hide")})},!1),b.addEventListener("click",function(){a||rh._.each(g.find(".modal"),function(a){g.addClass(a,"rh-hide")}),a=!1}),rh._.each(g.find(".modal-content"),function(b){i.addEventListener(b,"click",function(){a=!0})})}}]),a}();rh.controller("RH2017LayoutController",k)},{"../../lib/rh":8}],14:[function(a,b,c){var d={minPreviousThreshold:.2,previousnGram:1,max_predictions:5,PREDICTOR_SOURCE_ID:{HISTORY_PREDICTOR:0,NGRAM_PREDICTOR:1,GENERAL_PREDICTOR:2,CORRECTOR:3}};b.exports=d},{}],15:[function(a,b,c){var d=a("./indices"),rh=a("../../../lib/rh"),f=rh._,g=a("./prediction"),i=a("./consts"),j=a("./utils"),k=a("./prediction_list"),l=function(){function a(b,c){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20;e(this,a),this._loader=b,this.predictions=[],this.max_predictions=d,this._callback=c}return h(a,[{key:"getCorrections",value:function(a){this._parsed_input=a,this.predictions=[],this._computePredictions();var b=this._loader.getHashes(this._parsed_input._partial);if(b)for(var c=b.length,d=0;d=0&&this._callback&&this._callback()}},{key:"wait",value:function(a){var b=a||1;this._count-=b}}]),a}();b.exports=d},{}],17:[function(a,b,c){var d=a("./prediction_list"),f=a("./prediction_creator"),g=a("./consts"),i=a("./indices"),rh=a("../../../lib/rh"),j=rh._,k=a("./merger"),l=function(){function a(b,c){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20;e(this,a),this._max_predictions=d,this._loader=c,this.total_count=this._loader.getTotalCount(),this._callback=b,this._source=g.PREDICTOR_SOURCE_ID.GENERAL_PREDICTOR,this.prediction_merger=new k([],5*this.total_count)}return h(a,[{key:"clear",value:function(){this.prediction_merger.clear(),this.parsed_input=void 0}},{key:"getPredictions",value:function(a){this._init(a),this._computePredictions(),this._onResultComputed()}},{key:"_computePredictions",value:function(){var a=this._getWordHashes();a&&this._addPredictions(a)}},{key:"_isWholeWordInput",value:function(){return this.parsed_input.isWholeWord}},{key:"_getWordHashes",value:function(){return this.parsed_input.isWholeWord?this._loader.top_words:this._loader.getHashes(this.parsed_input._partial)}},{key:"_init",value:function(a){this.prediction_merger=new k([],5*this.total_count),this.parsed_input=a}},{key:"_onResultComputed",value:function(){this._callback&&this._callback(new d(this.predictions,this.parsed_input),this._loader)}},{key:"_addPredictions",value:function(a){if(a)for(var b=a.length,c=0;ca.length)return!1;var b=new g(a,(!0));return this._parsed_input.compare(b)}}]),a}();b.exports=k},{"../../../lib/rh":8,"./consts":14,"./input_parser":21,"./prediction":26,"./prediction_list":28}],19:[function(a,b,c){var rh=a("../../../lib/rh"),d=rh._,f=a("./utils"),g=function(){function a(){e(this,a)}return h(a,[{key:"initHistory",value:function(a){void 0===this._list&&(this._list=a||[]); }},{key:"getHistory",value:function(){return this._list||[]}},{key:"_updateText",value:function(a,b){this.getHistory().splice(b,1),this.getHistory().unshift(a)}},{key:"_addNewText",value:function(a){this.getHistory().push(a)}},{key:"add",value:function(a){var b=d.findIndex(this.getHistory(),function(b){return 0===f.compareNoCase(a.text,b.text)});b>=0?this._updateText(a,b):this._addNewText(a)}},{key:"delete",value:function(a){var b=d.findIndex(this.getHistory(),function(b){return 0===f.compareNoCase(a,b.text)});b>=0&&this.getHistory().splice(b)}}]),a}();b.exports=new g},{"../../../lib/rh":8,"./utils":33}],20:[function(a,b,c){var d={MAP:{WORD:0,HASH:1,COUNT:2,MODEL_FILE_NO:3,MODEL_INDEX:4,TOPICS:5},MODEL:{WORD_HASH:0,COUNT:1,NEXT_MODEL:2},FIRST_PREDICTION:{NEXT:0,PREVIOUS:1}};b.exports=d},{}],21:[function(a,b,c){var d=a("./utils"),rh=a("../../../../src/lib/rh"),f=rh._,g=function(){function a(b,c,d,f){e(this,a),this.isPrevious=f,this.selection=void 0===d?b.length:d;var g=this._calculateSeparator(b);this.isPrevious||(this.isWholeWord=c||this._isWholeWord(b,g)),this.initText(b,g)}return h(a,[{key:"initText",value:function(a,b){this._computeText(a,b),this.trimmedText=this.original_text.trim(),this.words=f.compact(this.trimmedText.split(" ")||[]),this._reverseIfPrevious(),!this.isWholeWord&&this.words.length>0&&(this._partial=this.words.splice(-1)[0])}},{key:"_computeText",value:function(a,b){this._right_text="",this._left_text="",void 0===b&&(b=a.length),this.isSplitText=!(0===b||b===a.length);var c=a.substring(0,b),d=a.substring(b);this.isPrevious?(this.original_text=d,this._left_text=c.trim()):(this.original_text=c,this._right_text=d.trim())}},{key:"equalRemaingWord",value:function(a){if(""!==this._left_text||""!==this._right_text){var b=this._getRemainigWord();if(b)return 0===d.compareNoCase(b,a)}return!1}},{key:"_getRemainigWord",value:function(){var a=this.isPrevious?this._left_text.split(" "):this._right_text.split(" ");if(a=a||[],a=f.compact(a),a.length>0)return this.isPrevious?a[a.length-1]:a[0]}},{key:"completeSuggestion",value:function(a){return this.isPrevious?0===this._left_text.length?a:this._left_text+" "+a:0===this._right_text.length?a:a+" "+this._right_text}},{key:"_calculateSeparator",value:function(a){if(this.isPrevious){if(0===this.selection)return this.isWholeWord=!0,0;if(a.length>this.selection&&" "!==a[this.selection-1]){var b=a.lastIndexOf(" ",this.selection-1);return this.isWholeWord=!1,b>=0?b+1:0}this.isWholeWord=!0}return this.selection}},{key:"_reverseIfPrevious",value:function(){this.isPrevious&&this.words.reverse()}},{key:"_isWholeWord",value:function(a,b){return this.isPrevious?0===b||a.length>b&&" "===a[b-1]:b>0&&" "===a[b-1]}},{key:"compare",value:function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(c=void 0===c?this.words.length-1:c,this.words.length>a.words.length)return!1;for(var e=b;e<=c;e++){var f=this.words[e],g=a.words[e];if(0!==d.compareNoCase(f,g))return!1}return this.matchPartial(a,e)}},{key:"matchPartial",value:function(a,b){if(void 0===this._partial)return!0;if(a.words.length<=b)return!1;var c=a.words[b];return this.comparePartial(c)}},{key:"comparePartial",value:function(a){return this._matchExp=new RegExp("^"+this._partial,"i"),this._matchExp.test(a)}},{key:"completeWord",value:function(a){return this.isWholeWord||void 0===this._partial||0===this._partial.length?this.getTermForCompleteWord(a,this.trimmedText):this.getTermForPartialText(a)}},{key:"getTermForPartialText",value:function(a){var b=a.substring(this._partial.length,a.length);if(this.isPrevious){var c="",d=this.trimmedText.indexOf(" ");return d>=0&&(c=this.trimmedText.substring(d)),this._partial+b+c}return this.trimmedText+b}},{key:"getTermForCompleteWord",value:function(a){return this.isPrevious?a+" "+this.trimmedText:this.trimmedText+" "+a}},{key:"replaceLastWord",value:function(a){var b=this.trimmedText;if(void 0!==this._partial&&!this.isWholeWord){var c=this.trimmedText.length-this._partial.length;b=this.trimmedText.substring(0,c),b=b.trim()}return b+" "+a}},{key:"equalLastWord",value:function(a){if(0===this.words.length)return!1;var b=this.words[this.words.length-1];return 0===d.compareNoCase(b,a)}}]),a}();b.exports=g},{"../../../../src/lib/rh":8,"./utils":33}],22:[function(a,b,c){var rh=a("../../../lib/rh"),d=rh._,f=rh.model,g=a("./utils"),i=a("./indices"),j=a("./consts"),k=a("./paths"),l=function(){function a(){var b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e(this,a),this._paths=new k(b)}return h(a,[{key:"init",value:function(a){this.loadIndex(a),this.loadMap(a)}},{key:"_isIndexLoaded",value:function(){return void 0!==this.index_data}},{key:"getModelCount",value:function(){return this.index_data.Model.length}},{key:"getMapHash",value:function(a){return this._hash_to_word[a]}},{key:"getHashes",value:function(a){if(void 0!==a&&a.length>0)return this.getAplhabetHashes(a[0])}},{key:"getAplhabetHashes",value:function(a){if(this.map_data&&1===a.length){var b=a.toLowerCase();return this.map_data[b]}}},{key:"getWordModel",value:function(a,b){var c=void 0,d=this._getHashForWord(a);return d&&b&&(c=b[d[i.MAP.MODEL_INDEX]]),c}},{key:"getCount",value:function(a){var b=this._getHashForWord(a);if(b)return b[i.MAP.COUNT]}},{key:"getModelData",value:function(a){var b=a[i.MAP.MODEL_FILE_NO],c=a[i.MAP.MODEL_INDEX],d=f.get(this._paths.getModelKey(b));return d||this.loadModel(b),d&&d[c]}},{key:"_compareWordCount",value:function(a,b){var c=g.getSafeElement(a,i.MAP.COUNT),d=g.getSafeElement(b,i.MAP.COUNT);return c&&d?d-c:0}},{key:"_buildTopWords",value:function(a){a.sort(this._compareWordCount),a.splice(100*j.max_predictions),this._top_words=a}},{key:"getModelFileNo",value:function(a){var b=this._getHashForWord(a);if(b)return b[i.MAP.MODEL_FILE_NO]}},{key:"_getHashForWord",value:function(a){var b=void 0,c=this.getHashKey(a);return c&&(b=this._hash_to_word[c]),b}},{key:"getHashKey",value:function(a){if(a&&a.length>0){var b=a.toLowerCase();return this._word_hash[b]}}},{key:"loadIndex",value:function(a){var b=this;this._isIndexLoaded()===!1?d.loadScript(this._paths.getIndexFilePath(),!0,function(){b.index_data=d.exports(),b.onIndexLoaded(a)},!0):this.onIndexLoaded(a)}},{key:"loadModel",value:function(a,b){var c=[];if(void 0!==a){var e=this._paths.getModelKey(a),g=f.get(e);if(void 0===g){f.publish(e,null);var h=this._paths.getModelFilePath(a);d.loadScript(h,!0,this.getOnModelLoadFn(a,b),!0)}else null===g&&void 0!==b?f.subscribe(e,b):this.doCallback(b,g,a)}else this.doCallback(b,c,a)}},{key:"doCallback",value:function(a,b,c){a&&a(b,c)}},{key:"getOnModelLoadFn",value:function(a,b){var c=this;return function(){var e=d.exports();f.publish(c._paths.getModelKey(a),e),b&&b(e,a)}}},{key:"onMapLoaded",value:function(a){this.parseMap(),this.index_data&&a&&a(this)}},{key:"onIndexLoaded",value:function(a){this.map_data&&a&&a(this)}},{key:"parseMap",value:function(){var a=this.map_data;this._word_hash={},this._hash_to_word={};var b=[];for(var c in a){var d=a[c];this._parseWordsData(d),b=b.concat(d)}this._buildTopWords(b)}},{key:"_parseWordsData",value:function(a){var b=this;d.each(a,function(a){var c=parseInt(a[i.MAP.HASH]);if(a[i.MAP.WORD]){var d=a[i.MAP.WORD].toString();b._word_hash[d]=c}b._hash_to_word[c]=a})}},{key:"isStopWord",value:function(a){var b=d.find(this.index_data.stopWords,function(b){return 0===g.compareNoCase(a,b)});return void 0!==b}},{key:"getTotalCount",value:function(){return this.index_data.totalCount}},{key:"wordHashfromIndexKey",value:function(a,b){return d.find(this._hash_to_word,function(c){return c[i.MAP.MODEL_INDEX]===a&&c[i.MAP.MODEL_FILE_NO]===b})}},{key:"loadMap",value:function(a){var b=this;void 0===this.map_data?d.loadScript(this._paths.getMapFilePath(),!0,function(){b.map_data=d.exports(),b.onMapLoaded(a)},!0):this.onMapLoaded(a)}},{key:"top_words",get:function(){return this._top_words}},{key:"nGram",get:function(){return this.index_data.nGram}},{key:"search_model",get:function(){return this.index_data.Model}},{key:"search_map",get:function(){return this.index_data.Map}},{key:"total_count",get:function(){return this.index_data.totalCount}},{key:"stop_words",get:function(){return this.index_data.stopWords}}]),a}();b.exports=l},{"../../../lib/rh":8,"./consts":14,"./indices":20,"./paths":25,"./utils":33}],23:[function(a,b,c){var rh=a("../../../lib/rh"),d=rh._,f=a("./utils"),g=function(){function a(b){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;e(this,a),this._predictions=b,this._max_predictions=c}return h(a,[{key:"merge",value:function(a){var b=this;d.each(a,function(a){b.mergePrediction(a)}),this._sort(),this._purge()}},{key:"clear",value:function(){this._predictions=[]}},{key:"_purge",value:function(){this._predictions.length>this._max_predictions&&this._predictions.splice(this._max_predictions)}},{key:"mergePrediction",value:function(a){var b=this.find_prediction(a.term);b?this.merge_item(b,a):this._predictions.push(a)}},{key:"_sort",value:function(){this.predictions.sort(this.compare_predictions)}},{key:"compare_predictions",value:function(a,b){return b.probability-a.probability}},{key:"find_prediction",value:function(a){return d.find(this._predictions,function(b){return 0===f.compareNoCase(b.term,a)})}},{key:"merge_item",value:function(a,b){a.probability+=b.probability,a.count=Math.max(a.count,b.count)}},{key:"predictions",get:function(){return this._predictions}}]),a}();b.exports=g},{"../../../lib/rh":8,"./utils":33}],24:[function(a,b,c){var rh=a("../../../lib/rh"),d=rh._,f=a("./prediction_creator"),g=a("./prediction_list"),i=a("./consts"),j=a("./indices"),k=function(){function a(b){var c=b.loader,d=b.level,f=b.callback,g=b.previous,h=b.max_predictions,j=void 0===h?20:h;e(this,a),this.level=d,this.previous=g,this._max_predictions=j,this.predictions=[],this._callback=f,this._loader=c,this._source=i.PREDICTOR_SOURCE_ID.NGRAM_PREDICTOR}return h(a,[{key:"init",value:function(){}},{key:"clear",value:function(){this._word_model=void 0,this._prediction_array=void 0,this.parsed_input=void 0,this.predictions=[]}},{key:"getPredictions",value:function(a){this.parsed_input=a,this.predictions=[],void 0!==a&&a.words.length>=this.level?(this.word_index=a.words.length-this.level,this._word=a.words[this.word_index],this._loadInputModel(this._word,this._compute_word_predictions.bind(this))):this._onResultsComputed()}},{key:"_compute_word_predictions",value:function(a){this.predictions=[];var b=this.level,c=this._word,d=this._loader.getCount(c);this._word_model=this._loader.getWordModel(c,a),this._word_model&&(this._prediction_array=this._get_prediction_array(),this._compute_prediction_from_model(c,b,d)),this._onResultsComputed()}},{key:"_onResultsComputed",value:function(){this._callback&&this._callback(new g(this.predictions,this.parsed_input),this._loader)}},{key:"_compute_prediction_from_model",value:function(a,b,c){if(void 0!==this._prediction_array)if(this._is_my_level(b))this._compute_next_words(c);else{b--;var d=this._get_word_index(b),e=this.parsed_input.words[d],f=this._loader.getHashKey(e),g=this._get_next_model(this._prediction_array,f);g&&(c=g[j.MODEL.COUNT],this._prediction_array=g[j.MODEL.NEXT_MODEL],this._compute_prediction_from_model(e,b,c))}}},{key:"_get_next_model",value:function(a,b){if(b){var c=d.find(a,function(a){return a.length>1&&a[j.MODEL.WORD_HASH]===b});return c&&c.length>j.MODEL.NEXT_MODEL&&Array.isArray(c)?c:void 0}}},{key:"_get_word_index",value:function(a){return this.parsed_input.words.length-a}},{key:"_is_my_level",value:function(a){return 1===a}},{key:"_continueFn",value:function(){return!0}},{key:"_compute_next_words",value:function(a){var b=this._prediction_array;if(b&&b.length>0)for(var c=0;this.predictions.length1;c++)if(this._matches_partially(b[c])){var d=this._create_predictions(b[c],a);this._compute_next_multi_words(d)}}},{key:"_compute_next_multi_words",value:function(a){var b=this;d.each(a,function(a){void 0!==a&&b.predictions.push(a)})}},{key:"_get_word_hash",value:function(a){return this._loader.getMapHash(a[j.MODEL.WORD_HASH])}},{key:"_matches_partially",value:function(a){if(this.parsed_input.isWholeWord)return!0;var b=this._loader.getMapHash(a[j.MODEL.WORD_HASH]);if(!b)return!1;var c=b[j.MAP.WORD];return this.parsed_input.comparePartial(c)}},{key:"_create_predictions",value:function(a,b){var c=new f({loader:this._loader,model_item:a,total_count:b,parsed_input:this.parsed_input,continueFn:this._continueFn});return c.getMultiPredictions(void 0,void 0,void 0,this._source)}},{key:"_get_prediction_array",value:function(){return this.parsed_input.isPrevious&&this._word_model.length>1?this._word_model[1]:this._word_model[0]}},{key:"_loadInputModel",value:function(a,b){var c=this._findFileIndex(a);this._loader.loadModel(c,b)}},{key:"_findFileIndex",value:function(a){return this._loader.getModelFileNo(a)}},{key:"max_predictions",set:function(a){this.max_predictions=a},get:function(){return this._max_predictions}}]),a}();b.exports=k},{"../../../lib/rh":8,"./consts":14,"./indices":20,"./prediction_creator":27,"./prediction_list":28}],25:[function(a,b,c){var rh=a("../../../lib/rh"),d=rh.consts,f=function(){function a(b){e(this,a),this._path=b||"",this.initPath()}return h(a,[{key:"initPath",value:function(){"."===this._path&&(this._path=""),"."===this._path[0]&&"/"===this._path[1]&&(this._path=this._path.slice(2))}},{key:"_getModelFileName",value:function(a){return d("SEARCH_MODEL_ADDR")+a.toString()+".js"}},{key:"getModelFilePath",value:function(a){var b=this._getModelFileName(a);return this._getRelativePath(b)}},{key:"_getRelativePath",value:function(a){var b=""===this._path?a:this._path+"/"+a;return b}},{key:"_getPathKey",value:function(){return""===this._path?"":"_"+this._path+"_"}},{key:"getModelKey",value:function(a){return d("SEARCH_MODEL_KEY")+this._getPathKey()+a.toString()}},{key:"_getMapFileName",value:function(){return d("SEARCH_MAP_ADDR")}},{key:"getMapFilePath",value:function(){var a=this._getMapFileName();return this._getRelativePath(a)}},{key:"getIndexFilePath",value:function(){var a=d("SEARCH_INDEX_FILE");return this._getRelativePath(a)}}]),a}();b.exports=f},{"../../../lib/rh":8}],26:[function(a,b,c){var d=function f(a,b,c,d){e(this,f),this.probability=b,this.term=a,this.count=c,this.source=d};b.exports=d},{}],27:[function(a,b,c){var d=a("./prediction"),f=a("./utils"),g=a("./indices"),i=a("./input_parser"),j=a("./consts"),k=function(){function a(b){var c=b.loader,d=b.model_item,f=b.total_count,g=b.parsed_input,h=b.continueFn;e(this,a),this._model_item=d,this.parsed_input=g||new i(""),this._init(),this._total_count=f,this._continueFn=h||this._isStopWord,this._nextModelFn=this._nextModel,this._predictions=[],this._multi_prediction=!1,this._loader=c}return h(a,[{key:"_init",value:function(){this.term="",this.probability=1,this._first_word=!0,this.isFirstLevel=!1,this._level=0}},{key:"getPrediction",value:function(a,b,c,d){return this.word_hash=a,this.isFirstLevel=b,this.previous=c,this.source=d,this.isFirstLevel&&this._appendPreviousPredictions(this._model_item),this._appendPrediction(this._model_item,a),this._createPrediction()}},{key:"getMultiPredictions",value:function(a,b,c,d){return this._multi_prediction=!0,this.word_hash=a,this.isFirstLevel=b,this.previous=c,this.source=d,this.isFirstLevel&&this._appendPreviousPredictions(this._model_item),this._appendPrediction(this._model_item,a),this._predictions}},{key:"equalRemaingWord",value:function(a){var b=this._getword(a,this.word_hash);return!(!b||!this.parsed_input.equalRemaingWord(b))}},{key:"_appendPreviousPredictions",value:function(a){var b=this._getPreviousItem(a);if(b){var c=this._getPreviousProbability(b);c>j.minPreviousThreshold&&this._appendPreviousTerm(b)}}},{key:"_getPreviousItem",value:function(a){var b=f.getFirstLevelNextModel(a,!0);if(b){var c=f.getSafeElement(b,0);return c}}},{key:"_appendPreviousTerm",value:function(a){var b=this._getword(a);if(b){if(this.parsed_input.equalLastWord(b))return;this.term=this.parsed_input.replaceLastWord(b),this._first_word=!1}}},{key:"_createPrediction",value:function(){if(""!==this.term){var a=this.parsed_input.completeSuggestion(this.term);return new d(a,this.probability,1,this.source)}}},{key:"_appendPrediction",value:function(a){if(this.probability=this.probability*this._calculateProbability(a),this._update_term(a),this._shouldCreatePrediction(a)&&this._predictions.push(this._createPrediction()),this._continueFn(a)){var b=this._nextModel(a);this._total_count=this._getCount(a),this._level++,this._first_word=!1,this.isFirstLevel=!1,this.word_hash=void 0,b&&this._appendPrediction(b)}}},{key:"_getPreviousProbability",value:function(a){var b=this._getCount(this.model_item),c=f.getCountfromModel(a);return c/b}},{key:"_update_term",value:function(a){this.parsed_input.isPrevious?this.term=this._nextTerm(a)+this.term:this.term=this.term+this._nextTerm(a)}},{key:"_getword",value:function(a,b){return b=b||this._get_word_hash(a),f.getSafeElement(b,g.MAP.WORD)}},{key:"_get_word_hash",value:function(a){return this._loader.getMapHash(a[g.MODEL.WORD_HASH])}},{key:"_nextModel",value:function(a){var b=void 0;if(b=this.isFirstLevel?f.getFirstLevelNextModel(a,this.previous):f.getNextModel(a),b&&b.length>0)return f.getFirstPrediction(b)}},{key:"_nextTerm",value:function(a){var b=this._getword(a,this.word_hash);return b?this._first_word?this.parsed_input.completeWord(b):" "+b:""}},{key:"_calculateProbability",value:function(a){var b=this._getCount(a);return b/this._total_count}},{key:"_getCount",value:function(a){return this.word_hash?f.getCountfromWordHash(this.word_hash):f.getCountfromModel(a)}},{key:"_shouldCreatePrediction",value:function(a){return this._multi_prediction&&!this._isStopWord(a)&&!this.equalRemaingWord(a)}},{key:"_isStopWord",value:function(a){var b=this._getword(a,this.word_hash);return!!b&&this._loader.isStopWord(b)}}]),a}();b.exports=k},{"./consts":14,"./indices":20,"./input_parser":21,"./prediction":26,"./utils":33}],28:[function(a,b,c){var d=function(){function a(b,c){e(this,a),this.parsed_input=c,this._list=b||[]}return h(a,[{key:"isForInput",value:function(a,b){return this.parsed_input.isPrevious?void 0!==b&&this.parsed_input.original_text===b.original_text:this.parsed_input.original_text===a.original_text}},{key:"isEmpty",value:function(){return 0===this._list.length}},{key:"predictions",get:function(){return this._list}}]),a}();b.exports=d},{}],29:[function(a,b,c){var d=a("./loader"),rh=a("../../../lib/rh"),f=rh._,g=a("./history_predictor"),i=a("./ngram_predictor"),j=a("./general_predictor"),k=a("./corrector"),l=a("./consts"),m=function(){function a(b,c){e(this,a),this._history_reader=b,this._processResultFn=c}return h(a,[{key:"_getProjectPaths",value:function(){return rh.model.get(rh.consts("KEY_PROJECT_LIST"))}},{key:"_createLoaders",value:function(){var a=[],b=this._getProjectPaths();return f.each(b,function(b){a.push(new d(b))}),a}},{key:"createPredictors",value:function(a,b,c){var d=this;this._addFn=a,this._prevaddFn=b,this._addCorrectorFn=c;var e=new g(this._history_reader,this._processResultFn);this._addFn(e);var h=this._createLoaders();f.each(h,function(a){a.init(d.addPredictors.bind(d))})}},{key:"addPredictors",value:function(a){for(var b=1;b<=a.nGram;b++){var c=new i({loader:a,level:b,callback:this._processResultFn});c.init(),this._addFn(c)}for(var d=1;d<=l.previousnGram;d++){var e=new i({loader:a,level:d,callback:this._processResultFn,previous:!0});e.init(),this._prevaddFn(e)}var f=new j(this._processResultFn,a);this._addFn(f);var g=new k(a,this._processResultFn);this._addCorrectorFn(g)}}]),a}();b.exports=m},{"../../../lib/rh":8,"./consts":14,"./corrector":15,"./general_predictor":17,"./history_predictor":18,"./loader":22,"./ngram_predictor":24}],30:[function(a,b,c){var rh=a("../../../lib/rh"),d=rh._,f=rh.consts,g=a("./history_reader"),i=a("./input_parser"),j=a("./merger"),k=a("./topic_counter"),l=a("./utils"),m=a("./consts"),n=a("./counting_seamaphore"),o=a("./predictors_creator"),p=5,q=function(){function a(b){var c=this;e(this,a),this.widget=b,this._predictors=[],this._correctors=[],this._previous_predictors=[],this.initHandleKeyHash(),this.max_predictions=p,this.predicton_merger=new j([]),b.model.subscribe(f("KEY_PROJECT_LIST"),function(){c.init()})}return h(a,[{key:"init",value:function(){var a=rh.storage.fetch(f("PREV_SEARCH_KEY"));g.initHistory(a),this.create_predictors(),this.widget.model.csubscribe("EVT_CLOSE_SEARCH_SUGGESTION",this.closeSuggestions.bind(this))}},{key:"create_predictors",value:function(){this._predictors=[];var a=new o(g,this.processResult.bind(this));a.createPredictors(this.addPredictor.bind(this),this.addPrevPredictor.bind(this),this.addCorrector.bind(this))}},{key:"addPredictor",value:function(a){this._predictors.push(a)}},{key:"addPrevPredictor",value:function(a){this._previous_predictors.push(a)}},{key:"addCorrector",value:function(a){this._correctors.push(a)}},{key:"showSuggestions",value:function(a){this._initSuggestions(a),this._calculateSugguestions()}},{key:"_initSuggestions",value:function(a){this._initResult(),this._initInputs(a),this._resutSeamaphore=new n(this.onResultComplete.bind(this))}},{key:"_initInputs",value:function(a){this.parsed_input=new i(a.text,(!1),a.selStart,(!1)),l.isPrevious(a)&&(this._previous_input=new i(a.text,(!1),a.selStart,(!0)))}},{key:"_calculateSugguestions",value:function(){var a=this;this._resutSeamaphore.wait(this._predictorCount()),d.each(this._predictors,function(b){b.getPredictions(a.parsed_input)}),this._previous_input&&d.each(this._previous_predictors,function(b){b.getPredictions(a._previous_input)})}},{key:"_clearPredictors",value:function(){d.each(this._predictors,function(a){a.clear()}),d.each(this._previous_predictors,function(a){a.clear()}),d.each(this._correctors,function(a){a.clear()})}},{key:"_predictorCount",value:function(){var a=this._predictors.length;return this._previous_input&&(a+=this._previous_predictors.length),a}},{key:"_initResult",value:function(){this.predicton_merger&&this.predicton_merger.clear(),this.widget.publish("selected",void 0),this._previous_input=void 0,this._computing_correction=!1}},{key:"_clearResult",value:function(){this._resetMovement(),this._previous_input=void 0,this.parsed_input=void 0,this._resutSeamaphore=void 0,this._clearPredictors()}},{key:"isSuggestionsOpen",value:function(){var a=this.widget.get(f("SEARCH_RESULTS_KEY"));return a&&a.length>0}},{key:"processResult",value:function(a,b){if(a.isForInput(this.parsed_input,this._previous_input)){if(!a.isEmpty()){this.predicton_merger.merge(a.predictions);var c=new k(b);this.predictions=c.computeCounts(this.predictions,this.parsed_input)}this._resutSeamaphore.signal()}}},{key:"onResultComplete",value:function(){this.needCorrection()?this.doCorrection():(this.predictions.splice(this.max_predictions),this.widget.publish(f("SEARCH_RESULTS_KEY"),this.predictions),this._clearResult())}},{key:"needCorrection",value:function(){return!this._computing_correction&&0===this.predictions.length&&""!==this.parsed_input.trimmedText}},{key:"doCorrection",value:function(){var a=this;this._computing_correction=!0,this._resutSeamaphore=new n(this.onResultComplete.bind(this)),this._resutSeamaphore.wait(this._correctors.length),d.each(this._correctors,function(b){b.getCorrections(a.parsed_input)})}},{key:"canDelete",value:function(a){var b=this.predictions[a];return void 0!==b&&b.source===m.PREDICTOR_SOURCE_ID.HISTORY_PREDICTOR}},{key:"handleDelete",value:function(a){var b=this.predictions[a];this._deleteFromHistory(b.term),this._removePrediction(a),this.widget.publish("history_deleted",!0)}},{key:"_removePrediction",value:function(a){this.predictions.splice(a,1),this.widget.publish(f("SEARCH_RESULTS_KEY"),this.predictions)}},{key:"handleClick",value:function(a){var b=this.widget.get("history_deleted");if(!b){var c=this.predictions[a];if(void 0!==c){var d=c.term;this._addToHistory(d),this.widget.publish(f("KEY_SEARCH_TERM"),d),this.widget.publish(rh.consts("EVT_SEARCH_TERM"),!0)}}}},{key:"handleFocusOut",value:function(a,b){var c=this.widget.get("history_deleted");c?(this.widget.publish("history_deleted",!1),this.widget.publish(b,!0)):this.widget.publish(a,!1)}},{key:"getFirstSuggestionIndex",value:function(a,b){return b?0:a-1}},{key:"getNextSuggestionIndex",value:function(a,b,c){var d=c?1:b-1;return a=void 0===a?0:a,a=(a+d)%b}},{key:"handleArrowKey",value:function(a){var b=this.widget.get("selected"),c=40===a.keyCode,d=this.getPredictionsLength();if(d>0){b=void 0===b?this.getFirstSuggestionIndex(d,c):this.getNextSuggestionIndex(b,d,c),this.widget.publish("selected",b);var e=this.getNewInputText(this.results[b]);this.widget.publish(f("KEY_SEARCH_TERM"),e)}}},{key:"getNewInputText",value:function(a){return a.term}},{key:"getPredictionsLength",value:function(){var a=void 0;return this.results=this.widget.get(f("SEARCH_RESULTS_KEY")),this.results&&(a=this.results.length),a}},{key:"closeSuggestions",value:function(){this._clearResult(),this.widget.publish("selected",void 0),this.original_parsed_input=void 0,this.widget.publish(f("SEARCH_RESULTS_KEY"),[])}},{key:"_deleteFromHistory",value:function(a){g["delete"](a),this._saveHistory()}},{key:"_addToHistory",value:function(a){a&&""!==a&&(g.add({text:a.trim(),count:10}),this._saveHistory())}},{key:"_saveHistory",value:function(){rh.storage.persist(f("PREV_SEARCH_KEY"),g.getHistory())}},{key:"handleShowSuggestion",value:function(a){""===a.text||l.shouldShowSuggestion(a)===!1?this.closeSuggestions():this.showSuggestions(a)}},{key:"handleReturn",value:function(a){""!==a.text&&(this._addToHistory(a.text),this.closeSuggestions())}},{key:"_isMovementKey",value:function(a){return[38,39,40].indexOf(a)>=0}},{key:"_resetMovement",value:function(){this.original_parsed_input=void 0,this.widget.publish("selected",void 0)}},{key:"_isHandlingCursorMove",value:function(){var a=this.widget.get("selected");return void 0!==a}},{key:"initHandleKeyHash",value:function(){this.handle_key_hash={up:this.handleArrowKey.bind(this),down:this.handleArrowKey.bind(this),backspace:this.handleBackSpace.bind(this),"return":this.handleReturn.bind(this),"default":this.handleShowSuggestion.bind(this),escape:this.handleEscape.bind(this),right:this.handleRight.bind(this)}}},{key:"handleRight",value:function(a){return this._isHandlingCursorMove()?(l.shouldAppendSpace(a)&&(a.text+=" ",a.selStart+=1,this.widget.publish(f("KEY_SEARCH_TERM"),a.text)),this._resetMovement(),this.handleShowSuggestion(a),!1):(this._resetMovement(),this.handleShowSuggestion(a))}},{key:"handleBackSpace",value:function(a){return this.handleShowSuggestion(a)}},{key:"handleEscape",value:function(){this.closeSuggestions()}},{key:"handleKey",value:function(a){var b=a.keyCode,c={keyCode:b,selStart:a.target.selectionStart,text:a.target.value};this._isMovementKey(b)||this._resetMovement();var e=d.getKeyIndex(b);if(void 0===e)return!0;var f=this.handle_key_hash[e];return f?f(c):void 0}},{key:"predictions",get:function(){return this.predicton_merger.predictions},set:function(a){this.predicton_merger=new j(a)}}]),a}();rh.controller("SearchController",q)},{"../../../lib/rh":8,"./consts":14,"./counting_seamaphore":16,"./history_reader":19,"./input_parser":21,"./merger":23,"./predictors_creator":29,"./topic_counter":32,"./utils":33}],31:[function(a,b,c){var d=function(){function a(b){e(this,a),this._set=b||[],this._initialised=!1}return h(a,[{key:"intersect",value:function(a){Array.isArray(a)||(a=a.set);for(var b=[],c=0,d=0,e=0;da[e]?e++:(b[c++]=this._set[d],d++,e++);this._set=b}},{key:"intersectOrSet",value:function(a){this._initialised?this.intersect(a):(Array.isArray(a)||(a=a.set),this.set=a,this._initialised=!0)}},{key:"intersectCount",value:function(a){Array.isArray(a)||(a=a.set);for(var b=0,c=0,d=0;ca[d]?d++:(b++,c++,d++);return b}},{key:"set",set:function(a){this._set=a||[]},get:function(){return this._set}},{key:"length",get:function(){return this._set.length}}]),a}();b.exports=d},{}],32:[function(a,b,c){var d=a("./sorted_set"),f=a("./input_parser"),g=a("./prediction"),rh=a("../../../lib/rh"),i=rh._,j=a("./indices"),k=function(){function a(b){e(this,a),this.newPredictions=[],this.predictionSet=new d,this.inputSet=new d,this._loader=b}return h(a,[{key:"computeCounts",value:function(a,b){var c=this;return this.newPrediction=[],this.parsed_input=b,i.each(a,function(a){c.addUpdatedPrediction(a)}),this.newPredictions}},{key:"addUpdatedPrediction",value:function(a){var b=1;if(void 0!==this._loader&&(this.createPredictionSet(a),b=this.computeTopicCount()),b>0){var c=new g(a.term,a.probability,b,a.source);this.newPredictions.push(c)}}},{key:"computeTopicCount",value:function(){return this.predictionSet.set.length}},{key:"createPredictionSet",value:function(a){var b=this;this.predictionSet=new d;var c=new f(a.term,(!0));i.each(c.words,function(a,c){b._addWordToSet(a,b.predictionSet,c)})}},{key:"initInput",value:function(a){var b=this;this.inputSet=new d,i.each(a.words,function(a){b._addWordToSet(a,b.inputSet)})}},{key:"_addWordToSet",value:function(a,b){if(!this._loader.isStopWord(a)){var c=this._loader._getHashForWord(a);c&&c.length>j.MAP.TOPICS&&b.intersectOrSet(c[j.MAP.TOPICS])}}}]),a}();b.exports=k},{"../../../lib/rh":8,"./indices":20,"./input_parser":21,"./prediction":26,"./sorted_set":31}],33:[function(b,c,d){(function(a){var d=b("./indices"),e={getNextModel:function(a){if(a&&Array.isArray(a)&&a.length>d.MODEL.NEXT_MODEL)return a[d.MODEL.NEXT_MODEL]},getFirstLevelNextModel:function(a,b){if(a&&Array.isArray(a)){if(!b&&a.length>d.FIRST_PREDICTION.NEXT)return a[d.FIRST_PREDICTION.NEXT];if(b&&a.length>d.FIRST_PREDICTION.PREVIOUS)return a[d.FIRST_PREDICTION.PREVIOUS]}},getFirstPrediction:function(a){if(a&&Array.isArray(a)&&a.length>0&&Array.isArray(a[0]))return a[0]},compareNoCase:function(b,c){return void 0!==a.compare?a.compare(b,c):b===c?0:-1},hammingDistance:function f(a,b){for(var c=Math.min(a.length,b.length),f=0,d=0;dc&&(f+=a.length-c),f},isPrevious:function(a){return a.selStart0&&(" "===b[c]||" "===b[c-1])},shouldAppendSpace:function(a){var b=a.text,c=a.selStart;return b.length>0&&c===b.length&&" "!==b[b.length-1]},getSafeElement:function(a,b){if(a&&Array.isArray(a)&&a.length>b)return a[b]},getCountfromModel:function(a){return Array.isArray(a)&&a.length>d.MODEL.COUNT?a[d.MODEL.COUNT]:0},getCountfromWordHash:function(a){return Array.isArray(a)&&a.length>d.MAP.COUNT?a[d.MAP.COUNT]:0}};c.exports=e}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof a?a:{})},{"./indices":20}],34:[function(a,b,c){var rh=a("../../lib/rh"),d=rh._,f=rh.consts,g=function(){function a(b){e(this,a),this.widget=b}return h(a,[{key:"getLink",value:function(a){var b=a,c=this.widget.get(f("KEY_SEARCH_RESULT_PARAMS")),e=this.widget.get(f("KEY_SEARCH_TERM")),g="";if(e&&""!==e){var h=f("HASH_KEY_RH_SEARCH"),i={};i[h]=e,g=d.mapToEncodedString(i)}return void 0!==c&&""!==c?b=b+c+"&"+g:""!==g&&(b=b+"?"+g),b}}]),a}();rh.controller("SearchResultController",g)},{"../../lib/rh":8}],35:[function(a,b,c){var rh=a("../../lib/rh"),d=rh._,f=rh.consts,g=function(){function a(b){e(this,a),this.widget=b}return h(a,[{key:"select",value:function(a,b){this.widget.publish(f("KEY_TOC_SELECT_ITEM"),{id:a,url:b})}},{key:"getLink",value:function(a){if(a){var b=this.widget.get(f("KEY_TOC_BREADCRUMBS")),c=b[a];if(c&&c.hasUrl)return c.url}}},{key:"goToHome",value:function(a){if(a){var b=this.widget.get(f("KEY_TOC_BREADCRUMBS")),c=b[a];c&&!c.hasUrl&&d.goToHome({rhtocid:c.id})}}}]),a}();rh.controller("TocBreadcrumbsController",g)},{"../../lib/rh":8}],36:[function(a,b,c){var rh=a("../../../lib/rh"),d=rh.$,f="change",g=".carousel-item:not(.hide):not(.rh-hide)",i=function(){ function a(b,c){var d=this;e(this,a),this.widget=b,this.node=this.widget.node,this.tab=0,rh.model.subscribeOnce(rh.consts(c.key),function(){d.widget.publish(f,!0)}),rh.model.subscribe(rh.consts("KEY_SCREEN"),function(){d["goto"](d.tab,0)}),rh.model.subscribe(c.key+"gototab",function(a){d["goto"](d.pagecount(),a.tab)})}return h(a,[{key:"goto",value:function(a,b){var c=this;this.tab=b,this.carouselnode=d.find(this.node,".carousel")[0],this.animateLeft(a),rh._.delay(function(){c.widget.publish(f,!0)},1e3)}},{key:"hasNext",value:function(){this.carouselnode=d.find(this.node,".carousel")[0];var a=d.find(d.find(this.node,".carousel")[0],g);return a=a&&a.length>0?a[a.length-1]:null,a.offsetLeft+this.carouselnode.offsetLeft>this.carouselnode.offsetWidth}},{key:"animateLeft",value:function(){var a="calc(-"+14*this.tab+"px - "+100*this.tab+"%)";d.css(this.carouselnode,"left",a)}},{key:"next",value:function(){this["goto"](this.tab,this.tab+1)}},{key:"pagecount",value:function(){return this.tab}},{key:"previous",value:function(){this["goto"](this.tab,this.tab-1)}},{key:"ensureVisible",value:function(){}}]),a}();rh.controller("Carousel",i)},{"../../../lib/rh":8}],37:[function(a,b,c){var rh=a("../../lib/rh"),d=rh.$;b.exports={nodeType:{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12},removeChild:function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.parentNode(a);return b&&b.removeChild&&b.removeChild(a)},appendChild:function(a,b){return a&&a.appendChild&&a.appendChild(b)},parentNode:function(a){return a&&a.parentNode},childNodes:function(a){return a&&a.childNodes||[]},toHtmlNode:function(a){return this.childNodes(d.createElement("div",a))},outerHTML:function(a){return a&&a.outerHTML||""},insertAfter:function(a,b){return a.parentNode.insertBefore(b,a.nextSibling)},value:function(a){return a&&a.nodeValue},name:function(a){return a&&a.nodeName},type:function(a){return a&&a.nodeType},isElementNode:function(a){return this.type(a)===this.nodeType.ELEMENT_NODE},isTextNode:function(a){return this.type(a)===this.nodeType.TEXT_NODE}}},{"../../lib/rh":8}]},{},[9])}(window,document,window.location);