(function(n){"use strict";n.module("dlx.common",["ab-base64","angularMoment","ngUnderscore"])})(window.angular),function(n,t,i,r){"use strict";function ft(n,t,i){o=n;w=t;b=i}function g(n,t,i,r){typeof n!="number"&&(r=i,i=t,t=n,n=o);e(n,t,i,r)}function et(n,t,i){e(s.INFO,n,t,i)}function ot(n,t,i){e(s.WARNING,n,t,i)}function st(n,t,i){e(s.ERROR,n,t,i)}function ht(n,t,i){e(s.VERBOSE,n,t,i)}function ct(n,t,i){e(s.DEBUG,n,t,i)}function lt(n){n&&i.clear();for(var t=a.shift();t;)tt(t),t=a.shift()}function e(n,t,i,r){if(n<=o)try{if(r){var u=at(r);bt(n,u,t,i)}else nt(n,t,i)}catch(f){yt(f)}}function at(t){for(var i={},u=t&&t.length||0,r=0;r<u;r++)i=n.extend(!0,i,t[r]);return i}function vt(){i.groupCollapsed||(i.groupCollapsed=i.log);i.groupEnd||(i.groupEnd=function(){});i.clear||(i.clear=function(){})}function yt(n){var r="";try{r=JSON.stringify(n)}catch(u){i.warn("Could not stringify exception: "+u.message)}i.warn("Exception thrown during logging. Original log is likely not written\n"+r);o>=t.dlx.console.level.DEBUG&&alert(n.message+"\nException thrown during logging. Original log is likely not written\n"+r)}function pt(n){var t="[";return b&&(t+=moment().format("YYYY/MM/DD HH:mm:ss")),t.length>1&&(t+=" | "),t+(wt(n)+"] ")}function wt(n){var i=t.dlx.console.level;for(var r in i)if(i.hasOwnProperty(r)&&i[r]===n)return r;return n}function bt(n,t,i,u){var c=dt(i),y=c&&c.length||0,e=[].concat(i),a,o,s,l,h;if(e.length){for(s=0;s<y;s++)for(a=c[s][f],o=gt(t,a),(o===null||o===r)&&(o=""),l=c[s][d],h=v(e,l);h!==-1;)e[h]=e[h].replace(new RegExp(it(l),"g"),o),h=v(e,l);nt(n,e,u)}}function nt(n,t,i){var l=t===null||t===r?"":t,s=kt(l),k=s&&s.length||0,g=i&&typeof i!="string"&&i.length||0,u=[].concat(l),nt=u.length,o,e;if(nt){for(o=0;o<k;o++){var c=s[o][f],y=parseInt(c),p=s[o][d],b=new RegExp(it(p),"g"),h=v(u,p);y<g?(e=i[y],c.indexOf(":")!==-1&&(e=ut(e,c.split(":")[1])),(e===null||e===r)&&(e=""),u[h]=u[h].replace(b,e)):u[h]=u[h].replace(b,"")}u[0]=pt(n)+u[0];tt(u);w&&a.push(u)}}function tt(n){var t=n.length||0,r=t>1?1:0,u;if(t){for(t>1&&i.groupCollapsed(n[0]);r<t;r++)u=(r!==0?"\t":"")+n[r],i.log(u);t>1&&i.groupEnd()}}function v(n,t){for(var r,u=n.length||0,i=0;i<u;i++)if(r=n[i],r.indexOf(t)>-1)return i;return-1}function it(n){return n&&typeof n=="string"&&n.replace("{","\\{").replace("}","\\}")}function rt(n){var t=n.split(":");return t.length<2&&(t=n.split("/")),t}function kt(n){for(var i=[],r=[].concat(n).join(" "),t=h.exec(r);t;){var u=t[f],e=rt(u),o=i.filter(function(n){return n[f]===u||!l(e[0])});!o.length&&l(e[0])&&i.push(t);t=h.exec(r)}return i}function dt(n){for(var i=[],r=[].concat(n).join(" "),t=h.exec(r);t;){var u=t[f],e=rt(u),o=i.filter(function(n){return n[f]===u||l(e[0])});o.length||l(e[0])||i.push(t);t=h.exec(r)}return i}function gt(n,t){var e;if(!t||!n||typeof n!="object")return r;var i=t.split(":"),u,f=n,o=function(n){return c(n)};if(i.length<2?(i=t.split("/"),i.length===2&&(o=ni)):o=ut,u=i[0].split("."),!u)return r;for(e=0;e<u.length;e++)if(f=f[u[e]],f===r)break;return o(f,i[1])}function ni(n,t){return typeof n!="function"?r:c(n(t))}function ut(n,i){var u,f;if(typeof n=="function")return r;if(u=/\s*/.exec(n),!n||u&&u[0]===n)return n;if(i==="J"){if(typeof n=="object")return y(1,n);if(typeof n=="string"){if(n.match(/((<.{0,20}\/>)|(<.{0,20}>))/))return"<html -hidden- />";try{return f=JSON.parse(n),y(1,f)}catch(e){}}}return g(t.dlx.console.level.WARNING,"Invalid format descriptor: "+i),c(n)}function c(n){return typeof n=="string"&&n.length>k?n.substr(0,k-3)+"...":n}function y(n,t){var f,u,i;if(!t)return r;f=(n>1?"\n\t":"")+p("\t",n)+"{";for(u in t)t.hasOwnProperty(u)&&(i="function",typeof t[u]!="function"&&(i=t[u],typeof i=="object"?i=y(n+2,i):typeof i=="string"&&(i=c(i))),f+="\n\t\t"+p("\t",n)+u+": "+i);return f+("\n\t"+p("\t",n)+"}")}function p(n,t){var i,u;if(typeof n!="string")return r;for(i="",u=0;u<t;u++)i+=n;return i}function l(n){var t=parseInt(n,10);return!isNaN(t)&&t.toString().length===n.toString().length?!0:!1}n.extend(t.dlx||(t.dlx={}),{console:{level:{OFF:0,ERROR:3,WARNING:6,INFO:9,VERBOSE:12,DEBUG:15},template:{XHR:["status:         {status} {statusText}","url:            {url}","method:         {method}{type}","headers:","\tAuthorization: {headers.Authorization}","\tX-Deluxe-Auth: {headers.X-Deluxe-Auth}","req/res status: {0}","exception:      {1:J}","data:","{data:J}"],HTTP_RESP:["status:         {status} {statusText}","url:            {url}","method:         {method}","req data:       {config.data:J}","headers:","\tAuthorization: {headers.Authorization}","\tX-Deluxe-Auth: {headers.X-Deluxe-Auth}","resp data:","{data:J}"]},init:ft,info:et,warn:ot,error:st,verbose:ht,debug:ct,log:g,flush:lt}});var u=t.localStorage,o=u&&parseInt(u.getItem("dlx.log.lvl"))||0,w=u&&JSON.parse(u.getItem("dlx.log.useBuffer"))||!1,b=u&&JSON.parse(u.getItem("dlx.log.showTimestamp"))||!1,k=u&&parseInt(u.getItem("dlx.log.maxStrLen"))||256,s=t.dlx.console.level,a=[],h=/(?:\{([a-zA-Z0-9:/\.-]+)\})/g,d=0,f=1;i?vt():o=0}(window.jQuery,window,window.console),function(n,t,i){function o(n){var h,c,o,l;return i.log(r?i.level.VERBOSE:i.level.WARNING,"jwtManager.getToken: {0}",[r||"Missing!"]),r||(h=e||(e=t('input[id$="AuthToken"]')),c=f||(f=t('input[id$="RefreshToken"]')),h.length&&(o=h.val(),l=c.val(),i.verbose(["jwtManager.getToken","authTokenElement found!","token= {0}","{1}"],[o,o?"clearing authTokenElement and setting token internally...":""]),o&&(h.val(""),c.val(""),s(o,l)))),n?u:r}function s(n,t){n!==r&&n!==""&&(i.verbose(["jwtManager.setToken","oldToken={0}","newToken={1}","newRefresh={2}"],[r,n,t]),r=n,u=t)}function h(){return"Bearer "+o()}t.extend(n.dlx||(n.dlx={}),{jwt:{getToken:o,setToken:s,getTokenHeader:h}});var r=null,u=null,f=null,e=null}(window,window.jQuery,window.dlx.console),function(n,t){function i(n,t){var i=n.interceptors;[].concat(t).forEach(function(t){var r=i.filter(function(n){return n===t}).length;r||n.interceptors.push(t)})}t.extend(n.dlx||(n.dlx={}),{ngInterceptorConfig:{addToSet:i}})}(window,window.jQuery),function(n){"use strict";function t(n){return function(t){var i=Date.parse(t);return n("date")(i,"mediumDate")}}t.$inject=["$filter"];n.module("dlx.common").filter("dlxMediumDate",t)}(window.angular),function(n,t){"use strict";function i(n){return{request:function(i){var r=i&&i.headers;return r&&typeof r=="object"&&(r["X-Deluxe-Auth"]=n.getApiKey()),t.info(["apiKeyInterceptor.request: {method}{type} {url}"].concat(t.template.XHR),[],[i,i.headers]),i}}}i.$inject=["jwtService"];n.module("dlx.common").factory("apiKeyInterceptor",i)}(window.angular,window.dlx.console),function(n,t){"use strict";function i(n){return{request:function(i){var r=n.getToken();return i&&i.headers&&r&&(i.headers.Authorization="Bearer "+r),t.info(["jwtInterceptor.request: {method}{type} {url}"].concat(t.template.XHR),[],[i,i.headers]),i},response:function(i){var u,r;return i&&i.headers&&(u=i.headers("Authorization"),t.info(["jwtInterceptor.response: {method} {url}"].concat(t.template.HTTP_RESP),[],[i,i.config]),u&&(r=u.split(" ")[1],r&&(i.data.Refresh?n.setToken(r,i.data.Refresh):n.setToken(r)))),i}}}i.$inject=["jwtService"];n.module("dlx.common").factory("jwtInterceptor",i)}(window.angular,window.dlx.console),function(n,t,i){"use strict";function r(n,r){return{response:function(n){return n&&(t.info(["wcfHttpInterceptor.response: {method} {url}"].concat(t.template.HTTP_RESP),[],[n,n.config]),n.data&&typeof n.data=="object"&&n.data.d!==i&&(n.data=n.data.d)),n},responseError:function(i){return t.error(["wcfHttpInterceptor.responseError: {method} {url}","{0:J}"],[i],[i]),i.status===401&&i.config.url.indexOf("RefreshToken")<0&&(r.location.href="login.aspx"),n.reject(i)}}}r.$inject=["$q","$window"];n.module("dlx.common").factory("wcfHttpInterceptor",r)}(window.angular,window.dlx.console),function(n){"use strict";function t(){function n(n,t,i){var r=null;i&&(r=n.$eval(i.afterRender));n.$emit("onAfterRender",r,t)}return{restrict:"A",terminal:!1,transclude:!1,link:n}}n.module("dlx.common").directive("afterRender",t)}(window.angular),function(n){"use strict";function t(){var n=27;return function(t,i,r){i.on("keyup",function(i){i.which===n&&(t.$apply(function(){t.$eval(r.captureEscape)}),i.preventDefault())})}}n.module("dlx.common").directive("captureEscape",t)}(window.angular),function(n){"use strict";function t(t,i){function u(t,u,f){for(var o=!0,s=t.length,h=r.models.length,e=0;e<s;e++)o=o&&t[e];o&&i(function(){var i=n.element(r.selector).eq(0)||r.element,t;if(i[0].focus(),i[0].select(),r.models.length)for(e=0;e<h;e++)t=r.models[e],t.assign&&t.assign(f,u[e])},100)}var r={element:null,selector:null,models:[]};return{restrict:"A",transclude:!1,link:function(i,f,e){for(var h,o=[],c=e.setFocus.split(","),l=c.length,s=0;s<l;s++)h=t(c[s]),n.isDefined(h(i))&&o.push(h);o.length&&(r.element=f,r.models=n.isDefined(e.setFocusReset)&&o||[],r.selector=e.setFocusSelector,i.$watchGroup(o,u))}}}t.$inject=["$parse","$timeout"];n.module("dlx.common").directive("setFocus",t)}(window.angular),function(n,t){"use strict";function i(n){function r(r){var u=i+r;return t.info("internalWcfService.request: GET {0}",[u]),n.get(u)}function u(r,u){var f=i+r,e={content:u};return t.info(["internalWcfService.request: POST {0}","{1:J}"],[f,e]),n.post(f,JSON.stringify(e))}var i="/BDServices.svc/";this.get=r;this.post=u}i.prototype.uris={MyFavorites:"GetMyReports",Permissions:"GetUserPermissions",RefreshToken:"RefreshToken",CdAlertsEmailInfo:"GetCdAlertsEmailInfo",LoanAlertsEmailInfo:"GetLoanAlertsEmailInfo",SendUserEmail:"SendUserEmail"};i.$inject=["$http"];n.module("dlx.common").service("internalWcfService",i)}(window.angular,window.dlx.console),function(n,t,i){"use strict";function r(n){function s(n,r){i.debug(["jwtService.setToken","token= {0}","refreshToken={1}"],[n],[r]);t.setToken(n,r);o();v(n,r)}function e(n){return i.debug("jwtService.getToken"),t.getToken(n)}function u(){var t=e(),n={},r;return t&&(r=h(t),n=r.payload),i.verbose(["jwtService.getTokenPayload","{0:J}"],[n]),n}function h(t){var i=t.split("."),u=null,f=null,e=null,r=i.length;return r&&(u=n.urldecode(i[0])),r>1&&(f=n.urldecode(i[1])),r>2&&(e=i[2]),{header:JSON.parse(u),payload:JSON.parse(f),signature:e}}function c(){var t=u(),n;return typeof t.exp=="undefined"?null:(n=new Date(0),n.setUTCSeconds(t.exp),n)}function l(n){n&&f.indexOf(n)===-1&&f.push(n);var t=e();t&&n(t)}function a(){var n=u();return n.unique_name}function v(n,t){for(var r=f.length,i=0;i<r;i+=1)f[i](n,t)}function o(){var n=u();return i.info(["jwtService.setApiKeyFromPayload","oldApiKey= {0}","newApiKey= {1}"],[r,n.api]),r=n.api}function y(){return i.verbose("jwtService.getApiKey: {0}",[r]),r||o()}function p(){var n=u();return n.externalId}this.setToken=s;this.getToken=e;this.getTokenPayload=u;this.getTokenExpirationDate=c;this.getTokenUserName=a;this.onTokenUpdate=l;this.getApiKey=y;this.getExternalProviderId=p;var f=[],r=null}r.$inject=["base64"];n.module("dlx.common").service("jwtService",r)}(window.angular,window.dlx.jwt,window.dlx.console),function(n){"use strict";function t(n,t){function r(t){return n.get(i+t)}var i=t.mobileApiEndpoint+"/api/v1/";this.get=r}t.prototype.uris={BsIsAlerts:"dashboard/fluctuations",LoansCdsAlerts:"dashboard/pricing-exceptions"};t.$inject=["$http","$window"];n.module("dlx.common").service("mobileApiService",t)}(window.angular),function(n){"use strict";function t(t){function u(n){r.push(n)}function f(){return t.get(t.uris.Permissions).then(e)}function e(t){n.forEach(r,function(n){n(t.data)});i.userHasConsolidatedAccess=t.data.AllowConsolidated}var r=[],i=this;i.registerObserverCallback=u;i.refresh=f}t.$inject=["internalWcfService"];n.module("dlx.common").service("permissionsService",t)}(window.angular),function(n,t){"use strict";function i(n){function r(r,u){var f=i+r;return t.info(["publicWcfService.request: POST {0}","{1:J}"],[f,u]),n.post(f,u)}var i="/BdPublicServices.svc/";this.post=r}i.prototype.uris={ValidateUserLogin:"ValidateUserLogin"};i.$inject=["$http"];n.module("dlx.common").service("publicWcfService",i)}(window.angular,window.dlx.console),function(n){"use strict";function t(n){function t(){var r=n.location.search.substring(1).split("&"),i={},t;return r.forEach(function(n){n!==""&&(t=n.split("="),i[decodeURIComponent(t[0])]=decodeURIComponent(t[1]))}),i}this.getParameters=t}t.$inject=["$window"];n.module("dlx.common").service("queryStringService",t)}(window.angular),function(n){"use strict";function t(n){function u(t){return n.get(i+t)}function f(n,i){var u=r(n,i);return t.get(u)}function e(t,r){return n.post(i+t,r)}function o(n,i,u){var f=r(n,i);return t.post(f,u)}function s(t,r){return n.put(i+t,r)}function h(n,t,i){var r=new RegExp("{"+t+":?.*?}","i");return n.replace(r,i)}function r(n,t){var i=n;for(var r in t)t.hasOwnProperty(r)&&(i=h(i,r,t[r]));return i}var i="/api/",t=this;t.get=u;t.post=e;t.put=s;t.getWithParams=f;t.postWithParams=o}t.prototype.uris={BsIsAlerts:"alerts/fluctuations",LoanCdAlerts:"alerts/pricing-exceptions",cdAlertInfo:"alerts/{userId:int}/{entityId:int}/cd/{accountNumber:long}",loanAlertInfo:"alerts/{userId:int}/{entityId:int}/loan/{accountNumber:long}"};t.$inject=["$http"];n.module("dlx.common").service("restfulService",t)}(window.angular)