!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("pitApp",["require","exports","angularAnimate","angular"],e)}(function(e,t){function n(t,n,r){var i=!1,s=this,a={stack:{},ready:{bootstrap:!1},on:function(e,t){this.ready[e]?t():(this.stack[e]||(this.stack[e]=[]),this.stack[e].push(t))},trigger:function(e){if(this.stack[e])for(var t in this.stack[e]){var n=this.stack[e][t];try{n()}catch(e){}}this.ready[e]||(this.ready[e]=!0)}};this.eventBind=function(e,t){a.on(e,t)},this.eventTrigger=function(e){a.trigger(e)};var l={};this.data=function(e,t){return t?("delete"==t?delete l[e]:l[e]=t,s):!!l[e]&&l[e]};var c={},u={};this.registerScope=function(e,t,n){if(c[e]={scope:t,args:n||[]},u[e])for(var r in u[e])u[e][r]&&o.isFunction(u[e][r])&&(u[e][r].apply(c[e].scope,c[e].args),u[e][r].prototype.once&&delete u[e][r])},this.whenScope=function(e,t,n){u[e]||(u[e]=[]),n&&(t.prototype.once=!0),u[e].indexOf(t)<0&&u[e].push(t)},this.forScope=function(e,t){if(c[e])try{c[e].scope.$applyAsync(function(){t.apply(c[e].scope,c[e].args)})}catch(t){console.log("$scope "+e+" not available, action ignored."),console.log(t)}else console.log("$scope "+e+" not available, action ignored.")},this.offScope=function(e,t){t?u[e]&&u[e].indexOf(t)>-1&&u[e].splice(u[e].indexOf(t),1):u[e]&&delete u[e]},this.scopeApply=function(e,t){t||(t=function(){}),e.$applyAsync(function(){t.call(e)})},this.moduleLoad=null,this.pageInjector=null,this.register=null,this.bootstrap=null,this.angular=o.module(t,n.concat(["ngAnimate"])),this.angular.factory("$locationParams",function(){var e,t;return{params:{get from_url(){return e},get to_url(){return t}},setParams:function(n,o){e=o,t=n}}}).run(["$rootScope","$templateCache","$q","$http","$injector",function(t,n,r,i,a){s.moduleLoad=function(t,r){r=r||{};var i={js:r.js||"js/modules/"+t,html:void 0!==r.html?r.html:"views/modules/"+t,css:void 0!==r.css?r.css:"css/modules/"+t,success:r.success||o.noop,failed:r.failed||o.noop,skiptemplatecache:r.skiptemplatecache||!1},s={css:!1,html:!1,js:!1,ctrl:null},a=t+".mode",l=function(e){o.extend(s,e),s.js&&s.css&&s.html&&(i.html?c(i.skiptemplatecache?a:n.get(a)?a:null,s.ctrl,i.skiptemplatecache?e.htmltpl:null):c(s.ctrl))},c=i.success||o.noop,u=i.failed||o.noop,d=function(){var t=i.html;t.indexOf(".html")!==t.length-".html".length&&(t+=".html");var o=requirejs.s.contexts._.config;(o.map["*"]&&o.map["*"][i.html]||o.paths[i.html])&&!e.specified("text!"+t)&&(t=i.html),e(["text!"+t],function(e){i.skiptemplatecache||n.put(a,e),l({html:!0,htmltpl:i.skiptemplatecache?e:null})},function(e){l({html:!0}),console.error(e)})};e([i.js],function(e){l({js:!0,ctrl:e||null}),n.get(a)&&!i.skiptemplatecache||!i.html?l({html:!0}):d()},function(e){console.error(e),u(e.xhr)}),i.css?e(["css!"+i.css],function(e){l({css:!0})},function(e){l({css:!0})}):l({css:!0})},s.pageInjector=a}]).config(["$controllerProvider","$compileProvider","$filterProvider","$animateProvider","$provide",function(e,t,n,o,r){s.register={controller:function(t,n){var o=n;return e.register(t,o),s},directive:function(e,n){return t.directive(e,n),s},filter:function(e,t){return n.register(e,t),s},factory:function(e,t){return r.factory(e,t),s},service:function(e,t){return r.service(e,t),s},constant:function(e,t){return r.constant(e,t),s},value:function(e,t){return r.value(e,t),s},animation:function(e,t){return o.register(e,t),s},provider:function(e,t){return r.provider(e,t),s}}}]).config(["$animateProvider",function(e){e.classNameFilter(/ng-animate-enabled/)}]),s.bootstrap=function(){i||(o.bootstrap(document,[t]),a.trigger("bootstrap"),i=!0)},r||i||s.bootstrap()}var o=e("angular");return n});var q=window.location.search,v;"?"==q.charAt(0)&&(q=q.substring(1)),v=q.match(/(?:^|&)v=([^&]+)/),v=null==v?"0":v[1],v="13",define("stApp",["require","pitApp","ith-cc-tplModel-v"+v,"page","cookie-helper","jquery","jquery.vclick","angular","angularJqEv","angularExtras","angularInView","angularMustache","angularAdView","angularSanitize","pitLS"],function(e,t,n){var o=e("angular"),r=new t("searchTools",["hmTouchEvents","ngAnimate","extra","angular-inview","ngMustache","ngAdView","ngSanitize"],!0),i=e("jquery"),s=e("cookie-helper"),a=e("page"),l=e("pitLS");r.angular.directive("removeClass",function(){return{restrict:"A",link:function(e,t,n){t.removeClass(n.removeClass)}}}),r.angular.factory("$stService",["$injector",function(e){function t(e){f.forEach(function(t){t(e)})}function n(e){return f.push(e),function(){var t=f.indexOf(e);f.splice(t,1)}}function o(e){h.forEach(function(t){t(e)})}function r(e){return h.push(e),function(){var t=h.indexOf(e);h.splice(t,1)}}function i(e,t){v?m.forEach(function(n){n(e,t)}):g.push({name:e,value:t})}function c(e){return m.push(e),function(){var t=m.indexOf(e);m.splice(t,1)}}function u(){v=!0,g.forEach(function(e){i(e.name,e.value)}),g=[]}function d(e){b.forEach(function(t){t(e)})}function p(e){return b.push(e),function(){var t=b.indexOf(e);b.splice(t,1)}}var f=[],h=[],m=[],v=!1,g=[],b=[],w=l.group();l.group("mw");var _=s.is_logged_in()&&l.get("has-sess")&&l.get("full"),y={standing:null,score:null};_&&(l.get("vs")&&(y.score=l.get("vs")),l.get("crd")&&(y.standing=l.get("crd")),l.get("logout_group_id")&&(y.group=l.get("logout_group_id"))),l.group(w),"Thinfile"==y.standing?y={standing:null,score:null,thinfile:!0}:["Invalid","FileSuppressed","InvalidVendorRequest","Thinfile","OutOfRange","Deceased"].indexOf(y.standing)>-1&&(y={standing:null,score:null,invalid:!0});var q="filters"in a&&null!=a.filters&&"mc"in a.filters&&null!=a.filters.mc,C=null,x=null;return _&&null!=y.standing&&null!=y.score&&(C=y.standing,x=y.score),"ao_mc_override"in a&&(C=a.ao_mc_override,x=4),{setIntro:t,onIntroChange:n,setControllerReady:o,onControllerLoaded:r,setFilter:i,onFiltersSet:c,ccFiltersReady:u,showCreditPopup:d,onCreditPopup:p,get loggedInData(){return y},get isSessionActive(){return _},get hasCreditFilter(){return q},get myStanding(){return C},get myScore(){return x}}}]),r.angular.directive("ngStFilter",function(){return{restrict:"A",template:function(e){var t=document.createElement("div"),n=e[0].querySelector("[data-model]");if(e.attr("tabindex",0),n){var o=document.createElement("input"),r=n.innerHTML;t.innerHTML=r;for(var i=0,s=n.attributes.length;i<s;i++){var a=n.attributes[i];0==a.name.indexOf("data-")&&("data-type"==a.name?(o.setAttribute("type",a.value),e.attr("role",a.value)):o.setAttribute(a.name,a.value))}t.insertBefore(o,t.childNodes[0]),e.removeClass("checked")}else t.innerHTML=e[0].innerHTML;return t.innerHTML},link:function(e,t){var n=t[0].querySelector('input[type="radio"],input[type="checkbox"]');if(n){n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),t.attr("aria-checked",n.checked.toString()),t.attr("aria-label",t.prop("innerText")),t.children().attr("tabindex","-1"),t.children().attr("aria-hidden","true");var o=!1;e.$watch(function(){o||(o=!0,e.$$postDigest(function(){o=!1,t.attr("aria-checked",n.checked.toString())}))})}}}}),r.angular.directive("ngRepeatDone",["$timeout",function(e){return{restrict:"A",link:function(t){!0===t.$last&&e(function(){t.$emit("repeat-done")})}}}]),r.angular.factory("$url",["$rootScope",function(e){var t=!1;return{filters:{},uri:null,previous:null,entry:"system",ignoreChange:function(){t=!0;var n=e.$on("$locationChangeSuccess",function(){t=!1,n()})},isIgnored:function(){return t}}}]),r.angular.factory("csrfTokenInterceptor",["$q","$injector",function(e,t){var n=s.get_csrf_token()||s.read("XSRF-TOKEN"),o=s.get_whid();return{request:function(r){if("POST"!=r.method)return r;if(n)return r.headers["X-XSRF-TOKEN"]=n,s.enabled()||(r.headers["X-XSRF-WHID"]=o),r;var i=e.defer();return t.invoke(["$http",function(e){e.get("/sid.php?a=1&cb="+(new Date).getTime()+"&from="+encodeURI(window.location.href),{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(function(e){e.data&&("XSRF-TOKEN"in e.data&&(n=r.headers["X-XSRF-TOKEN"]=e.data["XSRF-TOKEN"]),"__whid"in e.data&&(o=r.headers["X-XSRF-WHID"]=e.data.__whid),r.headers["X-XSRF-RETRY"]="1"),i.resolve(r)},function(e){i.reject(e)})}]),i.promise}}}]),r.angular.config(["$httpProvider",function(e){e.defaults.transformRequest=function(e){return void 0===e?e:i.param(e)},e.interceptors.push("csrfTokenInterceptor"),e.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8"}]).config(["$locationProvider","$viewport","$anchorScrollProvider",function(e,t,n){e.html5Mode({enabled:!0}).hashPrefix("!"),t.setBody(o.element().cssSelect("body")),n.disableAutoScrolling()}]).run(["$rootScope","$location","$url","$templateCache","$httpParamSerializer",function(e,t,r,i,s){i.put("cc-template-model",n),e.$on("$locationChangeSuccess",function(){r.filters={};var n,i=t.search();if("q"in i)for(i=i.q.split(/;/g),n=0;n<i.length;n++)i[n]=i[n].split(":"),r.filters[i[n][0]]=i[n][1].split(/,/g);if(r.uri=t.path().replace(/(^\/|\/$)/g,""),window.location.hash.length>2?r.expert=window.location.hash.substring(1).replace(/(^\/|\/$)/g,""):r.expert=null,o.element().cssSelect('.experts-answers .content-part .content[data-slug="'+r.expert+'"]').length<1&&(r.expert=null),!r.isIgnored()){var a="?"+s(t.search());"?"==a&&(a=""),e.$broadcast("$url:changed",r.previous,r.uri+a),r.previous=r.uri+a}}),e.app_loaded=!0,e.isWeb=!0,e.show_ask_overlay=!1}]),r.angular.directive("lazyController",["$controller",function(e){return{restrict:"A",scope:!0,link:function(t,n,o){var r=t.$watch(o.lazyController,function(i){i&&(n.attr("ng-controller",i),n.data("$Controller",e(i,{$scope:t,$element:n,$attrs:o})),r())})}}}]),r.angular.controller("SearchToolController",["$scope","$injector",function(e,t){var n=t.get("$stService");e.IntroController=null,e.CommunitySearchController=null,e.CommunitySearchAskFormController=null,e.cardCompareBarController=null,e.cardCompareController=null,e.SearchToolCardsController=null,n.onControllerLoaded(function(t){e.$applyAsync(function(){"IntroController"==t?e.IntroController="IntroController":"CommunitySearchController"==t?e.CommunitySearchController="CommunitySearchController":"CommunitySearchAskFormController"==t?e.CommunitySearchAskFormController="CommunitySearchAskFormController":"SearchToolCardsController"==t?e.SearchToolCardsController="SearchToolCardsController":"cardCompareBarController"==t?e.cardCompareBarController="cardCompareBarController":"cardCompareController"==t&&(e.cardCompareController="cardCompareController")})}),e.has_no_credit_filter=!1,e.close_credit_popup=function(){e.has_no_credit_filter=!1,o.element().cssSelect("body").removeClass("popup-credit")},e.select_credit=function(t){n.setFilter("mc",t),e.close_credit_popup()};var r=0;o.element(window).on("scroll",function(){r<5&&(r+=1),e.has_no_credit_filter&&r>1&&e.close_credit_popup()}),n.onCreditPopup(function(t){e.$applyAsync(function(){t&&r<=1&&(e.has_no_credit_filter=!0,o.element().cssSelect("body").addClass("popup-credit"),setTimeout(function(){var e=document.querySelector(".cp-heading");e&&e.focus()},200))})}),e.init_page_title=e.pagetitle=d,e.init_page_headline=e.pageheadline=u,e.init_page_intro=p,"filtername"in a&&""!=(a.filtername+"").trim()&&(e.filtername=a.filtername);var i=document.querySelector("[data-header-footer]");i&&!i.innerHTML.length&&(i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true")),n.onIntroChange(function(t){e.$applyAsync(function(){t.title&&(e.pagetitle=t.title),t.headline&&(e.pageheadline=t.headline),t.filtername&&(e.filtername=t.filtername)})});var s=0===window.location.hash.indexOf("#expert="),l=n.loggedInData.thinfile||n.hasCreditFilter||n.myStanding;!s&&!l&&document.scrollingElement.scrollTop<=500&&n.showCreditPopup(!0)}]);var c=document.querySelector("main >#content");c&&c.setAttribute("data-ng-controller","SearchToolController");var u=o.element().cssSelect(".page-header-pr").text(),d=o.element().cssSelect(".page-header-top h1").text(),p=o.element().cssSelect("[data-ng-html-content=pageintro]").text();return o.element().cssSelect("#custom-searchtools-page").length>0&&(d=o.element().cssSelect(".header-container .left h1").text()),r}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("intersect-observer",["require","exports","jquery"],e)}(function(e,t){function n(e){return Array.isArray?Array.isArray(e):e&&"[object Array]"===Object.prototype.toString.call(e)}function o(e,t){if(!n(e))throw new TypeError("forEach called on a non-array type value. The given value is "+typeof e);for(var o,r=e.length,i=r-1;i>=0&&("boolean"!=typeof(o=t.call(e,e[i],i,e))||o);i--);}function r(e){return void 0===e||null===e||void 0===e}function i(e,t){void 0===e&&(e=.5),void 0===t&&(t=250),this._intersectionObserver=null,this.threshold=e,this.scrollwait=t,this._viewport=null,this._obsEl=[],this._intersected=[],this._scrolltimer=null,this._GetViewportSize(),this._OnScroll=this._OnScroll.bind(this),this._OnResize=this._OnResize.bind(this);var n=!1;try{var o=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("test",o,o),window.removeEventListener("test",o,o)}catch(e){n=!1}window.addEventListener("scroll",this._OnScroll,!!n&&{passive:!0}),window.addEventListener("resize",this._OnResize)}return i.prototype._OnScroll=function(){var e=this;clearTimeout(e._scrolltimer),e._scrolltimer=setTimeout(function(){e._intersectionObserver?(o(e._intersected,function(t){var n;o(e._obsEl,function(e,o){if(e.el==t)return n=o,!1});var r=e._obsEl[n];r&&(r.handler(),e._obsEl.splice(n,1),e._intersectionObserver.unobserve(t))}),e._intersected=[]):e.CheckInView()},e.scrollwait)},i.prototype._OnResize=function(){var e=this;requestAnimationFrame(function(){e._GetViewportSize(),e._intersectionObserver||e.CheckInView()})},i.prototype.Destroy=function(){this._intersected=null,this._obsEl=null,this._obs=null,window.removeEventListener("scroll",this._OnScroll),window.removeEventListener("resize",this._OnResize)},i.prototype.Observe=function(e,t){var n=this,r=-1;o(this._obsEl,function(t,n){if(t.el==e)return r=n,!1}),r<0?(this._obsEl.push({el:e,handler:t}),r=this._obsEl.length-1):this._obsEl[r].handler=t,requestAnimationFrame(function(){n._InViewport(e)?(n._obsEl.splice(r,1),n._intersectionObserver&&n._intersectionObserver.unobserve(e),t()):n._intersectionObserver&&(n._intersectionObserver.unobserve(e),n._intersectionObserver.observe(e))})},i.prototype.Unobserve=function(e){var t;o(this._obsEl,function(n,o){if(n.el==e)return t=o,!1}),t>-1&&(this._obsEl.splice(t,1),this._intersectionObserver&&this._intersectionObserver.unobserve(e))},i.prototype._GetViewportSize=function(){var e=window;null!=e.innerWidth&&(this._viewport={w:e.innerWidth,h:e.innerHeight})},i.prototype._InViewport=function(e){if(!this._viewport)return!1;var t=e instanceof Element?e.getBoundingClientRect():e.boundingClientRect,n=t.height||t.bottom-t.top,o=t.width||t.right-t.left;return!(!n||!o)&&!(t.top+t.height*this.threshold>this._viewport.h||t.bottom<0)},i.prototype.CheckForIntersection=function(e){this._intersected=[];for(var t=0,n=e.length;t<n;t++){var o=e[t],i=e[t].target;(o.isIntersecting||r(o.isIntersecting)&&this._InViewport(o))&&this._intersected.push(i)}},i.prototype.CheckInView=function(){var e=this,t=[];this._obsEl&&o(this._obsEl,function(n,o){e._InViewport(n.el)?n.handler():t.push(n)}),this._obsEl=t},i.prototype.PixelObserve=function(t,n,o){e(["cookie-helper","jquery"],function(r){var i=e("jquery"),s=i.fn.Uniqid(),a=i.fn.Uniqid();this.Observe(t,function(){i.get("/pixel.png",Object.assign({adview_id:s,adview_offer_type:n,adview_page:window.location.pathname},o))}),i(t).on("click",function(){if("Personal_Loan_PQ_Button"==n){var e=JSON.stringify({view:s,click:a,type:n,adview_page:window.location.pathname});try{window.sessionStorage.setItem("mw_prequal_start",e)}catch(t){r.create("mw_prequal_start",e,0)}}i.get("/pixel.png",Object.assign({adview_id:s,adview_offer_type:n,adview_page:window.location.pathname,adview_click:a},o))})})},i}),define("stQna",["require","exports","stApp","angular","cookie-helper","wh.jsencrypt","intersect-observer"],function(e,t){function n(){return null!=c.match(/iPhone|iPad|iPod/i)||u&&null!=u.match(/iPhone|iPad|iPod/i)}var o=e("stApp"),r=e("angular"),i=e("cookie-helper"),s=e("wh.jsencrypt"),a=e("intersect-observer"),l=r.element,c=navigator.userAgent,u=navigator.platform?navigator.platform:"";o.register.factory("$question-resolver",function(){var e;return{set:function(t){e=t},clear:function(){e=null},get:function(){return e}}}),o.register.controller("CommunitySearchController",["$rootScope","$scope","$element","$timeout","$question-resolver","$http","$q","$window","$location",function(t,o,s,c,u,d,p,f,h){function m(e){function t(e){var t="<span class='ellipsis' aria-hidden='true' tabindex='-1'>&hellip;</span><br><span data-hm-tap='morelink($event);' class='more-link' tabindex='0' role='button'>show more <i class='af-icon-down-open' ng-aria-hidden></i></span>";return r.isArray(e.content)&&2==e.content.length?"<div class='condensed'>"+e.content[0].replace("[[:hellip:]]",t)+"</div><div class='hidden'>"+e.content[1]+"</div><span data-hm-tap='lesslink($event);' class='less-link' tabindex='0' role='button'>show less <i class='af-icon-up-open' ng-aria-hidden></i></span>":e.content.replace("[[:hellip:]]",t)}r.forEach(e,function(e){var n=e.ques_content,o=document.createElement("div");o.innerHTML=n,e.ques_content_label=o.innerText,r.forEach(e.answers||[],function(e){r.isArray(e.content)&&2==e.content.length&&"[[:hellip:]]"==e.content[0]?e.content_parsed=e.content[1]||"":e.content_parsed=t(e)})})}function v(e){var t={action:"Answers.CommunitySearch",query:e};"/credit-cards/compare/"==document.location.pathname?t.category="credit-cards":t.uri=document.location.pathname,d({url:"/ajax.php",params:t,timeout:_.promise}).then(function(e){if(""!=o.comsearch){o.comresults=e.data,o.comresults_loading=!1,m(o.comresults||[]);var t=(o.comresults||[]).length;o.qna_result_label="Questions results. "+(t||"No ")+"Result"+(1!=t?"s":""),setTimeout(function(){l(s).find(".questions .question .main-q .more-info").each(function(){var e=l(this);e.prop("scrollHeight")<=e.prop("offsetHeight")+(e.find("span.match").length>0?2:0)&&e.next(".more-info-more").remove()})},100)}})}o.comsearch_q_link=function(e){return"/answers/"+e.ques_slug+"-"+e.id.replace(/^q/,"")+"/"},o.morelink=function(e){l(e.target).closest(".answer-content").addClass("more")},o.lesslink=function(e){l(e.target).closest(".answer-content").removeClass("more")},o.open_sort=function(e){l(e.target).next(".popup-list").addClass("show")},o.comresults_loading=!1,o.sort_ans_opts=[["Most Popular","mp"],["Most Upvotes","mv"]],o.ans_sort="mp",o.$watch("ans_sort",function(e,t){e!=t&&d({url:"/ajax.php",params:{action:"Answers.CommunityQASort",uri:document.location.pathname,sort_by:e}}).then(function(e){var t=e.data,n=l(s),o=n.find(".questions");o.html(t.html),o.find(".answer-user-avatar[data-src]").each(function(){var e=l(this);e.attr("src",e.attr("data-src")),e.removeAttr("data-src"),e.addClass("answer-user-avatar-load"),e.css({display:"block"})}),n.data("qp",1),1==t.pages?l(s).find(".ftrbtns .viewmore").remove():0==l(s).find(".ftrbtns .viewmore").length&&l("<span class='btn blank grey no-decoration viewmore'><span class='txt'>View More Questions</span><span class='af-icon-spin6 animate-spin'></span></span>").prependTo(l(s).find(".ftrbtns")),setTimeout(function(){l(s).find(".questions .question .answers .message.more-content .answer-content").each(function(){var e=l(this);e.prop("scrollHeight")<=e.prop("clientHeight")&&e.closest(".message").removeClass("more-content")}),l(s).find(".questions .question .main-q .more-info").each(function(){var e=l(this);e.prop("scrollHeight")<=e.prop("offsetHeight")+(e.find("span.match").length>0?2:0)&&e.next(".more-info-more").remove()})},150)})}),o.showUserGeneratedDisc=!1,o.showMoreDisc=function(e,t){o.showUserGeneratedDisc="more"==t},o.isShowIntroQA=!1,o.showIntroQA=function(e,t){"more"==t?(o.isShowIntroQA=!0,c(function(){o.isShowIntroQA=!0})):o.isShowIntroQA=!1},o.autoExpand=function(e){var t="object"==typeof e?e.target:document.getElementById(e),n=t.offsetHeight-t.clientHeight;t.style.height="auto",t.style.height=t.scrollHeight+n+"px"},o.live_status="",l(s).on("click",".questions .question .main-q .more-info-more span[class$=-link]",function(){l(this).closest(".main-q").toggleClass("more")}).on("click",".questions .question .main-q .reply",function(){function t(t){var o=c[0];c.show().trigger("focus").hide();var r=c.data("ckeditor-instance");r?r.setValue(t||""):e(["input-ckeditor"],function(e){var r=e(o,{},t,!0);r.ready(function(e){e?c.data("ckeditor-instance",r):(o.show().focus(),n.attr("aria-expanded","true"))})})}var n=l(this),o=n.closest(".question"),s=o.data("id"),a=o.find(".replyform"),c=a.find(".editor-content"),u=i.read("mw_signon")||"{}",p=i.is_logged_in();u.length>2&&"{"==u.charAt(0)&&"}"==u.charAt(u.length-1)&&(u=r.fromJson(u),r.isObject(u)&&"pp"in u&&a.find(".avatar img").attr("src",u.pp)),o.addClass("show-reply"),s&&0===s.indexOf("q")&&(s=s.substring(1)),p?(a.addClass("disabled"),c.attr("disabled","disabled"),d({url:"/ajax.php",params:{action:"Answers.QuestionHasAnswered",qid:s}}).then(function(e){a.removeClass("disabled"),c.removeAttr("disabled");var n=e.data;"answer"in n?t(n.answer):t()},function(e){if(401==e.status)return void(top.location.href="/join/light?lg&redirect_to="+encodeURIComponent(document.location.href));o.removeClass("disabled"),c.removeAttr("disabled"),t()})):t()}).on("click",".questions .question .replyform .hide-reply",function(){l(this).closest(".question").removeClass("show-reply");var e=l(this).closest(".question").find(".main-q .reply");e.attr("aria-expanded","false"),e.trigger("focus")}).on("click",".questions .question .replyform .submit",function(){var e=l(this).closest(".question"),t=e.find(".replyform"),n=t.find(".editor-content"),r=n.data("ckeditor-instance")&&n.data("ckeditor-instance").value||n.val();if(!t.hasClass("disabled")){if(r.length<30)return window.alert("Please add at least 30 characters."),void(n.data("ckeditor-instance")&&n.data("ckeditor-instance").view||n).focus();o.$applyAsync(function(){o.live_status="Posting Answer"}),t.addClass("disabled"),d({method:"POST",url:"/ajax.php",data:{action:"Answers.AnswerQuestion",do:"user-answer",question_id:e.data("id").replace(/^q/,""),answer:r}}).then(function(r){t.removeClass("disabled");var i,s=r.data;if(s){if("redirect"in s)return void(top.location.href=s.redirect);if("error"in s&&!0===s.error&&"message"in s){var a=s.message.match(/^Bad word `(.+)` detected\.$/);return a&&a.length?window.alert('Profanity is not allowed, including words such as "'+a[1]+'". Please adjust.'):window.alert(s.message),void n.trigger("focus")}if("id"in s){if(i=e.find(".message[data-id="+s.id+"]"),i.length>0)"answer"in s&&i.find(".answer-content").html(s.answer);else{var u="<div class='message more-content show' data-id='"+s.id+"'><div class='answer-top'><div class='avatar'><img src='"+s.avatar+"' class='avatar-img' alt='user avatar' width='40' height='40'></div><div class='answer-names'><div class='full-name' tabindex='0'>"+s.fullname+"</div><div class='second-name' aria-hidden='true' tabindex='-1'>@"+s.username+'</div></div></div><span class="ng-hide" role="tooltip" id="ans-desc-'+s.id+'">Answer provided by you</span><div class="answer-content" tabindex="0" aria-describedby="ans-desc-'+s.id+'">'+s.answer+"</div><div class='thumbs' role='none'><span class='upvote bf-icon-upvote' role='button' tabindex='0' aria-label='0 up votes'><span class='upvotes'>0<i class='af-icon-spin6 animate-spin' aria-hidden='true' tabindex='-1'></i></span></span><span class='dnvote bf-icon-downvote' role='button' tabindex='0' aria-label='0 down votes'><span class='dnvotes'>0<i class='af-icon-spin6 animate-spin' aria-hidden='true' tabindex='-1'></i></span></span></div></div>";i=e.find(".answers"),0==i.length&&(i=l("<div class='answers'></div>").insertAfter(e.find(".main-q"))),i.append(u),o.$applyAsync(function(){o.live_status="Answer Posted",c(function(){o.live_status="",i.find(".message").last().find(".answer-content").focus()},1e3)})}e.find(".main-q span.reply").hide()}e.removeClass("show-reply"),e.find(".main-q span.reply").attr("aria-expanded","false")}},function(e){t.removeClass("disabled"),401==e.status&&(top.location.href="/join/light?lg&redirect_to="+encodeURIComponent(document.location.href))})}}).on("click",".questions .question .moreans",function(){var e=l(this),t=e.closest(".question"),r=t.find(".q-title").attr("href"),i={};i.action="Answers.GetMoreAnswers",i.qid=t.data("id"),i.v=2,i.answers=t.find(".answers > .message").length,e.focus(),e.addClass("loading"),o.$applyAsync(function(){o.live_status="Loading more answers"}),d({url:"/ajax.php",params:i}).then(function(i){for(var s=i.data,a=0;a<s.answers.length;a++){var l=s.answers[a],c="<div class='message more-content' data-id='"+l.id+"'><div class='answer-top'><div class='avatar'><img src='"+l.user_avatar+"' class='avatar-img' width='40' height='40' alt='user avatar' tabindex='0' /></div><div class='answer-names'>";""!=l.user_title?c+="<div class='full-name' role='text' tabindex='0'>"+l.user_fullname+"<span class='cap'>, "+l.user_title+"</span></div>":c+="<div class='full-name' role='text' tabindex='0'>"+l.user_fullname+"</div>",c+="<div class='second-name' tabindex='-1' aria-hidden='true'>@"+l.user_login+'</div></div></div><span class="ng-hide" id="ans-desc-'+l.id+'">Answer provided by user: '+l.user_fullname+"</span><div class='answer-content' tabindex='0' aria-describedby='ans-desc-"+l.id+"'>"+l.content+"</div><div class='answer-content-more'><a href='"+r+"' class='more-link' tabindex='0' rel='nofollow'>show more<span class='bf-icon-right-open-big' aria-hidden='true' tabindex='-1'></span></a></div><div class='thumbs'><span class='upvote bf-icon-upvote' role='button' tabindex='0' aria-label='"+l.upvote+" up vote"+(1!=l.upvote?"s":"")+"'><span class='upvotes'>"+l.upvote+"<i class='af-icon-spin6 animate-spin'></i></span></span><span class='dnvote bf-icon-downvote' role='button' tabindex='0' aria-label='"+l.upvote+" down vote"+(1!=l.upvote?"s":"")+"'><span class='dnvotes'>"+l.downvote+"<span class='af-icon-spin6 animate-spin'></span></span></span></div></div>",l=t.find(".answers").append(c).find(".answer-content:last"),l.prop("scrollHeight")<=l.prop("offsetHeight")&&l.closest(".message").removeClass("more-content")}0==s.left?e.closest(".moreans").hide():e.closest(".moreans").removeClass("loading");var u=s.answers.length;if(u){var d=document.querySelector("[data-status-ans]")||document.createElement("div");d.setAttribute("data-status-ans","status"),d.setAttribute("aria-live","polite"),d.setAttribute("role","status"),d.setAttribute("tabindex","-1"),d.setAttribute("aria-hidden","true");var p=document.querySelector('.answers .message[data-id="'+s.answers[0].id+'"]');t.find(".answers")[0].insertBefore(d,p),d.setAttribute("aria-label","");var f="Loaded "+u+" more answer"+(1!=u?"s":"");d.setAttribute("aria-label",f),n()&&o.$applyAsync(function(){o.live_status=f}),requestAnimationFrame(function(){d.focus()})}})}).on("click",".question-form.no-question .q-btn,.question-form .question-box .q-btn,.question-form .search-notice .btn,.ftrbtns .btn.blue",function(){function e(){u.set(o.comsearch),l(".ask-overlay .askform").css("top",f.scrollY-55+"px"),o.$apply(function(){t.show_ask_overlay=!0})}var n=l(document).height();n-l(document).scrollTop()<1200?(l("html,body").scrollTop(n-1200),e()):e()}).on("click",".answer-content-more span",function(){var e=l(this).closest(".message");e.toggleClass("show"),e.hasClass("show")?e.find(".answer-content").focus():(e.find(".more-link").focus(),setTimeout(function(){e.find(".more-link").focus()}))}).on("click",".ftrbtns .viewmore",function(){var e=l(this),t=l(s);"p"in h.search()&&void 0===t.data("qp")&&t.data("qp",parseInt(h.search().p));var r=t.data("qp")||1;e.addClass("loading");var i=document.location.href,a=e.data("url");void 0!==a&&""!=a&&(i=a),o.$applyAsync(function(){o.live_status="Loading more questions"}),d({url:"/ajax.php",params:{action:"Answers.GetMoreQuestions",url:i,p:r+1,sort_by:o.ans_sort}}).then(function(i){o.$applyAsync(function(){o.live_status=""});var a=document.querySelectorAll(".comqa .questions .question"),u=a[a.length-1],d=a.length,p=i.data;e.removeClass("loading");var f=document.createElement("div");l(f).html(p.html),l(f).find(".answer-user-avatar[data-src]").each(function(){var e=l(this);e.attr("src",e.attr("data-src")),e.removeAttr("data-src"),e.addClass("answer-user-avatar-load"),e.css({display:"block"})}),t.find(".questions").append(l(f).html()),o.after_loading_more=!0,c(function(){o.after_loading_more=!1},100),a=document.querySelectorAll(".comqa .questions .question");var h=a.length,m=h-d,v=document.querySelector("[data-status-question]")||document.createElement("div");v.setAttribute("data-status-question","status"),v.setAttribute("aria-live","polite"),v.setAttribute("role","status"),v.setAttribute("tabindex","-1"),v.setAttribute("aria-hidden","true"),document.querySelector(".comqa .questions").insertBefore(v,u.nextSibling||u),v.setAttribute("aria-label","");var g="Loaded "+m+" more question"+(1!=m?"s":"");v.setAttribute("aria-label",g),n()&&o.$applyAsync(function(){o.live_status=g}),requestAnimationFrame(function(){v.focus()}),setTimeout(function(){l(s).find(".questions .question .answers .message.more-content .answer-content").each(function(){var e=l(this);e.prop("scrollHeight")<=e.prop("clientHeight")&&e.closest(".message").removeClass("more-content")}),l(s).find(".questions .question .main-q .more-info").each(function(){var e=l(this);e.prop("scrollHeight")<=e.prop("offsetHeight")+(e.find("span.match").length>0?2:0)&&e.next(".more-info-more").remove()})},150),!1===p.more?e.remove():t.data("qp",r+1)})}).on("click",".upvote,.dnvote",function(){if(!i.is_logged_in())return top.location.href="/join/light?redirect_to="+encodeURI(document.location.href),!1;var e=l(this),t=e.closest(".question"),n=e.find("> span[class$='votes']").addClass("loading"),s="answer",a="up",c=t.data("id");e.parent().hasClass("main-q")&&(s="question"),e.hasClass("dnvote")&&(a="dn"),"answer"==s&&(c=e.closest(".message").data("id")),o.live_status="Voting "+s;var u=c.match(/^([abceq])(\d+)$/);u&&(c=u.pop(),s=u.pop(),~["q","a"].indexOf(s)||(s="q"+s)),d.post("/ajax.php?action=Answers.Vote",{dir:a,kind:s,id:c}).then(function(r){o.live_status="",n.removeClass("loading");var i=r.data;if(i.error)return void window.alert("An unknown error has ocured.");e.attr("aria-live","polite"),setTimeout(function(){e.attr("aria-live","off")},1e3);var a,l;"q"==s.charAt(0)?(t.find("> .upvotes strong").text(i.votes_up),a=t.find(".main-q .upvotes"),l=t.find(".main-q .dnvotes"),a.parent().attr("aria-label",i.votes_up+" up vote"+(1!=i.votes_up?"s":"")),a.html(i.votes_up+"<i class='af-icon-spin6 animate-spin'></i>"),l.parent().attr("aria-label",i.votes_dn+" down vote"+(1!=i.votes_dn?"s":"")),l.html(i.votes_dn+"<i class='af-icon-spin6 animate-spin'></i>")):(a=n.closest(".thumbs").find(".upvotes"),l=n.closest(".thumbs").find(".dnvotes"),a.parent().attr("aria-label",i.votes_up+" up vote"+(1!=i.votes_up?"s":"")),a.html(i.votes_up+"<i class='af-icon-spin6 animate-spin'></i>"),l.parent().attr("aria-label",i.votes_dn+" down vote"+(1!=i.votes_dn?"s":"")),l.html(i.votes_dn+"<i class='af-icon-spin6 animate-spin'></i>")),i.upClass&&a?a.parent().attr("aria-label",a.parent().attr("aria-label")+". Pressed"):i.dnClass&&l&&l.parent().attr("aria-label",l.parent().attr("aria-label")+". Pressed")},function(e){if(o.live_status="",n.removeClass("loading"),r.isObject(e)&&"data"in e)return 401==e.status?void(top.location.href="/join/light?redirect_to="+encodeURI(document.location.href)):void window.alert("An unknown error has ocured.")})}).on("change","#sorting",function(){var e=l(this);d({url:"/ajax.php",params:{action:"Answers.CommunityQASort",uri:document.location.pathname,sort_by:e.val()}}).then(function(e){var t=e.data,n=l(s),o=n.find(".questions");o.html(t.html),o.find(".answer-user-avatar[data-src]").each(function(){var e=l(this);e.attr("src",e.attr("data-src")),e.removeAttr("data-src"),e.addClass("answer-user-avatar-load"),e.css({display:"block"})}),n.data("qp",1),1==t.pages?l(s).find(".ftrbtns .viewmore").remove():0==l(s).find(".ftrbtns .viewmore").length&&l("<span class='btn blank grey no-decoration viewmore'><span class='txt'>View More Questions</span><span class='af-icon-spin6 animate-spin'></span></span>").prependTo(l(s).find(".ftrbtns")),setTimeout(function(){l(s).find(".questions .question .answers .message.more-content .answer-content").each(function(){var e=l(this);e.prop("scrollHeight")<=e.prop("clientHeight")&&e.closest(".message").removeClass("more-content")}),l(s).find(".questions .question .main-q .more-info").each(function(){var e=l(this);e.prop("scrollHeight")<=e.prop("offsetHeight")+(e.find("span.match").length>0?2:0)&&e.next(".more-info-more").remove()})},150)})});var g,b=new RegExp("\\/css\\/searchtools\\/common\\.v13\\.d(_V[\\da-f]+_)?\\.css(\\.gz)?"),w=o.$watch(function(){for(var e=0;e<document.styleSheets.length;e++)if("href"in document.styleSheets[e]&&null!=document.styleSheets[e].href&&!1!==b.test(document.styleSheets[e].href))return!0;return!1},function(e){e&&setTimeout(function(){l(s).find(".questions .question .main-q .more-info").each(function(){var e=l(this);e.prop("scrollHeight")<=e.prop("offsetHeight")&&e.next(".more-info-more").remove()});var e=0;l(s).find(".questions .question .answers .message .answer-content").each(function(){var t=l(this);t.prop("scrollHeight")<=t.prop("clientHeight")&&(t.closest(".message").removeClass("more-content"),0==e&&(t.closest(".message").addClass("show"),t.next(".answer-content-more").find(".less-link").remove())),e++}),w()})}),_=p.defer();o.qna_result_label="",o.$watch("comsearch",function(e,n){if(e==n)return void c.cancel(g);c.cancel(g),t.comsearch=e,l(".question-form.no-question").length>0||(o.comresults_loading=!0,""==e?(_.resolve(),_=p.defer(),delete o.comresults,o.comresults_loading=!1):g=c(function(){v(e)},300))});var y=new a(.5,50);l(".answer-user-avatar").each(function(e){var t=this,n=t.getAttribute("data-src");y.Observe(t.parentNode,function(){t.addEventListener("load",function(){l(t).addClass("answer-user-avatar-load")}),t.setAttribute("src",n),t.style.display="block",t.removeAttribute("data-src")})})}]),o.register.controller("CommunitySearchAskFormController",["$rootScope","$scope","$element","$question-resolver","$http",function(e,t,n,o,r){function a(e){if(!t.question)return void(t.notice="Please enter your question.");if([].concat(t.question.split(/\s+/)).length<p)return void(t.notice="Question must have at least "+p+" word"+(1!=p?"s":"")+".");if(t.question.length>d)return void(t.notice="Question cannot have more than "+d+" character"+(1!=d?"s":""));if(!i.is_logged_in()&&c<4)return void(c=4);u=!0;var n={question:t.question,url:document.location.href+""};""!=t.details&&(n.details=t.details),t.email?(n.email=s.localencrypt(t.email),n.publickey=s.localkey):e&&(n.light="true"),t.live_status="Submitting question",r({url:"/ajax.php?action=Answers.PostQuestion",method:"POST",data:n}).then(function(n){var o=n.data;if(u=!1,t.live_status="",o.error){if(!("message"in o))return void(o.message="Unexpected error. Please contact help@evolutionfinance.com");var r=o.message.match(/^Bad word `(.+)` detected\.$/);return r&&r.length&&(o.message='Profanity is not allowed, including words such as "'+r[1]+'". Please adjust.'),void(t.notice=o.message)}if(e&&"redirect"in o)return void(top.location.href=o.redirect);c=5,t.question="",t.details="",t.email="",l(".ask-overlay .closebtn").one("click touchend",function(){c=1})})}var c=1,u=!1;t.question="",t.details="",t.overlay_shown=!1,t.live_status="",e.$watch("show_ask_overlay",function(e){e&&(t.question=o.get()),t.overlay_shown!=e&&(t.overlay_shown=e||!1)}),t.autoExpand=function(e){var t="object"==typeof e?e.target:document.getElementById(e),n=t.offsetHeight-t.clientHeight;t.style.height="auto",t.style.height=t.scrollHeight+n+"px"};var d=140,p=3;t.chars_left=d,l(n).on("click touchend",".askform > span.closebtn",function(){t.$apply(function(){e.show_ask_overlay=!1});var n=document.querySelector(".comqa .search-notice .btn")||document.querySelector(".question-form.no-question .q-btn,.question-form .question-box .q-btn,.question-form .search-notice .btn,.ftrbtns .btn.blue");n&&n.focus()}).on("click touchend",".askform .ask .btn.next,.askform .step4 .btn.login,.askform .step4 .btn.em",function(){a(4==l(this).closest("section").data("step"))}),t.is_overlay_step=function(e){return c==e},t.is_additional_details_visible=function(){return t.chars_left<d},t.is_form_loading=function(){return u},t.back=function(){c=1}}]),e(["shortcode-js"],function(e){var t="https://"+location.host;(l(".pl-rates-div").length||l(".pl-terms-box").length)&&e.SetPrsWidgets(window,t),(l(".cc-mini-box").length||l(".cc-list-buttons").length||l(".cc-editorial-box").length)&&(e.ClearBoxes(),e.SetBoxes(window,t))},function(e){console.error(e)}),o.pageInjector.get("$stService").setControllerReady("CommunitySearchController"),o.pageInjector.get("$stService").setControllerReady("CommunitySearchAskFormController")});