/* Minification failed. Returning unminified contents.
(4115,45-70): run-time error JS5017: Syntax error in regular expression: /^[a-za-zא-ת0-9\.,-\s]*$/
 */
/* Minification failed. Returning unminified contents.
(4112,45-70): run-time error JS5017: Syntax error in regular expression: /^[a-za-zא-ת0-9\.,-\s]*$/
 */
/*
 AngularJS v1.4.4
 (c) 2010-2015 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(O,W,t){'use strict';function L(b){return function(){var a=arguments[0],c;c="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.4.4/"+(b?b+"/":"")+a;for(a=1;a<arguments.length;a++){c=c+(1==a?"?":"&")+"p"+(a-1)+"=";var d=encodeURIComponent,e;e=arguments[a];e="function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof e?"undefined":"string"!=typeof e?JSON.stringify(e):e;c+=d(e)}return Error(c)}}function Da(b){if(null==b||Ya(b))return!1;var a="length"in Object(b)&&b.length;
return b.nodeType===pa&&a?!0:I(b)||G(b)||0===a||"number"===typeof a&&0<a&&a-1 in b}function m(b,a,c){var d,e;if(b)if(C(b))for(d in b)"prototype"==d||"length"==d||"name"==d||b.hasOwnProperty&&!b.hasOwnProperty(d)||a.call(c,b[d],d,b);else if(G(b)||Da(b)){var f="object"!==typeof b;d=0;for(e=b.length;d<e;d++)(f||d in b)&&a.call(c,b[d],d,b)}else if(b.forEach&&b.forEach!==m)b.forEach(a,c,b);else if(lc(b))for(d in b)a.call(c,b[d],d,b);else if("function"===typeof b.hasOwnProperty)for(d in b)b.hasOwnProperty(d)&&
a.call(c,b[d],d,b);else for(d in b)Na.call(b,d)&&a.call(c,b[d],d,b);return b}function mc(b,a,c){for(var d=Object.keys(b).sort(),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}function nc(b){return function(a,c){b(c,a)}}function Ud(){return++mb}function oc(b,a){a?b.$$hashKey=a:delete b.$$hashKey}function Mb(b,a,c){for(var d=b.$$hashKey,e=0,f=a.length;e<f;++e){var g=a[e];if(D(g)||C(g))for(var h=Object.keys(g),l=0,k=h.length;l<k;l++){var n=h[l],q=g[n];c&&D(q)?ca(q)?b[n]=new Date(q.valueOf()):Oa(q)?
b[n]=new RegExp(q):(D(b[n])||(b[n]=G(q)?[]:{}),Mb(b[n],[q],!0)):b[n]=q}}oc(b,d);return b}function Q(b){return Mb(b,xa.call(arguments,1),!1)}function Vd(b){return Mb(b,xa.call(arguments,1),!0)}function Y(b){return parseInt(b,10)}function Nb(b,a){return Q(Object.create(b),a)}function v(){}function Za(b){return b}function qa(b){return function(){return b}}function pc(b){return C(b.toString)&&b.toString!==Object.prototype.toString}function y(b){return"undefined"===typeof b}function x(b){return"undefined"!==
typeof b}function D(b){return null!==b&&"object"===typeof b}function lc(b){return null!==b&&"object"===typeof b&&!qc(b)}function I(b){return"string"===typeof b}function X(b){return"number"===typeof b}function ca(b){return"[object Date]"===sa.call(b)}function C(b){return"function"===typeof b}function Oa(b){return"[object RegExp]"===sa.call(b)}function Ya(b){return b&&b.window===b}function $a(b){return b&&b.$evalAsync&&b.$watch}function ab(b){return"boolean"===typeof b}function rc(b){return!(!b||!(b.nodeName||
b.prop&&b.attr&&b.find))}function Wd(b){var a={};b=b.split(",");var c;for(c=0;c<b.length;c++)a[b[c]]=!0;return a}function ta(b){return M(b.nodeName||b[0]&&b[0].nodeName)}function bb(b,a){var c=b.indexOf(a);0<=c&&b.splice(c,1);return c}function fa(b,a,c,d){if(Ya(b)||$a(b))throw Ea("cpws");if(sc.test(sa.call(a)))throw Ea("cpta");if(a){if(b===a)throw Ea("cpi");c=c||[];d=d||[];D(b)&&(c.push(b),d.push(a));var e;if(G(b))for(e=a.length=0;e<b.length;e++)a.push(fa(b[e],null,c,d));else{var f=a.$$hashKey;G(a)?
a.length=0:m(a,function(b,c){delete a[c]});if(lc(b))for(e in b)a[e]=fa(b[e],null,c,d);else if(b&&"function"===typeof b.hasOwnProperty)for(e in b)b.hasOwnProperty(e)&&(a[e]=fa(b[e],null,c,d));else for(e in b)Na.call(b,e)&&(a[e]=fa(b[e],null,c,d));oc(a,f)}}else if(a=b,D(b)){if(c&&-1!==(f=c.indexOf(b)))return d[f];if(G(b))return fa(b,[],c,d);if(sc.test(sa.call(b)))a=new b.constructor(b);else if(ca(b))a=new Date(b.getTime());else if(Oa(b))a=new RegExp(b.source,b.toString().match(/[^\/]*$/)[0]),a.lastIndex=
b.lastIndex;else return e=Object.create(qc(b)),fa(b,e,c,d);d&&(c.push(b),d.push(a))}return a}function ia(b,a){if(G(b)){a=a||[];for(var c=0,d=b.length;c<d;c++)a[c]=b[c]}else if(D(b))for(c in a=a||{},b)if("$"!==c.charAt(0)||"$"!==c.charAt(1))a[c]=b[c];return a||b}function ka(b,a){if(b===a)return!0;if(null===b||null===a)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&"object"==c)if(G(b)){if(!G(a))return!1;if((c=b.length)==a.length){for(d=0;d<c;d++)if(!ka(b[d],a[d]))return!1;return!0}}else{if(ca(b))return ca(a)?
ka(b.getTime(),a.getTime()):!1;if(Oa(b))return Oa(a)?b.toString()==a.toString():!1;if($a(b)||$a(a)||Ya(b)||Ya(a)||G(a)||ca(a)||Oa(a))return!1;c=ga();for(d in b)if("$"!==d.charAt(0)&&!C(b[d])){if(!ka(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!(d in c||"$"===d.charAt(0)||a[d]===t||C(a[d])))return!1;return!0}return!1}function cb(b,a,c){return b.concat(xa.call(a,c))}function tc(b,a){var c=2<arguments.length?xa.call(arguments,2):[];return!C(a)||a instanceof RegExp?a:c.length?function(){return arguments.length?
a.apply(b,cb(c,arguments,0)):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}}function Xd(b,a){var c=a;"string"===typeof b&&"$"===b.charAt(0)&&"$"===b.charAt(1)?c=t:Ya(a)?c="$WINDOW":a&&W===a?c="$DOCUMENT":$a(a)&&(c="$SCOPE");return c}function db(b,a){if("undefined"===typeof b)return t;X(a)||(a=a?2:null);return JSON.stringify(b,Xd,a)}function uc(b){return I(b)?JSON.parse(b):b}function vc(b,a){var c=Date.parse("Jan 01, 1970 00:00:00 "+b)/6E4;return isNaN(c)?a:c}function Ob(b,
a,c){c=c?-1:1;var d=vc(a,b.getTimezoneOffset());a=b;b=c*(d-b.getTimezoneOffset());a=new Date(a.getTime());a.setMinutes(a.getMinutes()+b);return a}function ua(b){b=z(b).clone();try{b.empty()}catch(a){}var c=z("<div>").append(b).html();try{return b[0].nodeType===Pa?M(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+M(b)})}catch(d){return M(c)}}function wc(b){try{return decodeURIComponent(b)}catch(a){}}function xc(b){var a={};m((b||"").split("&"),function(b){var d,e,f;b&&(e=
b=b.replace(/\+/g,"%20"),d=b.indexOf("="),-1!==d&&(e=b.substring(0,d),f=b.substring(d+1)),e=wc(e),x(e)&&(f=x(f)?wc(f):!0,Na.call(a,e)?G(a[e])?a[e].push(f):a[e]=[a[e],f]:a[e]=f))});return a}function Pb(b){var a=[];m(b,function(b,d){G(b)?m(b,function(b){a.push(ma(d,!0)+(!0===b?"":"="+ma(b,!0)))}):a.push(ma(d,!0)+(!0===b?"":"="+ma(b,!0)))});return a.length?a.join("&"):""}function nb(b){return ma(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ma(b,a){return encodeURIComponent(b).replace(/%40/gi,
"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,a?"%20":"+")}function Yd(b,a){var c,d,e=Qa.length;for(d=0;d<e;++d)if(c=Qa[d]+a,I(c=b.getAttribute(c)))return c;return null}function Zd(b,a){var c,d,e={};m(Qa,function(a){a+="app";!c&&b.hasAttribute&&b.hasAttribute(a)&&(c=b,d=b.getAttribute(a))});m(Qa,function(a){a+="app";var e;!c&&(e=b.querySelector("["+a.replace(":","\\:")+"]"))&&(c=e,d=e.getAttribute(a))});c&&(e.strictDi=null!==Yd(c,"strict-di"),
a(c,d?[d]:[],e))}function yc(b,a,c){D(c)||(c={});c=Q({strictDi:!1},c);var d=function(){b=z(b);if(b.injector()){var d=b[0]===W?"document":ua(b);throw Ea("btstrpd",d.replace(/</,"&lt;").replace(/>/,"&gt;"));}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);c.debugInfoEnabled&&a.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);a.unshift("ng");d=eb(a,c.strictDi);d.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",
d);c(b)(a)})}]);return d},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;O&&e.test(O.name)&&(c.debugInfoEnabled=!0,O.name=O.name.replace(e,""));if(O&&!f.test(O.name))return d();O.name=O.name.replace(f,"");aa.resumeBootstrap=function(b){m(b,function(b){a.push(b)});return d()};C(aa.resumeDeferredBootstrap)&&aa.resumeDeferredBootstrap()}function $d(){O.name="NG_ENABLE_DEBUG_INFO!"+O.name;O.location.reload()}function ae(b){b=aa.element(b).injector();if(!b)throw Ea("test");return b.get("$$testability")}
function zc(b,a){a=a||"_";return b.replace(be,function(b,d){return(d?a:"")+b.toLowerCase()})}function ce(){var b;if(!Ac){var a=ob();la=O.jQuery;x(a)&&(la=null===a?t:O[a]);la&&la.fn.on?(z=la,Q(la.fn,{scope:Ra.scope,isolateScope:Ra.isolateScope,controller:Ra.controller,injector:Ra.injector,inheritedData:Ra.inheritedData}),b=la.cleanData,la.cleanData=function(a){var d;if(Qb)Qb=!1;else for(var e=0,f;null!=(f=a[e]);e++)(d=la._data(f,"events"))&&d.$destroy&&la(f).triggerHandler("$destroy");b(a)}):z=R;aa.element=
z;Ac=!0}}function pb(b,a,c){if(!b)throw Ea("areq",a||"?",c||"required");return b}function Sa(b,a,c){c&&G(b)&&(b=b[b.length-1]);pb(C(b),a,"not a function, got "+(b&&"object"===typeof b?b.constructor.name||"Object":typeof b));return b}function Ta(b,a){if("hasOwnProperty"===b)throw Ea("badname",a);}function Bc(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,g=0;g<f;g++)d=a[g],b&&(b=(e=b)[d]);return!c&&C(b)?tc(e,b):b}function qb(b){var a=b[0];b=b[b.length-1];var c=[a];do{a=a.nextSibling;
if(!a)break;c.push(a)}while(a!==b);return z(c)}function ga(){return Object.create(null)}function de(b){function a(a,b,c){return a[b]||(a[b]=c())}var c=L("$injector"),d=L("ng");b=a(b,"angular",Object);b.$$minErr=b.$$minErr||L;return a(b,"module",function(){var b={};return function(f,g,h){if("hasOwnProperty"===f)throw d("badname","module");g&&b.hasOwnProperty(f)&&(b[f]=null);return a(b,f,function(){function a(b,c,e,f){f||(f=d);return function(){f[e||"push"]([b,c,arguments]);return B}}function b(a,c){return function(b,
e){e&&C(e)&&(e.$$moduleName=f);d.push([a,c,arguments]);return B}}if(!g)throw c("nomod",f);var d=[],e=[],r=[],u=a("$injector","invoke","push",e),B={_invokeQueue:d,_configBlocks:e,_runBlocks:r,requires:g,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:b("$provide","decorator"),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider",
"register"),directive:b("$compileProvider","directive"),config:u,run:function(a){r.push(a);return this}};h&&u(h);return B})}})}function ee(b){Q(b,{bootstrap:yc,copy:fa,extend:Q,merge:Vd,equals:ka,element:z,forEach:m,injector:eb,noop:v,bind:tc,toJson:db,fromJson:uc,identity:Za,isUndefined:y,isDefined:x,isString:I,isFunction:C,isObject:D,isNumber:X,isElement:rc,isArray:G,version:fe,isDate:ca,lowercase:M,uppercase:rb,callbacks:{counter:0},getTestability:ae,$$minErr:L,$$csp:Fa,reloadWithDebugInfo:$d});
Rb=de(O);Rb("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:ge});a.provider("$compile",Cc).directive({a:he,input:Dc,textarea:Dc,form:ie,script:je,select:ke,style:le,option:me,ngBind:ne,ngBindHtml:oe,ngBindTemplate:pe,ngClass:qe,ngClassEven:re,ngClassOdd:se,ngCloak:te,ngController:ue,ngForm:ve,ngHide:we,ngIf:xe,ngInclude:ye,ngInit:ze,ngNonBindable:Ae,ngPluralize:Be,ngRepeat:Ce,ngShow:De,ngStyle:Ee,ngSwitch:Fe,ngSwitchWhen:Ge,ngSwitchDefault:He,ngOptions:Ie,ngTransclude:Je,ngModel:Ke,
ngList:Le,ngChange:Me,pattern:Ec,ngPattern:Ec,required:Fc,ngRequired:Fc,minlength:Gc,ngMinlength:Gc,maxlength:Hc,ngMaxlength:Hc,ngValue:Ne,ngModelOptions:Oe}).directive({ngInclude:Pe}).directive(sb).directive(Ic);a.provider({$anchorScroll:Qe,$animate:Re,$animateCss:Se,$$animateQueue:Te,$$AnimateRunner:Ue,$browser:Ve,$cacheFactory:We,$controller:Xe,$document:Ye,$exceptionHandler:Ze,$filter:Jc,$$forceReflow:$e,$interpolate:af,$interval:bf,$http:cf,$httpParamSerializer:df,$httpParamSerializerJQLike:ef,
$httpBackend:ff,$location:gf,$log:hf,$parse:jf,$rootScope:kf,$q:lf,$$q:mf,$sce:nf,$sceDelegate:of,$sniffer:pf,$templateCache:qf,$templateRequest:rf,$$testability:sf,$timeout:tf,$window:uf,$$rAF:vf,$$jqLite:wf,$$HashMap:xf,$$cookieReader:yf})}])}function fb(b){return b.replace(zf,function(a,b,d,e){return e?d.toUpperCase():d}).replace(Af,"Moz$1")}function Kc(b){b=b.nodeType;return b===pa||!b||9===b}function Lc(b,a){var c,d,e=a.createDocumentFragment(),f=[];if(Sb.test(b)){c=c||e.appendChild(a.createElement("div"));
d=(Bf.exec(b)||["",""])[1].toLowerCase();d=na[d]||na._default;c.innerHTML=d[1]+b.replace(Cf,"<$1></$2>")+d[2];for(d=d[0];d--;)c=c.lastChild;f=cb(f,c.childNodes);c=e.firstChild;c.textContent=""}else f.push(a.createTextNode(b));e.textContent="";e.innerHTML="";m(f,function(a){e.appendChild(a)});return e}function R(b){if(b instanceof R)return b;var a;I(b)&&(b=T(b),a=!0);if(!(this instanceof R)){if(a&&"<"!=b.charAt(0))throw Tb("nosel");return new R(b)}if(a){a=W;var c;b=(c=Df.exec(b))?[a.createElement(c[1])]:
(c=Lc(b,a))?c.childNodes:[]}Mc(this,b)}function Ub(b){return b.cloneNode(!0)}function tb(b,a){a||ub(b);if(b.querySelectorAll)for(var c=b.querySelectorAll("*"),d=0,e=c.length;d<e;d++)ub(c[d])}function Nc(b,a,c,d){if(x(d))throw Tb("offargs");var e=(d=vb(b))&&d.events,f=d&&d.handle;if(f)if(a)m(a.split(" "),function(a){if(x(c)){var d=e[a];bb(d||[],c);if(d&&0<d.length)return}b.removeEventListener(a,f,!1);delete e[a]});else for(a in e)"$destroy"!==a&&b.removeEventListener(a,f,!1),delete e[a]}function ub(b,
a){var c=b.ng339,d=c&&gb[c];d&&(a?delete d.data[a]:(d.handle&&(d.events.$destroy&&d.handle({},"$destroy"),Nc(b)),delete gb[c],b.ng339=t))}function vb(b,a){var c=b.ng339,c=c&&gb[c];a&&!c&&(b.ng339=c=++Ef,c=gb[c]={events:{},data:{},handle:t});return c}function Vb(b,a,c){if(Kc(b)){var d=x(c),e=!d&&a&&!D(a),f=!a;b=(b=vb(b,!e))&&b.data;if(d)b[a]=c;else{if(f)return b;if(e)return b&&b[a];Q(b,a)}}}function wb(b,a){return b.getAttribute?-1<(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+
a+" "):!1}function xb(b,a){a&&b.setAttribute&&m(a.split(" "),function(a){b.setAttribute("class",T((" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+T(a)+" "," ")))})}function yb(b,a){if(a&&b.setAttribute){var c=(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");m(a.split(" "),function(a){a=T(a);-1===c.indexOf(" "+a+" ")&&(c+=a+" ")});b.setAttribute("class",T(c))}}function Mc(b,a){if(a)if(a.nodeType)b[b.length++]=a;else{var c=a.length;if("number"===typeof c&&a.window!==
a){if(c)for(var d=0;d<c;d++)b[b.length++]=a[d]}else b[b.length++]=a}}function Oc(b,a){return zb(b,"$"+(a||"ngController")+"Controller")}function zb(b,a,c){9==b.nodeType&&(b=b.documentElement);for(a=G(a)?a:[a];b;){for(var d=0,e=a.length;d<e;d++)if((c=z.data(b,a[d]))!==t)return c;b=b.parentNode||11===b.nodeType&&b.host}}function Pc(b){for(tb(b,!0);b.firstChild;)b.removeChild(b.firstChild)}function Wb(b,a){a||tb(b);var c=b.parentNode;c&&c.removeChild(b)}function Ff(b,a){a=a||O;if("complete"===a.document.readyState)a.setTimeout(b);
else z(a).on("load",b)}function Qc(b,a){var c=Ab[a.toLowerCase()];return c&&Rc[ta(b)]&&c}function Gf(b,a){var c=b.nodeName;return("INPUT"===c||"TEXTAREA"===c)&&Sc[a]}function Hf(b,a){var c=function(c,e){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=a[e||c.type],g=f?f.length:0;if(g){if(y(c.immediatePropagationStopped)){var h=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();h&&h.call(c)}}c.isImmediatePropagationStopped=
function(){return!0===c.immediatePropagationStopped};1<g&&(f=ia(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||f[l].call(b,c)}};c.elem=b;return c}function wf(){this.$get=function(){return Q(R,{hasClass:function(b,a){b.attr&&(b=b[0]);return wb(b,a)},addClass:function(b,a){b.attr&&(b=b[0]);return yb(b,a)},removeClass:function(b,a){b.attr&&(b=b[0]);return xb(b,a)}})}}function Ga(b,a){var c=b&&b.$$hashKey;if(c)return"function"===typeof c&&(c=b.$$hashKey()),c;c=typeof b;return c="function"==
c||"object"==c&&null!==b?b.$$hashKey=c+":"+(a||Ud)():c+":"+b}function Ua(b,a){if(a){var c=0;this.nextUid=function(){return++c}}m(b,this.put,this)}function If(b){return(b=b.toString().replace(Tc,"").match(Uc))?"function("+(b[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function eb(b,a){function c(a){return function(b,c){if(D(b))m(b,nc(a));else return a(b,c)}}function d(a,b){Ta(a,"service");if(C(b)||G(b))b=r.instantiate(b);if(!b.$get)throw Ha("pget",a);return q[a+"Provider"]=b}function e(a,b){return function(){var c=
B.invoke(b,this);if(y(c))throw Ha("undef",a);return c}}function f(a,b,c){return d(a,{$get:!1!==c?e(a,b):b})}function g(a){pb(y(a)||G(a),"modulesToLoad","not an array");var b=[],c;m(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=r.get(e[0]);f[e[1]].apply(f,e[2])}}if(!n.get(a)){n.put(a,!0);try{I(a)?(c=Rb(a),b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):C(a)?b.push(r.invoke(a)):G(a)?b.push(r.invoke(a)):Sa(a,"module")}catch(e){throw G(a)&&
(a=a[a.length-1]),e.message&&e.stack&&-1==e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ha("modulerr",a,e.stack||e.message||e);}}});return b}function h(b,c){function d(a,e){if(b.hasOwnProperty(a)){if(b[a]===l)throw Ha("cdep",a+" <- "+k.join(" <- "));return b[a]}try{return k.unshift(a),b[a]=l,b[a]=c(a,e)}catch(f){throw b[a]===l&&delete b[a],f;}finally{k.shift()}}function e(b,c,f,g){"string"===typeof f&&(g=f,f=null);var h=[],k=eb.$$annotate(b,a,g),l,r,n;r=0;for(l=k.length;r<l;r++){n=k[r];if("string"!==
typeof n)throw Ha("itkn",n);h.push(f&&f.hasOwnProperty(n)?f[n]:d(n,g))}G(b)&&(b=b[l]);return b.apply(c,h)}return{invoke:e,instantiate:function(a,b,c){var d=Object.create((G(a)?a[a.length-1]:a).prototype||null);a=e(a,d,b,c);return D(a)||C(a)?a:d},get:d,annotate:eb.$$annotate,has:function(a){return q.hasOwnProperty(a+"Provider")||b.hasOwnProperty(a)}}}a=!0===a;var l={},k=[],n=new Ua([],!0),q={$provide:{provider:c(d),factory:c(f),service:c(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),
value:c(function(a,b){return f(a,qa(b),!1)}),constant:c(function(a,b){Ta(a,"constant");q[a]=b;u[a]=b}),decorator:function(a,b){var c=r.get(a+"Provider"),d=c.$get;c.$get=function(){var a=B.invoke(d,c);return B.invoke(b,null,{$delegate:a})}}}},r=q.$injector=h(q,function(a,b){aa.isString(b)&&k.push(b);throw Ha("unpr",k.join(" <- "));}),u={},B=u.$injector=h(u,function(a,b){var c=r.get(a+"Provider",b);return B.invoke(c.$get,c,t,a)});m(g(b),function(a){a&&B.invoke(a)});return B}function Qe(){var b=!0;this.disableAutoScrolling=
function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=null;Array.prototype.some.call(a,function(a){if("a"===ta(a))return b=a,!0});return b}function f(b){if(b){b.scrollIntoView();var c;c=g.yOffset;C(c)?c=c():rc(c)?(c=c[0],c="fixed"!==a.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):X(c)||(c=0);c&&(b=b.getBoundingClientRect().top,a.scrollBy(0,b-c))}else a.scrollTo(0,0)}function g(a){a=I(a)?a:c.hash();var b;a?(b=h.getElementById(a))?f(b):
(b=e(h.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var h=a.document;b&&d.$watch(function(){return c.hash()},function(a,b){a===b&&""===a||Ff(function(){d.$evalAsync(g)})});return g}]}function hb(b,a){if(!b&&!a)return"";if(!b)return a;if(!a)return b;G(b)&&(b=b.join(" "));G(a)&&(a=a.join(" "));return b+" "+a}function Jf(b){I(b)&&(b=b.split(" "));var a=ga();m(b,function(b){b.length&&(a[b]=!0)});return a}function Ia(b){return D(b)?b:{}}function Kf(b,a,c,d){function e(a){try{a.apply(null,xa.call(arguments,
1))}finally{if(B--,0===B)for(;K.length;)try{K.pop()()}catch(b){c.error(b)}}}function f(){g();h()}function g(){a:{try{w=n.state;break a}catch(a){}w=void 0}w=y(w)?null:w;ka(w,F)&&(w=F);F=w}function h(){if(A!==l.url()||p!==w)A=l.url(),p=w,m(N,function(a){a(l.url(),w)})}var l=this,k=b.location,n=b.history,q=b.setTimeout,r=b.clearTimeout,u={};l.isMock=!1;var B=0,K=[];l.$$completeOutstandingRequest=e;l.$$incOutstandingRequestCount=function(){B++};l.notifyWhenNoOutstandingRequests=function(a){0===B?a():
K.push(a)};var w,p,A=k.href,s=a.find("base"),H=null;g();p=w;l.url=function(a,c,e){y(e)&&(e=null);k!==b.location&&(k=b.location);n!==b.history&&(n=b.history);if(a){var f=p===e;if(A===a&&(!d.history||f))return l;var h=A&&Ja(A)===Ja(a);A=a;p=e;if(!d.history||h&&f){if(!h||H)H=a;c?k.replace(a):h?(c=k,e=a.indexOf("#"),a=-1===e?"":a.substr(e),c.hash=a):k.href=a}else n[c?"replaceState":"pushState"](e,"",a),g(),p=w;return l}return H||k.href.replace(/%27/g,"'")};l.state=function(){return w};var N=[],J=!1,F=
null;l.onUrlChange=function(a){if(!J){if(d.history)z(b).on("popstate",f);z(b).on("hashchange",f);J=!0}N.push(a);return a};l.$$applicationDestroyed=function(){z(b).off("hashchange popstate",f)};l.$$checkUrlChange=h;l.baseHref=function(){var a=s.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};l.defer=function(a,b){var c;B++;c=q(function(){delete u[c];e(a)},b||0);u[c]=!0;return c};l.defer.cancel=function(a){return u[a]?(delete u[a],r(a),e(v),!0):!1}}function Ve(){this.$get=["$window",
"$log","$sniffer","$document",function(b,a,c,d){return new Kf(b,d,a,c)}]}function We(){this.$get=function(){function b(b,d){function e(a){a!=q&&(r?r==a&&(r=a.n):r=a,f(a.n,a.p),f(a,q),q=a,q.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(b in a)throw L("$cacheFactory")("iid",b);var g=0,h=Q({},d,{id:b}),l={},k=d&&d.capacity||Number.MAX_VALUE,n={},q=null,r=null;return a[b]={put:function(a,b){if(!y(b)){if(k<Number.MAX_VALUE){var c=n[a]||(n[a]={key:a});e(c)}a in l||g++;l[a]=b;g>k&&this.remove(r.key);
return b}},get:function(a){if(k<Number.MAX_VALUE){var b=n[a];if(!b)return;e(b)}return l[a]},remove:function(a){if(k<Number.MAX_VALUE){var b=n[a];if(!b)return;b==q&&(q=b.p);b==r&&(r=b.n);f(b.n,b.p);delete n[a]}delete l[a];g--},removeAll:function(){l={};g=0;n={};q=r=null},destroy:function(){n=h=l=null;delete a[b]},info:function(){return Q({},h,{size:g})}}}var a={};b.info=function(){var b={};m(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function qf(){this.$get=
["$cacheFactory",function(b){return b("templates")}]}function Cc(b,a){function c(a,b,c){var d=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,e={};m(a,function(a,f){var g=a.match(d);if(!g)throw ea("iscp",b,f,a,c?"controller bindings definition":"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f}});return e}function d(a){var b=a.charAt(0);if(!b||b!==M(b))throw ea("baddir",a);if(a!==a.trim())throw ea("baddir",a);}var e={},f=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,
g=/(([\w\-]+)(?:\:([^;]+))?;?)/,h=Wd("ngSrc,ngSrcset,src,srcset"),l=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,k=/^(on[a-z]+|formaction)$/;this.directive=function r(a,f){Ta(a,"directive");I(a)?(d(a),pb(f,"directiveFactory"),e.hasOwnProperty(a)||(e[a]=[],b.factory(a+"Directive",["$injector","$exceptionHandler",function(b,d){var f=[];m(e[a],function(e,g){try{var h=b.invoke(e);C(h)?h={compile:qa(h)}:!h.compile&&h.link&&(h.compile=qa(h.link));h.priority=h.priority||0;h.index=g;h.name=h.name||a;h.require=h.require||
h.controller&&h.name;h.restrict=h.restrict||"EA";var k=h,l=h,r=h.name,n={isolateScope:null,bindToController:null};D(l.scope)&&(!0===l.bindToController?(n.bindToController=c(l.scope,r,!0),n.isolateScope={}):n.isolateScope=c(l.scope,r,!1));D(l.bindToController)&&(n.bindToController=c(l.bindToController,r,!0));if(D(n.bindToController)){var S=l.controller,B=l.controllerAs;if(!S)throw ea("noctrl",r);var ha;a:if(B&&I(B))ha=B;else{if(I(S)){var m=Vc.exec(S);if(m){ha=m[3];break a}}ha=void 0}if(!ha)throw ea("noident",
r);}var s=k.$$bindings=n;D(s.isolateScope)&&(h.$$isolateBindings=s.isolateScope);h.$$moduleName=e.$$moduleName;f.push(h)}catch(t){d(t)}});return f}])),e[a].push(f)):m(a,nc(r));return this};this.aHrefSanitizationWhitelist=function(b){return x(b)?(a.aHrefSanitizationWhitelist(b),this):a.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(b){return x(b)?(a.imgSrcSanitizationWhitelist(b),this):a.imgSrcSanitizationWhitelist()};var n=!0;this.debugInfoEnabled=function(a){return x(a)?
(n=a,this):n};this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(a,b,c,d,w,p,A,s,H,N,J){function F(a,b){try{a.addClass(b)}catch(c){}}function V(a,b,c,d,e){a instanceof z||(a=z(a));m(a,function(b,c){b.nodeType==Pa&&b.nodeValue.match(/\S+/)&&(a[c]=z(b).wrap("<span></span>").parent()[0])});var f=S(a,b,a,c,d,e);V.$$addScopeClass(a);var g=null;return function(b,c,d){pb(b,"scope");d=d||{};
var e=d.parentBoundTranscludeFn,h=d.transcludeControllers;d=d.futureParentElement;e&&e.$$boundTransclude&&(e=e.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==ta(d)&&d.toString().match(/SVG/)?"svg":"html":"html");d="html"!==g?z(Xb(g,z("<div>").append(a).html())):c?Ra.clone.call(a):a;if(h)for(var l in h)d.data("$"+l+"Controller",h[l].instance);V.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,e);return d}}function S(a,b,c,d,e,f){function g(a,c,d,e){var f,l,k,r,n,u,N;if(p)for(N=Array(c.length),r=0;r<
h.length;r+=3)f=h[r],N[f]=c[f];else N=c;r=0;for(n=h.length;r<n;)if(l=N[h[r++]],c=h[r++],f=h[r++],c){if(c.scope){if(k=a.$new(),V.$$addScopeInfo(z(l),k),u=c.$$destroyBindings)c.$$destroyBindings=null,k.$on("$destroyed",u)}else k=a;u=c.transcludeOnThisElement?P(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?P(a,b):null;c(f,k,l,d,u,c)}else f&&f(a,l.childNodes,t,e)}for(var h=[],l,k,r,n,p,u=0;u<a.length;u++){l=new aa;k=ha(a[u],[],l,0===u?d:t,e);(f=k.length?E(k,a[u],l,b,c,null,[],[],f):null)&&f.scope&&
V.$$addScopeClass(l.$$element);l=f&&f.terminal||!(r=a[u].childNodes)||!r.length?null:S(r,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||l)h.push(u,f,l),n=!0,p=p||f;f=null}return n?g:null}function P(a,b,c){return function(d,e,f,g,h){d||(d=a.$new(!1,h),d.$$transcluded=!0);return b(d,e,{parentBoundTranscludeFn:c,transcludeControllers:f,futureParentElement:g})}}function ha(a,b,c,d,e){var h=c.$attr,l;switch(a.nodeType){case pa:x(b,va(ta(a)),"E",d,e);for(var k,r,n,p=a.attributes,
u=0,N=p&&p.length;u<N;u++){var K=!1,J=!1;k=p[u];l=k.name;r=T(k.value);k=va(l);if(n=ia.test(k))l=l.replace(Xc,"").substr(8).replace(/_(.)/g,function(a,b){return b.toUpperCase()});var S=k.replace(/(Start|End)$/,"");L(S)&&k===S+"Start"&&(K=l,J=l.substr(0,l.length-5)+"end",l=l.substr(0,l.length-6));k=va(l.toLowerCase());h[k]=l;if(n||!c.hasOwnProperty(k))c[k]=r,Qc(a,k)&&(c[k]=!0);X(a,b,r,k,n);x(b,k,"A",d,e,K,J)}a=a.className;D(a)&&(a=a.animVal);if(I(a)&&""!==a)for(;l=g.exec(a);)k=va(l[2]),x(b,k,"C",d,
e)&&(c[k]=T(l[3])),a=a.substr(l.index+l[0].length);break;case Pa:if(11===Va)for(;a.parentNode&&a.nextSibling&&a.nextSibling.nodeType===Pa;)a.nodeValue+=a.nextSibling.nodeValue,a.parentNode.removeChild(a.nextSibling);wa(b,a.nodeValue);break;case 8:try{if(l=f.exec(a.nodeValue))k=va(l[1]),x(b,k,"M",d,e)&&(c[k]=T(l[2]))}catch(B){}}b.sort(za);return b}function ya(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ea("uterdir",b,c);a.nodeType==pa&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&
e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return z(d)}function Wc(a,b,c){return function(d,e,f,g,h){e=ya(e[0],b,c);return a(d,e,f,g,h)}}function E(a,b,d,e,f,g,h,k,r){function n(a,b,c,d){if(a){c&&(a=Wc(a,c,d));a.require=E.require;a.directiveName=x;if(P===E||E.$$isolateScope)a=Z(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=Wc(b,c,d));b.require=E.require;b.directiveName=x;if(P===E||E.$$isolateScope)b=Z(b,{isolateScope:!0});k.push(b)}}function u(a,b,c,d){var e;if(I(b)){var f=b.match(l);b=
b.substring(f[0].length);var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance;e||(d="$"+b+"Controller",e=g?c.inheritedData(d):c.data(d));if(!e&&!f)throw ea("ctreq",b,a);}else if(G(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=u(a,b[g],c,d);return e||null}function N(a,b,c,d,e,f){var g=ga(),h;for(h in d){var l=d[h],k={$scope:l===P||l.$$isolateScope?e:f,$element:a,$attrs:b,$transclude:c},r=l.controller;"@"==r&&(r=b[l.name]);k=p(r,k,!0,l.controllerAs);g[l.name]=k;s||a.data("$"+l.name+
"Controller",k.instance)}return g}function K(a,c,e,f,g,l){function r(a,b,c){var d;$a(a)||(c=b,b=a,a=t);s&&(d=A);c||(c=s?ja.parent():ja);return g(a,b,d,c,ya)}var n,p,J,B,A,ha,ja;b===e?(f=d,ja=d.$$element):(ja=z(e),f=new aa(ja,d));P&&(B=c.$new(!0));g&&(ha=r,ha.$$boundTransclude=g);w&&(A=N(ja,f,ha,w,B,c));P&&(V.$$addScopeInfo(ja,B,!0,!(F&&(F===P||F===P.$$originalDirective))),V.$$addScopeClass(ja,!0),B.$$isolateBindings=P.$$isolateBindings,Y(c,f,B,B.$$isolateBindings,P,B));if(A){var m=P||S,H;m&&A[m.name]&&
(p=m.$$bindings.bindToController,(J=A[m.name])&&J.identifier&&p&&(H=J,l.$$destroyBindings=Y(c,f,J.instance,p,m)));for(n in A){J=A[n];var E=J();E!==J.instance&&(J.instance=E,ja.data("$"+n+"Controller",E),J===H&&(l.$$destroyBindings(),l.$$destroyBindings=Y(c,f,E,p,m)))}}n=0;for(l=h.length;n<l;n++)p=h[n],$(p,p.isolateScope?B:c,ja,f,p.require&&u(p.directiveName,p.require,ja,A),ha);var ya=c;P&&(P.template||null===P.templateUrl)&&(ya=B);a&&a(ya,e.childNodes,t,g);for(n=k.length-1;0<=n;n--)p=k[n],$(p,p.isolateScope?
B:c,ja,f,p.require&&u(p.directiveName,p.require,ja,A),ha)}r=r||{};for(var J=-Number.MAX_VALUE,S=r.newScopeDirective,w=r.controllerDirectives,P=r.newIsolateScopeDirective,F=r.templateDirective,A=r.nonTlbTranscludeDirective,m=!1,H=!1,s=r.hasElementTranscludeDirective,ba=d.$$element=z(b),E,x,v,y=e,za,wa=0,L=a.length;wa<L;wa++){E=a[wa];var Bb=E.$$start,M=E.$$end;Bb&&(ba=ya(b,Bb,M));v=t;if(J>E.priority)break;if(v=E.scope)E.templateUrl||(D(v)?(O("new/isolated scope",P||S,E,ba),P=E):O("new/isolated scope",
P,E,ba)),S=S||E;x=E.name;!E.templateUrl&&E.controller&&(v=E.controller,w=w||ga(),O("'"+x+"' controller",w[x],E,ba),w[x]=E);if(v=E.transclude)m=!0,E.$$tlb||(O("transclusion",A,E,ba),A=E),"element"==v?(s=!0,J=E.priority,v=ba,ba=d.$$element=z(W.createComment(" "+x+": "+d[x]+" ")),b=ba[0],U(f,xa.call(v,0),b),y=V(v,e,J,g&&g.name,{nonTlbTranscludeDirective:A})):(v=z(Ub(b)).contents(),ba.empty(),y=V(v,e));if(E.template)if(H=!0,O("template",F,E,ba),F=E,v=C(E.template)?E.template(ba,d):E.template,v=fa(v),
E.replace){g=E;v=Sb.test(v)?Yc(Xb(E.templateNamespace,T(v))):[];b=v[0];if(1!=v.length||b.nodeType!==pa)throw ea("tplrt",x,"");U(f,ba,b);L={$attr:{}};v=ha(b,[],L);var Q=a.splice(wa+1,a.length-(wa+1));P&&Zc(v);a=a.concat(v).concat(Q);$c(d,L);L=a.length}else ba.html(v);if(E.templateUrl)H=!0,O("template",F,E,ba),F=E,E.replace&&(g=E),K=Lf(a.splice(wa,a.length-wa),ba,d,f,m&&y,h,k,{controllerDirectives:w,newScopeDirective:S!==E&&S,newIsolateScopeDirective:P,templateDirective:F,nonTlbTranscludeDirective:A}),
L=a.length;else if(E.compile)try{za=E.compile(ba,d,y),C(za)?n(null,za,Bb,M):za&&n(za.pre,za.post,Bb,M)}catch(R){c(R,ua(ba))}E.terminal&&(K.terminal=!0,J=Math.max(J,E.priority))}K.scope=S&&!0===S.scope;K.transcludeOnThisElement=m;K.templateOnThisElement=H;K.transclude=y;r.hasElementTranscludeDirective=s;return K}function Zc(a){for(var b=0,c=a.length;b<c;b++)a[b]=Nb(a[b],{$$isolateScope:!0})}function x(b,d,f,g,h,l,k){if(d===h)return null;h=null;if(e.hasOwnProperty(d)){var n;d=a.get(d+"Directive");for(var p=
0,u=d.length;p<u;p++)try{n=d[p],(g===t||g>n.priority)&&-1!=n.restrict.indexOf(f)&&(l&&(n=Nb(n,{$$start:l,$$end:k})),b.push(n),h=n)}catch(J){c(J)}}return h}function L(b){if(e.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,f=c.length;d<f;d++)if(b=c[d],b.multiElement)return!0;return!1}function $c(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;m(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});m(b,function(b,f){"class"==f?(F(e,b),a["class"]=(a["class"]?
a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function Lf(a,b,c,e,f,g,h,l){var k=[],r,n,p=b[0],u=a.shift(),J=Nb(u,{templateUrl:null,transclude:null,replace:null,$$originalDirective:u}),N=C(u.templateUrl)?u.templateUrl(b,c):u.templateUrl,B=u.templateNamespace;b.empty();d(N).then(function(d){var K,w;d=fa(d);if(u.replace){d=Sb.test(d)?Yc(Xb(B,T(d))):[];K=d[0];if(1!=d.length||K.nodeType!==
pa)throw ea("tplrt",u.name,N);d={$attr:{}};U(e,b,K);var A=ha(K,[],d);D(u.scope)&&Zc(A);a=A.concat(a);$c(c,d)}else K=p,b.html(d);a.unshift(J);r=E(a,K,c,f,b,u,g,h,l);m(e,function(a,c){a==K&&(e[c]=b[0])});for(n=S(b[0].childNodes,f);k.length;){d=k.shift();w=k.shift();var H=k.shift(),V=k.shift(),A=b[0];if(!d.$$destroyed){if(w!==p){var ya=w.className;l.hasElementTranscludeDirective&&u.replace||(A=Ub(K));U(H,z(w),A);F(z(A),ya)}w=r.transcludeOnThisElement?P(d,r.transclude,V):V;r(n,d,A,e,w,r)}}k=null});return function(a,
b,c,d,e){a=e;b.$$destroyed||(k?k.push(b,c,d,a):(r.transcludeOnThisElement&&(a=P(b,r.transclude,e)),r(n,b,c,d,a,r)))}}function za(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function O(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw ea("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,ua(d));}function wa(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=a.parent();var b=!!a.length;b&&V.$$addBindingClass(a);
return function(a,c){var e=c.parent();b||V.$$addBindingClass(e);V.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function Xb(a,b){a=M(a||"html");switch(a){case "svg":case "math":var c=W.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function R(a,b){if("srcdoc"==b)return H.HTML;var c=ta(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||"ngSrc"==b))return H.RESOURCE_URL}function X(a,c,d,e,
f){var g=R(a,e);f=h[e]||f;var l=b(d,!0,g,f);if(l){if("multiple"===e&&"select"===ta(a))throw ea("selmulti",ua(a));c.push({priority:100,compile:function(){return{pre:function(a,c,h){c=h.$$observers||(h.$$observers={});if(k.test(e))throw ea("nodomevents");var r=h[e];r!==d&&(l=r&&b(r,!0,g,f),d=r);l&&(h[e]=l(a),(c[e]||(c[e]=[])).$$inter=!0,(h.$$observers&&h.$$observers[e].$$scope||a).$watch(l,function(a,b){"class"===e&&a!=b?h.$updateClass(a,b):h.$set(e,a)}))}}}})}}function U(a,b,c){var d=b[0],e=b.length,
f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]==d){a[g++]=c;h=g+e-1;for(var l=a.length;g<l;g++,h++)h<l?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&(a.context=c);break}f&&f.replaceChild(c,d);a=W.createDocumentFragment();a.appendChild(d);z.hasData(d)&&(z(c).data(z(d).data()),la?(Qb=!0,la.cleanData([d])):delete z.cache[d[z.expando]]);d=1;for(e=b.length;d<e;d++)f=b[d],z(f).remove(),a.appendChild(f),delete b[d];b[0]=c;b.length=1}function Z(a,b){return Q(function(){return a.apply(null,
arguments)},a,b)}function $(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,ua(d))}}function Y(a,c,d,e,f,g){var h;m(e,function(e,g){var l=e.attrName,k=e.optional,r,n,p,K;switch(e.mode){case "@":k||Na.call(c,l)||(d[g]=c[l]=void 0);c.$observe(l,function(a){I(a)&&(d[g]=a)});c.$$observers[l].$$scope=a;I(c[l])&&(d[g]=b(c[l])(a));break;case "=":if(!Na.call(c,l)){if(k)break;c[l]=void 0}if(k&&!c[l])break;n=w(c[l]);K=n.literal?ka:function(a,b){return a===b||a!==a&&b!==b};p=n.assign||function(){r=d[g]=n(a);throw ea("nonassign",
c[l],f.name);};r=d[g]=n(a);k=function(b){K(b,d[g])||(K(b,r)?p(a,b=d[g]):d[g]=b);return r=b};k.$stateful=!0;k=e.collection?a.$watchCollection(c[l],k):a.$watch(w(c[l],k),null,n.literal);h=h||[];h.push(k);break;case "&":n=c.hasOwnProperty(l)?w(c[l]):v;if(n===v&&k)break;d[g]=function(b){return n(a,b)}}});e=h?function(){for(var a=0,b=h.length;a<b;++a)h[a]()}:v;return g&&e!==v?(g.$on("$destroy",e),v):e}var aa=function(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<e;d++)f=c[d],this[f]=b[f]}else this.$attr=
{};this.$$element=a};aa.prototype={$normalize:va,$addClass:function(a){a&&0<a.length&&N.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&N.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=ad(a,b);c&&c.length&&N.addClass(this.$$element,c);(c=ad(b,a))&&c.length&&N.removeClass(this.$$element,c)},$set:function(a,b,d,e){var f=this.$$element[0],g=Qc(f,a),h=Gf(f,a),f=a;g?(this.$$element.prop(a,b),e=g):h&&(this[h]=b,f=h);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=
e=zc(a,"-"));g=ta(this.$$element);if("a"===g&&"href"===a||"img"===g&&"src"===a)this[a]=b=J(b,"src"===a);else if("img"===g&&"srcset"===a){for(var g="",h=T(b),l=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,l=/\s/.test(h)?l:/(,)/,h=h.split(l),l=Math.floor(h.length/2),k=0;k<l;k++)var r=2*k,g=g+J(T(h[r]),!0),g=g+(" "+T(h[r+1]));h=T(h[2*k]).split(/\s/);g+=J(T(h[0]),!0);2===h.length&&(g+=" "+T(h[1]));this[a]=b=g}!1!==d&&(null===b||b===t?this.$$element.removeAttr(e):this.$$element.attr(e,b));(a=this.$$observers)&&
m(a[f],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=ga()),e=d[a]||(d[a]=[]);e.push(b);A.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||y(c[a])||b(c[a])});return function(){bb(e,b)}}};var ca=b.startSymbol(),da=b.endSymbol(),fa="{{"==ca||"}}"==da?Za:function(a){return a.replace(/\{\{/g,ca).replace(/}}/g,da)},ia=/^ngAttr[A-Z]/;V.$$addBindingInfo=n?function(a,b){var c=a.data("$binding")||[];G(b)?c=c.concat(b):c.push(b);a.data("$binding",
c)}:v;V.$$addBindingClass=n?function(a){F(a,"ng-binding")}:v;V.$$addScopeInfo=n?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:v;V.$$addScopeClass=n?function(a,b){F(a,b?"ng-isolate-scope":"ng-scope")}:v;return V}]}function va(b){return fb(b.replace(Xc,""))}function ad(b,a){var c="",d=b.split(/\s+/),e=a.split(/\s+/),f=0;a:for(;f<d.length;f++){for(var g=d[f],h=0;h<e.length;h++)if(g==e[h])continue a;c+=(0<c.length?" ":"")+g}return c}function Yc(b){b=z(b);var a=b.length;
if(1>=a)return b;for(;a--;)8===b[a].nodeType&&Mf.call(b,a,1);return b}function Xe(){var b={},a=!1;this.register=function(a,d){Ta(a,"controller");D(a)?Q(b,a):b[a]=d};this.allowGlobals=function(){a=!0};this.$get=["$injector","$window",function(c,d){function e(a,b,c,d){if(!a||!D(a.$scope))throw L("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,g,h,l){var k,n,q;h=!0===h;l&&I(l)&&(q=l);if(I(f)){l=f.match(Vc);if(!l)throw Nf("ctrlfmt",f);n=l[1];q=q||l[3];f=b.hasOwnProperty(n)?b[n]:Bc(g.$scope,
n,!0)||(a?Bc(d,n,!0):t);Sa(f,n,!0)}if(h)return h=(G(f)?f[f.length-1]:f).prototype,k=Object.create(h||null),q&&e(g,q,k,n||f.name),Q(function(){var a=c.invoke(f,k,g,n);a!==k&&(D(a)||C(a))&&(k=a,q&&e(g,q,k,n||f.name));return k},{instance:k,identifier:q});k=c.instantiate(f,g,n);q&&e(g,q,k,n||f.name);return k}}]}function Ye(){this.$get=["$window",function(b){return z(b.document)}]}function Ze(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function Yb(b){return D(b)?
ca(b)?b.toISOString():db(b):b}function df(){this.$get=function(){return function(b){if(!b)return"";var a=[];mc(b,function(b,d){null===b||y(b)||(G(b)?m(b,function(b,c){a.push(ma(d)+"="+ma(Yb(b)))}):a.push(ma(d)+"="+ma(Yb(b))))});return a.join("&")}}}function ef(){this.$get=function(){return function(b){function a(b,e,f){null===b||y(b)||(G(b)?m(b,function(b,c){a(b,e+"["+(D(b)?c:"")+"]")}):D(b)&&!ca(b)?mc(b,function(b,c){a(b,e+(f?"":"[")+c+(f?"":"]"))}):c.push(ma(e)+"="+ma(Yb(b))))}if(!b)return"";var c=
[];a(b,"",!0);return c.join("&")}}}function Zb(b,a){if(I(b)){var c=b.replace(Of,"").trim();if(c){var d=a("Content-Type");(d=d&&0===d.indexOf(bd))||(d=(d=c.match(Pf))&&Qf[d[0]].test(c));d&&(b=uc(c))}}return b}function cd(b){var a=ga(),c;I(b)?m(b.split("\n"),function(b){c=b.indexOf(":");var e=M(T(b.substr(0,c)));b=T(b.substr(c+1));e&&(a[e]=a[e]?a[e]+", "+b:b)}):D(b)&&m(b,function(b,c){var f=M(c),g=T(b);f&&(a[f]=a[f]?a[f]+", "+g:g)});return a}function dd(b){var a;return function(c){a||(a=cd(b));return c?
(c=a[M(c)],void 0===c&&(c=null),c):a}}function ed(b,a,c,d){if(C(d))return d(b,a,c);m(d,function(d){b=d(b,a,c)});return b}function cf(){var b=this.defaults={transformResponse:[Zb],transformRequest:[function(a){return D(a)&&"[object File]"!==sa.call(a)&&"[object Blob]"!==sa.call(a)&&"[object FormData]"!==sa.call(a)?db(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ia($b),put:ia($b),patch:ia($b)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},
a=!1;this.useApplyAsync=function(b){return x(b)?(a=!!b,this):a};var c=!0;this.useLegacyPromiseExtensions=function(a){return x(a)?(c=!!a,this):c};var d=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(e,f,g,h,l,k){function n(a){function d(a){var b=Q({},a);b.data=a.data?ed(a.data,a.headers,a.status,f.transformResponse):a.data;a=a.status;return 200<=a&&300>a?b:l.reject(b)}function e(a,b){var c,d={};m(a,function(a,e){C(a)?(c=a(b),null!=
c&&(d[e]=c)):d[e]=a});return d}if(!aa.isObject(a))throw L("$http")("badreq",a);var f=Q({method:"get",transformRequest:b.transformRequest,transformResponse:b.transformResponse,paramSerializer:b.paramSerializer},a);f.headers=function(a){var c=b.headers,d=Q({},a.headers),f,g,h,c=Q({},c.common,c[M(a.method)]);a:for(f in c){g=M(f);for(h in d)if(M(h)===g)continue a;d[f]=c[f]}return e(d,ia(a))}(a);f.method=rb(f.method);f.paramSerializer=I(f.paramSerializer)?k.get(f.paramSerializer):f.paramSerializer;var g=
[function(a){var c=a.headers,e=ed(a.data,dd(c),t,a.transformRequest);y(e)&&m(c,function(a,b){"content-type"===M(b)&&delete c[b]});y(a.withCredentials)&&!y(b.withCredentials)&&(a.withCredentials=b.withCredentials);return q(a,e).then(d,d)},t],h=l.when(f);for(m(B,function(a){(a.request||a.requestError)&&g.unshift(a.request,a.requestError);(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;){a=g.shift();var r=g.shift(),h=h.then(a,r)}c?(h.success=function(a){Sa(a,"fn");h.then(function(b){a(b.data,
b.status,b.headers,f)});return h},h.error=function(a){Sa(a,"fn");h.then(null,function(b){a(b.data,b.status,b.headers,f)});return h}):(h.success=fd("success"),h.error=fd("error"));return h}function q(c,d){function g(b,c,d,e){function f(){k(c,b,d,e)}F&&(200<=b&&300>b?F.put(P,[b,c,cd(d),e]):F.remove(P));a?h.$applyAsync(f):(f(),h.$$phase||h.$apply())}function k(a,b,d,e){b=Math.max(b,0);(200<=b&&300>b?N.resolve:N.reject)({data:a,status:b,headers:dd(d),config:c,statusText:e})}function q(a){k(a.data,a.status,
ia(a.headers()),a.statusText)}function B(){var a=n.pendingRequests.indexOf(c);-1!==a&&n.pendingRequests.splice(a,1)}var N=l.defer(),J=N.promise,F,m,S=c.headers,P=r(c.url,c.paramSerializer(c.params));n.pendingRequests.push(c);J.then(B,B);!c.cache&&!b.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(F=D(c.cache)?c.cache:D(b.cache)?b.cache:u);F&&(m=F.get(P),x(m)?m&&C(m.then)?m.then(q,q):G(m)?k(m[1],m[0],ia(m[2]),m[3]):k(m,200,{},"OK"):F.put(P,J));y(m)&&((m=gd(c.url)?f()[c.xsrfCookieName||
b.xsrfCookieName]:t)&&(S[c.xsrfHeaderName||b.xsrfHeaderName]=m),e(c.method,P,d,g,S,c.timeout,c.withCredentials,c.responseType));return J}function r(a,b){0<b.length&&(a+=(-1==a.indexOf("?")?"?":"&")+b);return a}var u=g("$http");b.paramSerializer=I(b.paramSerializer)?k.get(b.paramSerializer):b.paramSerializer;var B=[];m(d,function(a){B.unshift(I(a)?k.get(a):k.invoke(a))});n.pendingRequests=[];(function(a){m(arguments,function(a){n[a]=function(b,c){return n(Q({},c||{},{method:a,url:b}))}})})("get","delete",
"head","jsonp");(function(a){m(arguments,function(a){n[a]=function(b,c,d){return n(Q({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");n.defaults=b;return n}]}function Rf(){return new O.XMLHttpRequest}function ff(){this.$get=["$browser","$window","$document",function(b,a,c){return Sf(b,Rf,b.defer,a.angular.callbacks,c[0])}]}function Sf(b,a,c,d,e){function f(a,b,c){var f=e.createElement("script"),n=null;f.type="text/javascript";f.src=a;f.async=!0;n=function(a){f.removeEventListener("load",
n,!1);f.removeEventListener("error",n,!1);e.body.removeChild(f);f=null;var g=-1,u="unknown";a&&("load"!==a.type||d[b].called||(a={type:"error"}),u=a.type,g="error"===a.type?404:200);c&&c(g,u)};f.addEventListener("load",n,!1);f.addEventListener("error",n,!1);e.body.appendChild(f);return n}return function(e,h,l,k,n,q,r,u){function B(){p&&p();A&&A.abort()}function K(a,d,e,f,g){H!==t&&c.cancel(H);p=A=null;a(d,e,f,g);b.$$completeOutstandingRequest(v)}b.$$incOutstandingRequestCount();h=h||b.url();if("jsonp"==
M(e)){var w="_"+(d.counter++).toString(36);d[w]=function(a){d[w].data=a;d[w].called=!0};var p=f(h.replace("JSON_CALLBACK","angular.callbacks."+w),w,function(a,b){K(k,a,d[w].data,"",b);d[w]=v})}else{var A=a();A.open(e,h,!0);m(n,function(a,b){x(a)&&A.setRequestHeader(b,a)});A.onload=function(){var a=A.statusText||"",b="response"in A?A.response:A.responseText,c=1223===A.status?204:A.status;0===c&&(c=b?200:"file"==Aa(h).protocol?404:0);K(k,c,b,A.getAllResponseHeaders(),a)};e=function(){K(k,-1,null,null,
"")};A.onerror=e;A.onabort=e;r&&(A.withCredentials=!0);if(u)try{A.responseType=u}catch(s){if("json"!==u)throw s;}A.send(l)}if(0<q)var H=c(B,q);else q&&C(q.then)&&q.then(B)}}function af(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse","$exceptionHandler","$sce",function(c,d,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(n,b).replace(q,a)}function h(f,h,n,q){function w(a){try{var b=a;a=n?e.getTrusted(n,
b):e.valueOf(b);var c;if(q&&!x(a))c=a;else if(null==a)c="";else{switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=db(a)}c=a}return c}catch(g){d(Ka.interr(f,g))}}q=!!q;for(var p,m,s=0,H=[],N=[],J=f.length,F=[],V=[];s<J;)if(-1!=(p=f.indexOf(b,s))&&-1!=(m=f.indexOf(a,p+l)))s!==p&&F.push(g(f.substring(s,p))),s=f.substring(p+l,m),H.push(s),N.push(c(s,w)),s=m+k,V.push(F.length),F.push("");else{s!==J&&F.push(g(f.substring(s)));break}n&&1<F.length&&Ka.throwNoconcat(f);if(!h||H.length){var S=
function(a){for(var b=0,c=H.length;b<c;b++){if(q&&y(a[b]))return;F[V[b]]=a[b]}return F.join("")};return Q(function(a){var b=0,c=H.length,e=Array(c);try{for(;b<c;b++)e[b]=N[b](a);return S(e)}catch(g){d(Ka.interr(f,g))}},{exp:f,expressions:H,$$watchDelegate:function(a,b){var c;return a.$watchGroup(N,function(d,e){var f=S(d);C(b)&&b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=b.length,k=a.length,n=new RegExp(b.replace(/./g,f),"g"),q=new RegExp(a.replace(/./g,f),"g");h.startSymbol=function(){return b};h.endSymbol=
function(){return a};return h}]}function bf(){this.$get=["$rootScope","$window","$q","$$q",function(b,a,c,d){function e(e,h,l,k){var n=4<arguments.length,q=n?xa.call(arguments,4):[],r=a.setInterval,u=a.clearInterval,B=0,K=x(k)&&!k,w=(K?d:c).defer(),p=w.promise;l=x(l)?l:0;p.then(null,null,n?function(){e.apply(null,q)}:e);p.$$intervalId=r(function(){w.notify(B++);0<l&&B>=l&&(w.resolve(B),u(p.$$intervalId),delete f[p.$$intervalId]);K||b.$apply()},h);f[p.$$intervalId]=w;return p}var f={};e.cancel=function(b){return b&&
b.$$intervalId in f?(f[b.$$intervalId].reject("canceled"),a.clearInterval(b.$$intervalId),delete f[b.$$intervalId],!0):!1};return e}]}function ac(b){b=b.split("/");for(var a=b.length;a--;)b[a]=nb(b[a]);return b.join("/")}function hd(b,a){var c=Aa(b);a.$$protocol=c.protocol;a.$$host=c.hostname;a.$$port=Y(c.port)||Tf[c.protocol]||null}function id(b,a){var c="/"!==b.charAt(0);c&&(b="/"+b);var d=Aa(b);a.$$path=decodeURIComponent(c&&"/"===d.pathname.charAt(0)?d.pathname.substring(1):d.pathname);a.$$search=
xc(d.search);a.$$hash=decodeURIComponent(d.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function ra(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function Ja(b){var a=b.indexOf("#");return-1==a?b:b.substr(0,a)}function Cb(b){return b.replace(/(#.+)|#$/,"$1")}function bc(b,a,c){this.$$html5=!0;c=c||"";hd(b,this);this.$$parse=function(b){var c=ra(a,b);if(!I(c))throw Db("ipthprfx",b,a);id(c,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var b=
Pb(this.$$search),c=this.$$hash?"#"+nb(this.$$hash):"";this.$$url=ac(this.$$path)+(b?"?"+b:"")+c;this.$$absUrl=a+this.$$url.substr(1)};this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;(f=ra(b,d))!==t?(g=f,g=(f=ra(c,f))!==t?a+(ra("/",f)||f):b+g):(f=ra(a,d))!==t?g=a+f:a==d+"/"&&(g=a);g&&this.$$parse(g);return!!g}}function cc(b,a,c){hd(b,this);this.$$parse=function(d){var e=ra(b,d)||ra(a,d),f;y(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",y(e)&&(b=d,this.replace())):
(f=ra(c,e),y(f)&&(f=e));id(f,this);d=this.$$path;var e=b,g=/^\/[A-Z]:(\/.*)/;0===f.indexOf(e)&&(f=f.replace(e,""));g.exec(f)||(d=(f=g.exec(d))?f[1]:d);this.$$path=d;this.$$compose()};this.$$compose=function(){var a=Pb(this.$$search),e=this.$$hash?"#"+nb(this.$$hash):"";this.$$url=ac(this.$$path)+(a?"?"+a:"")+e;this.$$absUrl=b+(this.$$url?c+this.$$url:"")};this.$$parseLinkUrl=function(a,c){return Ja(b)==Ja(a)?(this.$$parse(a),!0):!1}}function jd(b,a,c){this.$$html5=!0;cc.apply(this,arguments);this.$$parseLinkUrl=
function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;b==Ja(d)?f=d:(g=ra(a,d))?f=b+c+g:a===d+"/"&&(f=a);f&&this.$$parse(f);return!!f};this.$$compose=function(){var a=Pb(this.$$search),e=this.$$hash?"#"+nb(this.$$hash):"";this.$$url=ac(this.$$path)+(a?"?"+a:"")+e;this.$$absUrl=b+c+this.$$url}}function Eb(b){return function(){return this[b]}}function kd(b,a){return function(c){if(y(c))return this[b];this[b]=a(c);this.$$compose();return this}}function gf(){var b="",a={enabled:!1,requireBase:!0,
rewriteLinks:!0};this.hashPrefix=function(a){return x(a)?(b=a,this):b};this.html5Mode=function(b){return ab(b)?(a.enabled=b,this):D(b)?(ab(b.enabled)&&(a.enabled=b.enabled),ab(b.requireBase)&&(a.requireBase=b.requireBase),ab(b.rewriteLinks)&&(a.rewriteLinks=b.rewriteLinks),this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(c,d,e,f,g){function h(a,b,c){var e=k.url(),f=k.$$state;try{d.url(a,b,c),k.$$state=d.state()}catch(g){throw k.url(e),k.$$state=f,g;}}function l(a,
b){c.$broadcast("$locationChangeSuccess",k.absUrl(),a,k.$$state,b)}var k,n;n=d.baseHref();var q=d.url(),r;if(a.enabled){if(!n&&a.requireBase)throw Db("nobase");r=q.substring(0,q.indexOf("/",q.indexOf("//")+2))+(n||"/");n=e.history?bc:jd}else r=Ja(q),n=cc;var u=r.substr(0,Ja(r).lastIndexOf("/")+1);k=new n(r,u,"#"+b);k.$$parseLinkUrl(q,q);k.$$state=d.state();var B=/^\s*(javascript|mailto):/i;f.on("click",function(b){if(a.rewriteLinks&&!b.ctrlKey&&!b.metaKey&&!b.shiftKey&&2!=b.which&&2!=b.button){for(var e=
z(b.target);"a"!==ta(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),l=e.attr("href")||e.attr("xlink:href");D(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=Aa(h.animVal).href);B.test(h)||!h||e.attr("target")||b.isDefaultPrevented()||!k.$$parseLinkUrl(h,l)||(b.preventDefault(),k.absUrl()!=d.url()&&(c.$apply(),g.angular["ff-684208-preventDefault"]=!0))}});Cb(k.absUrl())!=Cb(q)&&d.url(k.absUrl(),!0);var K=!0;d.onUrlChange(function(a,b){y(ra(u,a))?g.location.href=a:(c.$evalAsync(function(){var d=
k.absUrl(),e=k.$$state,f;k.$$parse(a);k.$$state=b;f=c.$broadcast("$locationChangeStart",a,d,b,e).defaultPrevented;k.absUrl()===a&&(f?(k.$$parse(d),k.$$state=e,h(d,!1,e)):(K=!1,l(d,e)))}),c.$$phase||c.$digest())});c.$watch(function(){var a=Cb(d.url()),b=Cb(k.absUrl()),f=d.state(),g=k.$$replace,n=a!==b||k.$$html5&&e.history&&f!==k.$$state;if(K||n)K=!1,c.$evalAsync(function(){var b=k.absUrl(),d=c.$broadcast("$locationChangeStart",b,a,k.$$state,f).defaultPrevented;k.absUrl()===b&&(d?(k.$$parse(a),k.$$state=
f):(n&&h(b,g,f===k.$$state?null:k.$$state),l(a,f)))});k.$$replace=!1});return k}]}function hf(){var b=!0,a=this;this.debugEnabled=function(a){return x(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||v;a=!1;try{a=!!e.apply}catch(l){}return a?function(){var a=
[];m(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function Wa(b,a){if("__defineGetter__"===b||"__defineSetter__"===b||"__lookupGetter__"===b||"__lookupSetter__"===b||"__proto__"===b)throw da("isecfld",a);return b}function Ba(b,a){if(b){if(b.constructor===b)throw da("isecfn",a);if(b.window===b)throw da("isecwindow",
a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw da("isecdom",a);if(b===Object)throw da("isecobj",a);}return b}function ld(b,a){if(b){if(b.constructor===b)throw da("isecfn",a);if(b===Uf||b===Vf||b===Wf)throw da("isecff",a);}}function Xf(b,a){return"undefined"!==typeof b?b:a}function md(b,a){return"undefined"===typeof b?a:"undefined"===typeof a?b:b+a}function U(b,a){var c,d;switch(b.type){case s.Program:c=!0;m(b.body,function(b){U(b.expression,a);c=c&&b.expression.constant});b.constant=
c;break;case s.Literal:b.constant=!0;b.toWatch=[];break;case s.UnaryExpression:U(b.argument,a);b.constant=b.argument.constant;b.toWatch=b.argument.toWatch;break;case s.BinaryExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=b.left.toWatch.concat(b.right.toWatch);break;case s.LogicalExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=b.constant?[]:[b];break;case s.ConditionalExpression:U(b.test,a);U(b.alternate,a);U(b.consequent,
a);b.constant=b.test.constant&&b.alternate.constant&&b.consequent.constant;b.toWatch=b.constant?[]:[b];break;case s.Identifier:b.constant=!1;b.toWatch=[b];break;case s.MemberExpression:U(b.object,a);b.computed&&U(b.property,a);b.constant=b.object.constant&&(!b.computed||b.property.constant);b.toWatch=[b];break;case s.CallExpression:c=b.filter?!a(b.callee.name).$stateful:!1;d=[];m(b.arguments,function(b){U(b,a);c=c&&b.constant;b.constant||d.push.apply(d,b.toWatch)});b.constant=c;b.toWatch=b.filter&&
!a(b.callee.name).$stateful?d:[b];break;case s.AssignmentExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=[b];break;case s.ArrayExpression:c=!0;d=[];m(b.elements,function(b){U(b,a);c=c&&b.constant;b.constant||d.push.apply(d,b.toWatch)});b.constant=c;b.toWatch=d;break;case s.ObjectExpression:c=!0;d=[];m(b.properties,function(b){U(b.value,a);c=c&&b.value.constant;b.value.constant||d.push.apply(d,b.value.toWatch)});b.constant=c;b.toWatch=d;break;case s.ThisExpression:b.constant=
!1,b.toWatch=[]}}function nd(b){if(1==b.length){b=b[0].expression;var a=b.toWatch;return 1!==a.length?a:a[0]!==b?a:t}}function od(b){return b.type===s.Identifier||b.type===s.MemberExpression}function pd(b){if(1===b.body.length&&od(b.body[0].expression))return{type:s.AssignmentExpression,left:b.body[0].expression,right:{type:s.NGValueParameter},operator:"="}}function qd(b){return 0===b.body.length||1===b.body.length&&(b.body[0].expression.type===s.Literal||b.body[0].expression.type===s.ArrayExpression||
b.body[0].expression.type===s.ObjectExpression)}function rd(b,a){this.astBuilder=b;this.$filter=a}function sd(b,a){this.astBuilder=b;this.$filter=a}function Fb(b){return"constructor"==b}function dc(b){return C(b.valueOf)?b.valueOf():Yf.call(b)}function jf(){var b=ga(),a=ga();this.$get=["$filter",function(c){function d(a,b){return null==a||null==b?a===b:"object"===typeof a&&(a=dc(a),"object"===typeof a)?!1:a===b||a!==a&&b!==b}function e(a,b,c,e,f){var g=e.inputs,h;if(1===g.length){var l=d,g=g[0];return a.$watch(function(a){var b=
g(a);d(b,l)||(h=e(a,t,t,[b]),l=b&&dc(b));return h},b,c,f)}for(var k=[],n=[],q=0,m=g.length;q<m;q++)k[q]=d,n[q]=null;return a.$watch(function(a){for(var b=!1,c=0,f=g.length;c<f;c++){var l=g[c](a);if(b||(b=!d(l,k[c])))n[c]=l,k[c]=l&&dc(l)}b&&(h=e(a,t,t,n));return h},b,c,f)}function f(a,b,c,d){var e,f;return e=a.$watch(function(a){return d(a)},function(a,c,d){f=a;C(b)&&b.apply(this,arguments);x(a)&&d.$$postDigest(function(){x(f)&&e()})},c)}function g(a,b,c,d){function e(a){var b=!0;m(a,function(a){x(a)||
(b=!1)});return b}var f,g;return f=a.$watch(function(a){return d(a)},function(a,c,d){g=a;C(b)&&b.call(this,a,c,d);e(a)&&d.$$postDigest(function(){e(g)&&f()})},c)}function h(a,b,c,d){var e;return e=a.$watch(function(a){return d(a)},function(a,c,d){C(b)&&b.apply(this,arguments);e()},c)}function l(a,b){if(!b)return a;var c=a.$$watchDelegate,c=c!==g&&c!==f?function(c,d,e,f){e=a(c,d,e,f);return b(e,c,d)}:function(c,d,e,f){e=a(c,d,e,f);c=b(e,c,d);return x(e)?c:e};a.$$watchDelegate&&a.$$watchDelegate!==
e?c.$$watchDelegate=a.$$watchDelegate:b.$stateful||(c.$$watchDelegate=e,c.inputs=a.inputs?a.inputs:[a]);return c}var k=Fa().noUnsafeEval,n={csp:k,expensiveChecks:!1},q={csp:k,expensiveChecks:!0};return function(d,k,B){var m,w,p;switch(typeof d){case "string":p=d=d.trim();var s=B?a:b;m=s[p];m||(":"===d.charAt(0)&&":"===d.charAt(1)&&(w=!0,d=d.substring(2)),B=B?q:n,m=new ec(B),m=(new fc(m,c,B)).parse(d),m.constant?m.$$watchDelegate=h:w?m.$$watchDelegate=m.literal?g:f:m.inputs&&(m.$$watchDelegate=e),
s[p]=m);return l(m,k);case "function":return l(d,k);default:return v}}}]}function lf(){this.$get=["$rootScope","$exceptionHandler",function(b,a){return td(function(a){b.$evalAsync(a)},a)}]}function mf(){this.$get=["$browser","$exceptionHandler",function(b,a){return td(function(a){b.defer(a)},a)}]}function td(b,a){function c(a,b,c){function d(b){return function(c){e||(e=!0,b.call(a,c))}}var e=!1;return[d(b),d(c)]}function d(){this.$$state={status:0}}function e(a,b){return function(c){b.call(a,c)}}
function f(c){!c.processScheduled&&c.pending&&(c.processScheduled=!0,b(function(){var b,d,e;e=c.pending;c.processScheduled=!1;c.pending=t;for(var f=0,g=e.length;f<g;++f){d=e[f][0];b=e[f][c.status];try{C(b)?d.resolve(b(c.value)):1===c.status?d.resolve(c.value):d.reject(c.value)}catch(h){d.reject(h),a(h)}}}))}function g(){this.promise=new d;this.resolve=e(this,this.resolve);this.reject=e(this,this.reject);this.notify=e(this,this.notify)}var h=L("$q",TypeError);Q(d.prototype,{then:function(a,b,c){if(y(a)&&
y(b)&&y(c))return this;var d=new g;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,a,b,c]);0<this.$$state.status&&f(this.$$state);return d.promise},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return k(b,!0,a)},function(b){return k(b,!1,a)},b)}});Q(g.prototype,{resolve:function(a){this.promise.$$state.status||(a===this.promise?this.$$reject(h("qcycle",a)):this.$$resolve(a))},$$resolve:function(b){var d,e;e=c(this,this.$$resolve,
this.$$reject);try{if(D(b)||C(b))d=b&&b.then;C(d)?(this.promise.$$state.status=-1,d.call(b,e[0],e[1],this.notify)):(this.promise.$$state.value=b,this.promise.$$state.status=1,f(this.promise.$$state))}catch(g){e[1](g),a(g)}},reject:function(a){this.promise.$$state.status||this.$$reject(a)},$$reject:function(a){this.promise.$$state.value=a;this.promise.$$state.status=2;f(this.promise.$$state)},notify:function(c){var d=this.promise.$$state.pending;0>=this.promise.$$state.status&&d&&d.length&&b(function(){for(var b,
e,f=0,g=d.length;f<g;f++){e=d[f][0];b=d[f][3];try{e.notify(C(b)?b(c):c)}catch(h){a(h)}}})}});var l=function(a,b){var c=new g;b?c.resolve(a):c.reject(a);return c.promise},k=function(a,b,c){var d=null;try{C(c)&&(d=c())}catch(e){return l(e,!1)}return d&&C(d.then)?d.then(function(){return l(a,b)},function(a){return l(a,!1)}):l(a,b)},n=function(a,b,c,d){var e=new g;e.resolve(a);return e.promise.then(b,c,d)},q=function u(a){if(!C(a))throw h("norslvr",a);if(!(this instanceof u))return new u(a);var b=new g;
a(function(a){b.resolve(a)},function(a){b.reject(a)});return b.promise};q.defer=function(){return new g};q.reject=function(a){var b=new g;b.reject(a);return b.promise};q.when=n;q.resolve=n;q.all=function(a){var b=new g,c=0,d=G(a)?[]:{};m(a,function(a,e){c++;n(a).then(function(a){d.hasOwnProperty(e)||(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});0===c&&b.resolve(d);return b.promise};return q}function vf(){this.$get=["$window","$timeout",function(b,a){function c(){for(var a=
0;a<n.length;a++){var b=n[a];b&&(n[a]=null,b())}k=n.length=0}function d(a){var b=n.length;k++;n.push(a);0===b&&(l=h(c));return function(){0<=b&&(b=n[b]=null,0===--k&&l&&(l(),l=null,n.length=0))}}var e=b.requestAnimationFrame||b.webkitRequestAnimationFrame,f=b.cancelAnimationFrame||b.webkitCancelAnimationFrame||b.webkitCancelRequestAnimationFrame,g=!!e,h=g?function(a){var b=e(a);return function(){f(b)}}:function(b){var c=a(b,16.66,!1);return function(){a.cancel(c)}};d.supported=g;var l,k=0,n=[];return d}]}
function kf(){function b(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++mb;this.$$ChildScope=null}b.prototype=a;return b}var a=10,c=L("$rootScope"),d=null,e=null;this.digestTtl=function(b){arguments.length&&(a=b);return a};this.$get=["$injector","$exceptionHandler","$parse","$browser",function(f,g,h,l){function k(a){a.currentScope.$$destroyed=!0}function n(){this.$id=++mb;this.$$phase=
this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function q(a){if(p.$$phase)throw c("inprog",p.$$phase);p.$$phase=a}function r(a,b){do a.$$watchersCount+=b;while(a=a.$parent)}function u(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function s(){}function K(){for(;H.length;)try{H.shift()()}catch(a){g(a)}e=
null}function w(){null===e&&(e=l.defer(function(){p.$apply(K)}))}n.prototype={constructor:n,$new:function(a,c){var d;c=c||this;a?(d=new n,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=b(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(a||c!=this)&&d.$on("$destroy",k);return d},$watch:function(a,b,c,e){var f=h(a);if(f.$$watchDelegate)return f.$$watchDelegate(this,b,c,f,
a);var g=this,l=g.$$watchers,k={fn:b,last:s,get:f,exp:e||a,eq:!!c};d=null;C(b)||(k.fn=v);l||(l=g.$$watchers=[]);l.unshift(k);r(this,1);return function(){0<=bb(l,k)&&r(g,-1);d=null}},$watchGroup:function(a,b){function c(){h=!1;l?(l=!1,b(e,e,g)):b(e,d,g)}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,l=!0;if(!a.length){var k=!0;g.$evalAsync(function(){k&&b(e,e,g)});return function(){k=!1}}if(1===a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});m(a,function(a,
b){var l=g.$watch(a,function(a,f){e[b]=a;d[b]=f;h||(h=!0,g.$evalAsync(c))});f.push(l)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!y(e)){if(D(e))if(Da(e))for(f!==q&&(f=q,u=f.length=0,k++),a=e.length,u!==a&&(k++,f.length=u=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(k++,f[b]=g);else{f!==r&&(f=r={},u=0,k++);a=0;for(b in e)e.hasOwnProperty(b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(k++,f[b]=g)):(u++,f[b]=g,
k++));if(u>a)for(b in k++,f)e.hasOwnProperty(b)||(u--,delete f[b])}else f!==e&&(f=e,k++);return k}}c.$stateful=!0;var d=this,e,f,g,l=1<b.length,k=0,n=h(a,c),q=[],r={},p=!0,u=0;return this.$watch(n,function(){p?(p=!1,b(e,e,d)):b(e,g,d);if(l)if(D(e))if(Da(e)){g=Array(e.length);for(var a=0;a<e.length;a++)g[a]=e[a]}else for(a in g={},e)Na.call(e,a)&&(g[a]=e[a]);else g=e})},$digest:function(){var b,f,h,k,n,r,u=a,m,w=[],E,H;q("$digest");l.$$checkUrlChange();this===p&&null!==e&&(l.defer.cancel(e),K());d=
null;do{r=!1;for(m=this;t.length;){try{H=t.shift(),H.scope.$eval(H.expression,H.locals)}catch(v){g(v)}d=null}a:do{if(k=m.$$watchers)for(n=k.length;n--;)try{if(b=k[n])if((f=b.get(m))!==(h=b.last)&&!(b.eq?ka(f,h):"number"===typeof f&&"number"===typeof h&&isNaN(f)&&isNaN(h)))r=!0,d=b,b.last=b.eq?fa(f,null):f,b.fn(f,h===s?f:h,m),5>u&&(E=4-u,w[E]||(w[E]=[]),w[E].push({msg:C(b.exp)?"fn: "+(b.exp.name||b.exp.toString()):b.exp,newVal:f,oldVal:h}));else if(b===d){r=!1;break a}}catch(y){g(y)}if(!(k=m.$$watchersCount&&
m.$$childHead||m!==this&&m.$$nextSibling))for(;m!==this&&!(k=m.$$nextSibling);)m=m.$parent}while(m=k);if((r||t.length)&&!u--)throw p.$$phase=null,c("infdig",a,w);}while(r||t.length);for(p.$$phase=null;x.length;)try{x.shift()()}catch(z){g(z)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===p&&l.$$applicationDestroyed();r(this,-this.$$watchersCount);for(var b in this.$$listenerCount)u(this,this.$$listenerCount[b],b);a&&a.$$childHead==
this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail==this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=v;this.$on=this.$watch=this.$watchGroup=function(){return v};this.$$listeners={};this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=this.$$watchers=
null}},$eval:function(a,b){return h(a)(this,b)},$evalAsync:function(a,b){p.$$phase||t.length||l.defer(function(){t.length&&p.$digest()});t.push({scope:this,expression:a,locals:b})},$$postDigest:function(a){x.push(a)},$apply:function(a){try{q("$apply");try{return this.$eval(a)}finally{p.$$phase=null}}catch(b){g(b)}finally{try{p.$digest()}catch(c){throw g(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&H.push(b);w()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=
c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,u(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,f=!1,h={name:a,targetScope:e,stopPropagation:function(){f=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},l=cb([h],arguments,1),k,n;do{d=e.$$listeners[a]||c;h.currentScope=e;k=0;for(n=d.length;k<n;k++)if(d[k])try{d[k].apply(null,l)}catch(q){g(q)}else d.splice(k,
1),k--,n--;if(f)return h.currentScope=null,h;e=e.$parent}while(e);h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var f=cb([e],arguments,1),h,l;c=d;){e.currentScope=c;d=c.$$listeners[a]||[];h=0;for(l=d.length;h<l;h++)if(d[h])try{d[h].apply(null,f)}catch(k){g(k)}else d.splice(h,1),h--,l--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&
c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=null;return e}};var p=new n,t=p.$$asyncQueue=[],x=p.$$postDigestQueue=[],H=p.$$applyAsyncQueue=[];return p}]}function ge(){var b=/^\s*(https?|ftp|mailto|tel|file):/,a=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(a){return x(a)?(b=a,this):b};this.imgSrcSanitizationWhitelist=function(b){return x(b)?(a=b,this):a};this.$get=function(){return function(c,d){var e=d?a:b,f;f=Aa(c).href;
return""===f||f.match(e)?c:"unsafe:"+f}}}function Zf(b){if("self"===b)return b;if(I(b)){if(-1<b.indexOf("***"))throw Ca("iwcard",b);b=ud(b).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*");return new RegExp("^"+b+"$")}if(Oa(b))return new RegExp("^"+b.source+"$");throw Ca("imatcher");}function vd(b){var a=[];x(b)&&m(b,function(b){a.push(Zf(b))});return a}function of(){this.SCE_CONTEXTS=oa;var b=["self"],a=[];this.resourceUrlWhitelist=function(a){arguments.length&&(b=vd(a));return b};this.resourceUrlBlacklist=
function(b){arguments.length&&(a=vd(b));return a};this.$get=["$injector",function(c){function d(a,b){return"self"===a?gd(b):!!a.exec(b.href)}function e(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var f=function(a){throw Ca("unsafe");};c.has("$sanitize")&&(f=c.get("$sanitize"));var g=e(),h={};h[oa.HTML]=
e(g);h[oa.CSS]=e(g);h[oa.URL]=e(g);h[oa.JS]=e(g);h[oa.RESOURCE_URL]=e(h[oa.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw Ca("icontext",a,b);if(null===b||b===t||""===b)return b;if("string"!==typeof b)throw Ca("itype",a);return new c(b)},getTrusted:function(c,e){if(null===e||e===t||""===e)return e;var g=h.hasOwnProperty(c)?h[c]:null;if(g&&e instanceof g)return e.$$unwrapTrustedValue();if(c===oa.RESOURCE_URL){var g=Aa(e.toString()),q,r,u=!1;q=0;for(r=b.length;q<r;q++)if(d(b[q],
g)){u=!0;break}if(u)for(q=0,r=a.length;q<r;q++)if(d(a[q],g)){u=!1;break}if(u)return e;throw Ca("insecurl",e.toString());}if(c===oa.HTML)return f(e);throw Ca("unsafe");},valueOf:function(a){return a instanceof g?a.$$unwrapTrustedValue():a}}}]}function nf(){var b=!0;this.enabled=function(a){arguments.length&&(b=!!a);return b};this.$get=["$parse","$sceDelegate",function(a,c){if(b&&8>Va)throw Ca("iequirks");var d=ia(oa);d.isEnabled=function(){return b};d.trustAs=c.trustAs;d.getTrusted=c.getTrusted;d.valueOf=
c.valueOf;b||(d.trustAs=d.getTrusted=function(a,b){return b},d.valueOf=Za);d.parseAs=function(b,c){var e=a(c);return e.literal&&e.constant?e:a(c,function(a){return d.getTrusted(b,a)})};var e=d.parseAs,f=d.getTrusted,g=d.trustAs;m(oa,function(a,b){var c=M(b);d[fb("parse_as_"+c)]=function(b){return e(a,b)};d[fb("get_trusted_"+c)]=function(b){return f(a,b)};d[fb("trust_as_"+c)]=function(b){return g(a,b)}});return d}]}function pf(){this.$get=["$window","$document",function(b,a){var c={},d=Y((/android (\d+)/.exec(M((b.navigator||
{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||{}).userAgent),f=a[0]||{},g,h=/^(Moz|webkit|ms)(?=[A-Z])/,l=f.body&&f.body.style,k=!1,n=!1;if(l){for(var q in l)if(k=h.exec(q)){g=k[0];g=g.substr(0,1).toUpperCase()+g.substr(1);break}g||(g="WebkitOpacity"in l&&"webkit");k=!!("transition"in l||g+"Transition"in l);n=!!("animation"in l||g+"Animation"in l);!d||k&&n||(k=I(l.webkitTransition),n=I(l.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hasEvent:function(a){if("input"===
a&&11>=Va)return!1;if(y(c[a])){var b=f.createElement("div");c[a]="on"+a in b}return c[a]},csp:Fa(),vendorPrefix:g,transitions:k,animations:n,android:d}}]}function rf(){this.$get=["$templateCache","$http","$q","$sce",function(b,a,c,d){function e(f,g){e.totalPendingRequests++;I(f)&&b.get(f)||(f=d.getTrustedResourceUrl(f));var h=a.defaults&&a.defaults.transformResponse;G(h)?h=h.filter(function(a){return a!==Zb}):h===Zb&&(h=null);return a.get(f,{cache:b,transformResponse:h})["finally"](function(){e.totalPendingRequests--}).then(function(a){b.put(f,
a.data);return a.data},function(a){if(!g)throw ea("tpload",f,a.status,a.statusText);return c.reject(a)})}e.totalPendingRequests=0;return e}]}function sf(){this.$get=["$rootScope","$browser","$location",function(b,a,c){return{findBindings:function(a,b,c){a=a.getElementsByClassName("ng-binding");var g=[];m(a,function(a){var d=aa.element(a).data("$binding");d&&m(d,function(d){c?(new RegExp("(^|\\s)"+ud(b)+"(\\s|\\||$)")).test(d)&&g.push(a):-1!=d.indexOf(b)&&g.push(a)})});return g},findModels:function(a,
b,c){for(var g=["ng-","data-ng-","ng\\:"],h=0;h<g.length;++h){var l=a.querySelectorAll("["+g[h]+"model"+(c?"=":"*=")+'"'+b+'"]');if(l.length)return l}},getLocation:function(){return c.url()},setLocation:function(a){a!==c.url()&&(c.url(a),b.$digest())},whenStable:function(b){a.notifyWhenNoOutstandingRequests(b)}}}]}function tf(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(b,a,c,d,e){function f(f,l,k){C(f)||(k=l,l=f,f=v);var n=xa.call(arguments,3),q=x(k)&&!k,r=(q?d:c).defer(),
u=r.promise,m;m=a.defer(function(){try{r.resolve(f.apply(null,n))}catch(a){r.reject(a),e(a)}finally{delete g[u.$$timeoutId]}q||b.$apply()},l);u.$$timeoutId=m;g[m]=r;return u}var g={};f.cancel=function(b){return b&&b.$$timeoutId in g?(g[b.$$timeoutId].reject("canceled"),delete g[b.$$timeoutId],a.defer.cancel(b.$$timeoutId)):!1};return f}]}function Aa(b){Va&&(Z.setAttribute("href",b),b=Z.href);Z.setAttribute("href",b);return{href:Z.href,protocol:Z.protocol?Z.protocol.replace(/:$/,""):"",host:Z.host,
search:Z.search?Z.search.replace(/^\?/,""):"",hash:Z.hash?Z.hash.replace(/^#/,""):"",hostname:Z.hostname,port:Z.port,pathname:"/"===Z.pathname.charAt(0)?Z.pathname:"/"+Z.pathname}}function gd(b){b=I(b)?Aa(b):b;return b.protocol===wd.protocol&&b.host===wd.host}function uf(){this.$get=qa(O)}function xd(b){function a(a){try{return decodeURIComponent(a)}catch(b){return a}}var c=b[0]||{},d={},e="";return function(){var b,g,h,l,k;b=c.cookie||"";if(b!==e)for(e=b,b=e.split("; "),d={},h=0;h<b.length;h++)g=
b[h],l=g.indexOf("="),0<l&&(k=a(g.substring(0,l)),d[k]===t&&(d[k]=a(g.substring(l+1))));return d}}function yf(){this.$get=xd}function Jc(b){function a(c,d){if(D(c)){var e={};m(c,function(b,c){e[c]=a(c,b)});return e}return b.factory(c+"Filter",d)}this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];a("currency",yd);a("date",zd);a("filter",$f);a("json",ag);a("limitTo",bg);a("lowercase",cg);a("number",Ad);a("orderBy",Bd);a("uppercase",dg)}function $f(){return function(b,
a,c){if(!Da(b)){if(null==b)return b;throw L("filter")("notarray",b);}var d;switch(gc(a)){case "function":break;case "boolean":case "null":case "number":case "string":d=!0;case "object":a=eg(a,c,d);break;default:return b}return Array.prototype.filter.call(b,a)}}function eg(b,a,c){var d=D(b)&&"$"in b;!0===a?a=ka:C(a)||(a=function(a,b){if(y(a))return!1;if(null===a||null===b)return a===b;if(D(b)||D(a)&&!pc(a))return!1;a=M(""+a);b=M(""+b);return-1!==a.indexOf(b)});return function(e){return d&&!D(e)?La(e,
b.$,a,!1):La(e,b,a,c)}}function La(b,a,c,d,e){var f=gc(b),g=gc(a);if("string"===g&&"!"===a.charAt(0))return!La(b,a.substring(1),c,d);if(G(b))return b.some(function(b){return La(b,a,c,d)});switch(f){case "object":var h;if(d){for(h in b)if("$"!==h.charAt(0)&&La(b[h],a,c,!0))return!0;return e?!1:La(b,a,c,!1)}if("object"===g){for(h in a)if(e=a[h],!C(e)&&!y(e)&&(f="$"===h,!La(f?b:b[h],e,c,f,f)))return!1;return!0}return c(b,a);case "function":return!1;default:return c(b,a)}}function gc(b){return null===
b?"null":typeof b}function yd(b){var a=b.NUMBER_FORMATS;return function(b,d,e){y(d)&&(d=a.CURRENCY_SYM);y(e)&&(e=a.PATTERNS[1].maxFrac);return null==b?b:Cd(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,e).replace(/\u00A4/g,d)}}function Ad(b){var a=b.NUMBER_FORMATS;return function(b,d){return null==b?b:Cd(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function Cd(b,a,c,d,e){if(D(b))return"";var f=0>b;b=Math.abs(b);var g=Infinity===b;if(!g&&!isFinite(b))return"";var h=b+"",l="",k=!1,n=[];g&&(l="\u221e");
if(!g&&-1!==h.indexOf("e")){var q=h.match(/([\d\.]+)e(-?)(\d+)/);q&&"-"==q[2]&&q[3]>e+1?b=0:(l=h,k=!0)}if(g||k)0<e&&1>b&&(l=b.toFixed(e),b=parseFloat(l));else{g=(h.split(Dd)[1]||"").length;y(e)&&(e=Math.min(Math.max(a.minFrac,g),a.maxFrac));b=+(Math.round(+(b.toString()+"e"+e)).toString()+"e"+-e);var g=(""+b).split(Dd),h=g[0],g=g[1]||"",q=0,r=a.lgSize,u=a.gSize;if(h.length>=r+u)for(q=h.length-r,k=0;k<q;k++)0===(q-k)%u&&0!==k&&(l+=c),l+=h.charAt(k);for(k=q;k<h.length;k++)0===(h.length-k)%r&&0!==k&&
(l+=c),l+=h.charAt(k);for(;g.length<e;)g+="0";e&&"0"!==e&&(l+=d+g.substr(0,e))}0===b&&(f=!1);n.push(f?a.negPre:a.posPre,l,f?a.negSuf:a.posSuf);return n.join("")}function Gb(b,a,c){var d="";0>b&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function $(b,a,c,d){c=c||0;return function(e){e=e["get"+b]();if(0<c||e>-c)e+=c;0===e&&-12==c&&(e=12);return Gb(e,a,d)}}function Hb(b,a){return function(c,d){var e=c["get"+b](),f=rb(a?"SHORT"+b:b);return d[f][e]}}function Ed(b){var a=
(new Date(b,0,1)).getDay();return new Date(b,0,(4>=a?5:12)-a)}function Fd(b){return function(a){var c=Ed(a.getFullYear());a=+new Date(a.getFullYear(),a.getMonth(),a.getDate()+(4-a.getDay()))-+c;a=1+Math.round(a/6048E5);return Gb(a,b)}}function hc(b,a){return 0>=b.getFullYear()?a.ERAS[0]:a.ERAS[1]}function zd(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,l=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=Y(b[9]+b[10]),g=Y(b[9]+b[11]));h.call(a,Y(b[1]),
Y(b[2])-1,Y(b[3]));f=Y(b[4]||0)-f;g=Y(b[5]||0)-g;h=Y(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));l.call(a,f,g,h,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e,f){var g="",h=[],l,k;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;I(c)&&(c=fg.test(c)?Y(c):a(c));X(c)&&(c=new Date(c));if(!ca(c)||!isFinite(c.getTime()))return c;for(;e;)(k=gg.exec(e))?(h=cb(h,k,1),e=h.pop()):(h.push(e),e=null);var n=c.getTimezoneOffset();
f&&(n=vc(f,c.getTimezoneOffset()),c=Ob(c,f,!0));m(h,function(a){l=hg[a];g+=l?l(c,b.DATETIME_FORMATS,n):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function ag(){return function(b,a){y(a)&&(a=2);return db(b,a)}}function bg(){return function(b,a,c){a=Infinity===Math.abs(Number(a))?Number(a):Y(a);if(isNaN(a))return b;X(b)&&(b=b.toString());if(!G(b)&&!I(b))return b;c=!c||isNaN(c)?0:Y(c);c=0>c&&c>=-b.length?b.length+c:c;return 0<=a?b.slice(c,c+a):0===c?b.slice(a,b.length):b.slice(Math.max(0,
c+a),c)}}function Bd(b){function a(a,c){c=c?-1:1;return a.map(function(a){var d=1,h=Za;if(C(a))h=a;else if(I(a)){if("+"==a.charAt(0)||"-"==a.charAt(0))d="-"==a.charAt(0)?-1:1,a=a.substring(1);if(""!==a&&(h=b(a),h.constant))var l=h(),h=function(a){return a[l]}}return{get:h,descending:d*c}})}function c(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}return function(b,e,f){if(!Da(b))return b;G(e)||(e=[e]);0===e.length&&(e=["+"]);var g=a(e,f);g.push({get:function(){return{}},
descending:f?-1:1});b=Array.prototype.map.call(b,function(a,b){return{value:a,predicateValues:g.map(function(d){var e=d.get(a);d=typeof e;if(null===e)d="string",e="null";else if("string"===d)e=e.toLowerCase();else if("object"===d)a:{if("function"===typeof e.valueOf&&(e=e.valueOf(),c(e)))break a;if(pc(e)&&(e=e.toString(),c(e)))break a;e=b}return{value:e,type:d}})}});b.sort(function(a,b){for(var c=0,d=0,e=g.length;d<e;++d){var c=a.predicateValues[d],f=b.predicateValues[d],u=0;c.type===f.type?c.value!==
f.value&&(u=c.value<f.value?-1:1):u=c.type<f.type?-1:1;if(c=u*g[d].descending)break}return c});return b=b.map(function(a){return a.value})}}function Ma(b){C(b)&&(b={link:b});b.restrict=b.restrict||"AC";return qa(b)}function Gd(b,a,c,d,e){var f=this,g=[],h=f.$$parentForm=b.parent().controller("form")||Ib;f.$error={};f.$$success={};f.$pending=t;f.$name=e(a.name||a.ngForm||"")(c);f.$dirty=!1;f.$pristine=!0;f.$valid=!0;f.$invalid=!1;f.$submitted=!1;h.$addControl(f);f.$rollbackViewValue=function(){m(g,
function(a){a.$rollbackViewValue()})};f.$commitViewValue=function(){m(g,function(a){a.$commitViewValue()})};f.$addControl=function(a){Ta(a.$name,"input");g.push(a);a.$name&&(f[a.$name]=a)};f.$$renameControl=function(a,b){var c=a.$name;f[c]===a&&delete f[c];f[b]=a;a.$name=b};f.$removeControl=function(a){a.$name&&f[a.$name]===a&&delete f[a.$name];m(f.$pending,function(b,c){f.$setValidity(c,null,a)});m(f.$error,function(b,c){f.$setValidity(c,null,a)});m(f.$$success,function(b,c){f.$setValidity(c,null,
a)});bb(g,a)};Hd({ctrl:this,$element:b,set:function(a,b,c){var d=a[b];d?-1===d.indexOf(c)&&d.push(c):a[b]=[c]},unset:function(a,b,c){var d=a[b];d&&(bb(d,c),0===d.length&&delete a[b])},parentForm:h,$animate:d});f.$setDirty=function(){d.removeClass(b,Xa);d.addClass(b,Jb);f.$dirty=!0;f.$pristine=!1;h.$setDirty()};f.$setPristine=function(){d.setClass(b,Xa,Jb+" ng-submitted");f.$dirty=!1;f.$pristine=!0;f.$submitted=!1;m(g,function(a){a.$setPristine()})};f.$setUntouched=function(){m(g,function(a){a.$setUntouched()})};
f.$setSubmitted=function(){d.addClass(b,"ng-submitted");f.$submitted=!0;h.$setSubmitted()}}function ic(b){b.$formatters.push(function(a){return b.$isEmpty(a)?a:a.toString()})}function ib(b,a,c,d,e,f){var g=M(a[0].type);if(!e.android){var h=!1;a.on("compositionstart",function(a){h=!0});a.on("compositionend",function(){h=!1;l()})}var l=function(b){k&&(f.defer.cancel(k),k=null);if(!h){var e=a.val();b=b&&b.type;"password"===g||c.ngTrim&&"false"===c.ngTrim||(e=T(e));(d.$viewValue!==e||""===e&&d.$$hasNativeValidators)&&
d.$setViewValue(e,b)}};if(e.hasEvent("input"))a.on("input",l);else{var k,n=function(a,b,c){k||(k=f.defer(function(){k=null;b&&b.value===c||l(a)}))};a.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&19>b||37<=b&&40>=b||n(a,this,this.value)});if(e.hasEvent("paste"))a.on("paste cut",n)}a.on("change",l);d.$render=function(){var b=d.$isEmpty(d.$viewValue)?"":d.$viewValue;a.val()!==b&&a.val(b)}}function Kb(b,a){return function(c,d){var e,f;if(ca(c))return c;if(I(c)){'"'==c.charAt(0)&&'"'==c.charAt(c.length-
1)&&(c=c.substring(1,c.length-1));if(ig.test(c))return new Date(c);b.lastIndex=0;if(e=b.exec(c))return e.shift(),f=d?{yyyy:d.getFullYear(),MM:d.getMonth()+1,dd:d.getDate(),HH:d.getHours(),mm:d.getMinutes(),ss:d.getSeconds(),sss:d.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},m(e,function(b,c){c<a.length&&(f[a[c]]=+b)}),new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0)}return NaN}}function jb(b,a,c,d){return function(e,f,g,h,l,k,n){function q(a){return a&&!(a.getTime&&
a.getTime()!==a.getTime())}function r(a){return x(a)?ca(a)?a:c(a):t}Id(e,f,g,h);ib(e,f,g,h,l,k);var u=h&&h.$options&&h.$options.timezone,m;h.$$parserName=b;h.$parsers.push(function(b){return h.$isEmpty(b)?null:a.test(b)?(b=c(b,m),u&&(b=Ob(b,u)),b):t});h.$formatters.push(function(a){if(a&&!ca(a))throw kb("datefmt",a);if(q(a))return(m=a)&&u&&(m=Ob(m,u,!0)),n("date")(a,d,u);m=null;return""});if(x(g.min)||g.ngMin){var s;h.$validators.min=function(a){return!q(a)||y(s)||c(a)>=s};g.$observe("min",function(a){s=
r(a);h.$validate()})}if(x(g.max)||g.ngMax){var w;h.$validators.max=function(a){return!q(a)||y(w)||c(a)<=w};g.$observe("max",function(a){w=r(a);h.$validate()})}}}function Id(b,a,c,d){(d.$$hasNativeValidators=D(a[0].validity))&&d.$parsers.push(function(b){var c=a.prop("validity")||{};return c.badInput&&!c.typeMismatch?t:b})}function Jd(b,a,c,d,e){if(x(d)){b=b(d);if(!b.constant)throw kb("constexpr",c,d);return b(a)}return e}function jc(b,a){b="ngClass"+b;return["$animate",function(c){function d(a,b){var c=
[],d=0;a:for(;d<a.length;d++){for(var e=a[d],n=0;n<b.length;n++)if(e==b[n])continue a;c.push(e)}return c}function e(a){var b=[];return G(a)?(m(a,function(a){b=b.concat(e(a))}),b):I(a)?a.split(" "):D(a)?(m(a,function(a,c){a&&(b=b.concat(c.split(" ")))}),b):a}return{restrict:"AC",link:function(f,g,h){function l(a,b){var c=g.data("$classCounts")||ga(),d=[];m(a,function(a){if(0<b||c[a])c[a]=(c[a]||0)+b,c[a]===+(0<b)&&d.push(a)});g.data("$classCounts",c);return d.join(" ")}function k(b){if(!0===a||f.$index%
2===a){var k=e(b||[]);if(!n){var m=l(k,1);h.$addClass(m)}else if(!ka(b,n)){var s=e(n),m=d(k,s),k=d(s,k),m=l(m,1),k=l(k,-1);m&&m.length&&c.addClass(g,m);k&&k.length&&c.removeClass(g,k)}}n=ia(b)}var n;f.$watch(h[b],k,!0);h.$observe("class",function(a){k(f.$eval(h[b]))});"ngClass"!==b&&f.$watch("$index",function(c,d){var g=c&1;if(g!==(d&1)){var k=e(f.$eval(h[b]));g===a?(g=l(k,1),h.$addClass(g)):(g=l(k,-1),h.$removeClass(g))}})}}}]}function Hd(b){function a(a,b){b&&!f[a]?(k.addClass(e,a),f[a]=!0):!b&&
f[a]&&(k.removeClass(e,a),f[a]=!1)}function c(b,c){b=b?"-"+zc(b,"-"):"";a(lb+b,!0===c);a(Kd+b,!1===c)}var d=b.ctrl,e=b.$element,f={},g=b.set,h=b.unset,l=b.parentForm,k=b.$animate;f[Kd]=!(f[lb]=e.hasClass(lb));d.$setValidity=function(b,e,f){e===t?(d.$pending||(d.$pending={}),g(d.$pending,b,f)):(d.$pending&&h(d.$pending,b,f),Ld(d.$pending)&&(d.$pending=t));ab(e)?e?(h(d.$error,b,f),g(d.$$success,b,f)):(g(d.$error,b,f),h(d.$$success,b,f)):(h(d.$error,b,f),h(d.$$success,b,f));d.$pending?(a(Md,!0),d.$valid=
d.$invalid=t,c("",null)):(a(Md,!1),d.$valid=Ld(d.$error),d.$invalid=!d.$valid,c("",d.$valid));e=d.$pending&&d.$pending[b]?t:d.$error[b]?!1:d.$$success[b]?!0:null;c(b,e);l.$setValidity(b,e,d)}}function Ld(b){if(b)for(var a in b)if(b.hasOwnProperty(a))return!1;return!0}var jg=/^\/(.+)\/([a-z]*)$/,M=function(b){return I(b)?b.toLowerCase():b},Na=Object.prototype.hasOwnProperty,rb=function(b){return I(b)?b.toUpperCase():b},Va,z,la,xa=[].slice,Mf=[].splice,kg=[].push,sa=Object.prototype.toString,qc=Object.getPrototypeOf,
Ea=L("ng"),aa=O.angular||(O.angular={}),Rb,mb=0;Va=W.documentMode;v.$inject=[];Za.$inject=[];var G=Array.isArray,sc=/^\[object (Uint8(Clamped)?)|(Uint16)|(Uint32)|(Int8)|(Int16)|(Int32)|(Float(32)|(64))Array\]$/,T=function(b){return I(b)?b.trim():b},ud=function(b){return b.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Fa=function(){if(!x(Fa.rules)){var b=W.querySelector("[ng-csp]")||W.querySelector("[data-ng-csp]");if(b){var a=b.getAttribute("ng-csp")||b.getAttribute("data-ng-csp");
Fa.rules={noUnsafeEval:!a||-1!==a.indexOf("no-unsafe-eval"),noInlineStyle:!a||-1!==a.indexOf("no-inline-style")}}else{b=Fa;try{new Function(""),a=!1}catch(c){a=!0}b.rules={noUnsafeEval:a,noInlineStyle:!1}}}return Fa.rules},ob=function(){if(x(ob.name_))return ob.name_;var b,a,c=Qa.length,d,e;for(a=0;a<c;++a)if(d=Qa[a],b=W.querySelector("["+d.replace(":","\\:")+"jq]")){e=b.getAttribute(d+"jq");break}return ob.name_=e},Qa=["ng-","data-ng-","ng:","x-ng-"],be=/[A-Z]/g,Ac=!1,Qb,pa=1,Pa=3,fe={full:"1.4.4",
major:1,minor:4,dot:4,codeName:"pylon-requirement"};R.expando="ng339";var gb=R.cache={},Ef=1;R._data=function(b){return this.cache[b[this.expando]]||{}};var zf=/([\:\-\_]+(.))/g,Af=/^moz([A-Z])/,lg={mouseleave:"mouseout",mouseenter:"mouseover"},Tb=L("jqLite"),Df=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Sb=/<|&#?\w+;/,Bf=/<([\w:]+)/,Cf=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,na={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>",
"</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};na.optgroup=na.option;na.tbody=na.tfoot=na.colgroup=na.caption=na.thead;na.th=na.td;var Ra=R.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===W.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),R(O).on("load",a))},toString:function(){var b=[];m(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=
b?z(this[b]):z(this[this.length+b])},length:0,push:kg,sort:[].sort,splice:[].splice},Ab={};m("multiple selected checked disabled readOnly required open".split(" "),function(b){Ab[M(b)]=b});var Rc={};m("input select option textarea button form details".split(" "),function(b){Rc[b]=!0});var Sc={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};m({data:Vb,removeData:ub,hasData:function(b){for(var a in gb[b.ng339])return!0;return!1}},function(b,a){R[a]=b});m({data:Vb,
inheritedData:zb,scope:function(b){return z.data(b,"$scope")||zb(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return z.data(b,"$isolateScope")||z.data(b,"$isolateScopeNoTemplate")},controller:Oc,injector:function(b){return zb(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:wb,css:function(b,a,c){a=fb(a);if(x(c))b.style[a]=c;else return b.style[a]},attr:function(b,a,c){var d=b.nodeType;if(d!==Pa&&2!==d&&8!==d)if(d=M(a),Ab[d])if(x(c))c?(b[a]=!0,b.setAttribute(a,
d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||v).specified?d:t;else if(x(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?t:b},prop:function(b,a,c){if(x(c))b[a]=c;else return b[a]},text:function(){function b(a,b){if(y(b)){var d=a.nodeType;return d===pa||d===Pa?a.textContent:""}a.textContent=b}b.$dv="";return b}(),val:function(b,a){if(y(a)){if(b.multiple&&"select"===ta(b)){var c=[];m(b.options,function(a){a.selected&&c.push(a.value||
a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(y(a))return b.innerHTML;tb(b,!0);b.innerHTML=a},empty:Pc},function(b,a){R.prototype[a]=function(a,d){var e,f,g=this.length;if(b!==Pc&&(2==b.length&&b!==wb&&b!==Oc?a:d)===t){if(D(a)){for(e=0;e<g;e++)if(b===Vb)b(this[e],a);else for(f in a)b(this[e],f,a[f]);return this}e=b.$dv;g=e===t?Math.min(g,1):g;for(f=0;f<g;f++){var h=b(this[f],a,d);e=e?e+h:h}return e}for(e=0;e<g;e++)b(this[e],a,d);return this}});m({removeData:ub,
on:function a(c,d,e,f){if(x(f))throw Tb("onargs");if(Kc(c)){var g=vb(c,!0);f=g.events;var h=g.handle;h||(h=g.handle=Hf(c,f));for(var g=0<=d.indexOf(" ")?d.split(" "):[d],l=g.length;l--;){d=g[l];var k=f[d];k||(f[d]=[],"mouseenter"===d||"mouseleave"===d?a(c,lg[d],function(a){var c=a.relatedTarget;c&&(c===this||this.contains(c))||h(a,d)}):"$destroy"!==d&&c.addEventListener(d,h,!1),k=f[d]);k.push(e)}}},off:Nc,one:function(a,c,d){a=z(a);a.on(c,function f(){a.off(c,d);a.off(c,f)});a.on(c,d)},replaceWith:function(a,
c){var d,e=a.parentNode;tb(a);m(new R(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];m(a.childNodes,function(a){a.nodeType===pa&&c.push(a)});return c},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,c){var d=a.nodeType;if(d===pa||11===d){c=new R(c);for(var d=0,e=c.length;d<e;d++)a.appendChild(c[d])}},prepend:function(a,c){if(a.nodeType===pa){var d=a.firstChild;m(new R(c),function(c){a.insertBefore(c,d)})}},
wrap:function(a,c){c=z(c).eq(0).clone()[0];var d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:Wb,detach:function(a){Wb(a,!0)},after:function(a,c){var d=a,e=a.parentNode;c=new R(c);for(var f=0,g=c.length;f<g;f++){var h=c[f];e.insertBefore(h,d.nextSibling);d=h}},addClass:yb,removeClass:xb,toggleClass:function(a,c,d){c&&m(c.split(" "),function(c){var f=d;y(f)&&(f=!wb(a,c));(f?yb:xb)(a,c)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},
find:function(a,c){return a.getElementsByTagName?a.getElementsByTagName(c):[]},clone:Ub,triggerHandler:function(a,c,d){var e,f,g=c.type||c,h=vb(a);if(h=(h=h&&h.events)&&h[g])e={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:v,type:g,target:a},c.type&&(e=Q(e,
c)),c=ia(h),f=d?[e].concat(d):[e],m(c,function(c){e.isImmediatePropagationStopped()||c.apply(a,f)})}},function(a,c){R.prototype[c]=function(c,e,f){for(var g,h=0,l=this.length;h<l;h++)y(g)?(g=a(this[h],c,e,f),x(g)&&(g=z(g))):Mc(g,a(this[h],c,e,f));return x(g)?g:this};R.prototype.bind=R.prototype.on;R.prototype.unbind=R.prototype.off});Ua.prototype={put:function(a,c){this[Ga(a,this.nextUid)]=c},get:function(a){return this[Ga(a,this.nextUid)]},remove:function(a){var c=this[a=Ga(a,this.nextUid)];delete this[a];
return c}};var xf=[function(){this.$get=[function(){return Ua}]}],Uc=/^[^\(]*\(\s*([^\)]*)\)/m,mg=/,/,ng=/^\s*(_?)(\S+?)\1\s*$/,Tc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ha=L("$injector");eb.$$annotate=function(a,c,d){var e;if("function"===typeof a){if(!(e=a.$inject)){e=[];if(a.length){if(c)throw I(d)&&d||(d=a.name||If(a)),Ha("strictdi",d);c=a.toString().replace(Tc,"");c=c.match(Uc);m(c[1].split(mg),function(a){a.replace(ng,function(a,c,d){e.push(d)})})}a.$inject=e}}else G(a)?(c=a.length-1,Sa(a[c],"fn"),
e=a.slice(0,c)):Sa(a,"fn",!0);return e};var Nd=L("$animate"),Ue=function(){this.$get=["$q","$$rAF",function(a,c){function d(){}d.all=v;d.chain=v;d.prototype={end:v,cancel:v,resume:v,pause:v,complete:v,then:function(d,f){return a(function(a){c(function(){a()})}).then(d,f)}};return d}]},Te=function(){var a=new Ua,c=[];this.$get=["$$AnimateRunner","$rootScope",function(d,e){function f(d,f,l){var k=a.get(d);k||(a.put(d,k={}),c.push(d));d=function(a,c){var d=!1;a&&(a=I(a)?a.split(" "):G(a)?a:[],m(a,function(a){a&&
(d=!0,k[a]=c)}));return d};f=d(f,!0);l=d(l,!1);!f&&!l||1<c.length||e.$$postDigest(function(){m(c,function(c){var d=a.get(c);if(d){var e=Jf(c.attr("class")),f="",g="";m(d,function(a,c){a!==!!e[c]&&(a?f+=(f.length?" ":"")+c:g+=(g.length?" ":"")+c)});m(c,function(a){f&&yb(a,f);g&&xb(a,g)});a.remove(c)}});c.length=0})}return{enabled:v,on:v,off:v,pin:v,push:function(a,c,e,k){k&&k();e=e||{};e.from&&a.css(e.from);e.to&&a.css(e.to);(e.addClass||e.removeClass)&&f(a,e.addClass,e.removeClass);return new d}}}]},
Re=["$provide",function(a){var c=this;this.$$registeredAnimations=Object.create(null);this.register=function(d,e){if(d&&"."!==d.charAt(0))throw Nd("notcsel",d);var f=d+"-animation";c.$$registeredAnimations[d.substr(1)]=f;a.factory(f,e)};this.classNameFilter=function(a){if(1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null)&&/(\s+|\/)ng-animate(\s+|\/)/.test(this.$$classNameFilter.toString()))throw Nd("nongcls","ng-animate");return this.$$classNameFilter};this.$get=["$$animateQueue",
function(a){function c(a,d,e){if(e){var l;a:{for(l=0;l<e.length;l++){var k=e[l];if(1===k.nodeType){l=k;break a}}l=void 0}!l||l.parentNode||l.previousElementSibling||(e=null)}e?e.after(a):d.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.end&&a.end()},enter:function(f,g,h,l){g=g&&z(g);h=h&&z(h);g=g||h.parent();c(f,g,h);return a.push(f,"enter",Ia(l))},move:function(f,g,h,l){g=g&&z(g);h=h&&z(h);g=g||h.parent();c(f,g,h);return a.push(f,"move",Ia(l))},leave:function(c,
e){return a.push(c,"leave",Ia(e),function(){c.remove()})},addClass:function(c,e,h){h=Ia(h);h.addClass=hb(h.addclass,e);return a.push(c,"addClass",h)},removeClass:function(c,e,h){h=Ia(h);h.removeClass=hb(h.removeClass,e);return a.push(c,"removeClass",h)},setClass:function(c,e,h,l){l=Ia(l);l.addClass=hb(l.addClass,e);l.removeClass=hb(l.removeClass,h);return a.push(c,"setClass",l)},animate:function(c,e,h,l,k){k=Ia(k);k.from=k.from?Q(k.from,e):e;k.to=k.to?Q(k.to,h):h;k.tempClasses=hb(k.tempClasses,l||
"ng-inline-animate");return a.push(c,"animate",k)}}}]}],Se=function(){this.$get=["$$rAF","$q",function(a,c){var d=function(){};d.prototype={done:function(a){this.defer&&this.defer[!0===a?"reject":"resolve"]()},end:function(){this.done()},cancel:function(){this.done(!0)},getPromise:function(){this.defer||(this.defer=c.defer());return this.defer.promise},then:function(a,c){return this.getPromise().then(a,c)},"catch":function(a){return this.getPromise().catch(a)},"finally":function(a){return this.getPromise().finally(a)}};
return function(c,f){function g(){a(function(){f.addClass&&(c.addClass(f.addClass),f.addClass=null);f.removeClass&&(c.removeClass(f.removeClass),f.removeClass=null);f.to&&(c.css(f.to),f.to=null);h||l.done();h=!0});return l}f.from&&(c.css(f.from),f.from=null);var h,l=new d;return{start:g,end:g}}}]},ea=L("$compile");Cc.$inject=["$provide","$$sanitizeUriProvider"];var Xc=/^((?:x|data)[\:\-_])/i,Nf=L("$controller"),Vc=/^(\S+)(\s+as\s+(\w+))?$/,$e=function(){this.$get=["$document",function(a){return function(c){c?
!c.nodeType&&c instanceof z&&(c=c[0]):c=a[0].body;return c.offsetWidth+1}}]},bd="application/json",$b={"Content-Type":bd+";charset=utf-8"},Pf=/^\[|^\{(?!\{)/,Qf={"[":/]$/,"{":/}$/},Of=/^\)\]\}',?\n/,og=L("$http"),fd=function(a){return function(){throw og("legacy",a);}},Ka=aa.$interpolateMinErr=L("$interpolate");Ka.throwNoconcat=function(a){throw Ka("noconcat",a);};Ka.interr=function(a,c){return Ka("interr",a,c.toString())};var pg=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,Tf={http:80,https:443,ftp:21},Db=
L("$location"),qg={$$html5:!1,$$replace:!1,absUrl:Eb("$$absUrl"),url:function(a){if(y(a))return this.$$url;var c=pg.exec(a);(c[1]||""===a)&&this.path(decodeURIComponent(c[1]));(c[2]||c[1]||""===a)&&this.search(c[3]||"");this.hash(c[5]||"");return this},protocol:Eb("$$protocol"),host:Eb("$$host"),port:Eb("$$port"),path:kd("$$path",function(a){a=null!==a?a.toString():"";return"/"==a.charAt(0)?a:"/"+a}),search:function(a,c){switch(arguments.length){case 0:return this.$$search;case 1:if(I(a)||X(a))a=
a.toString(),this.$$search=xc(a);else if(D(a))a=fa(a,{}),m(a,function(c,e){null==c&&delete a[e]}),this.$$search=a;else throw Db("isrcharg");break;default:y(c)||null===c?delete this.$$search[a]:this.$$search[a]=c}this.$$compose();return this},hash:kd("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};m([jd,cc,bc],function(a){a.prototype=Object.create(qg);a.prototype.state=function(c){if(!arguments.length)return this.$$state;if(a!==bc||!this.$$html5)throw Db("nostate");
this.$$state=y(c)?null:c;return this}});var da=L("$parse"),Uf=Function.prototype.call,Vf=Function.prototype.apply,Wf=Function.prototype.bind,Lb=ga();m("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Lb[a]=!0});var rg={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},ec=function(a){this.options=a};ec.prototype={constructor:ec,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);
else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(a))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;else{var c=a+this.peek(),d=c+this.peek(2),e=Lb[c],f=Lb[d];Lb[a]||e||f?(a=f?d:e?c:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},
is:function(a,c){return-1!==c.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=x(c)?"s "+c+"-"+
this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw da("lexerr",a,c,this.text);},readNumber:function(){for(var a="",c=this.index;this.index<this.text.length;){var d=M(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var e=this.peek();if("e"==d&&this.isExpOperator(e))a+=d;else if(this.isExpOperator(d)&&e&&this.isNumber(e)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||e&&this.isNumber(e)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:c,
text:a,constant:!0,value:Number(a)})},readIdent:function(){for(var a=this.index;this.index<this.text.length;){var c=this.text.charAt(this.index);if(!this.isIdent(c)&&!this.isNumber(c))break;this.index++}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var c=this.index;this.index++;for(var d="",e=a,f=!1;this.index<this.text.length;){var g=this.text.charAt(this.index),e=e+g;if(f)"u"===g?(f=this.text.substring(this.index+1,this.index+5),f.match(/[\da-f]{4}/i)||
this.throwError("Invalid unicode escape [\\u"+f+"]"),this.index+=4,d+=String.fromCharCode(parseInt(f,16))):d+=rg[g]||g,f=!1;else if("\\"===g)f=!0;else{if(g===a){this.index++;this.tokens.push({index:c,text:e,constant:!0,value:d});return}d+=g}this.index++}this.throwError("Unterminated quote",c)}};var s=function(a,c){this.lexer=a;this.options=c};s.Program="Program";s.ExpressionStatement="ExpressionStatement";s.AssignmentExpression="AssignmentExpression";s.ConditionalExpression="ConditionalExpression";
s.LogicalExpression="LogicalExpression";s.BinaryExpression="BinaryExpression";s.UnaryExpression="UnaryExpression";s.CallExpression="CallExpression";s.MemberExpression="MemberExpression";s.Identifier="Identifier";s.Literal="Literal";s.ArrayExpression="ArrayExpression";s.Property="Property";s.ObjectExpression="ObjectExpression";s.ThisExpression="ThisExpression";s.NGValueParameter="NGValueParameter";s.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);a=this.program();0!==this.tokens.length&&
this.throwError("is an unexpected token",this.tokens[0]);return a},program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:s.Program,body:a}},expressionStatement:function(){return{type:s.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},assignment:function(){var a=
this.ternary();this.expect("=")&&(a={type:s.AssignmentExpression,left:a,right:this.assignment(),operator:"="});return a},ternary:function(){var a=this.logicalOR(),c,d;return this.expect("?")&&(c=this.expression(),this.consume(":"))?(d=this.expression(),{type:s.ConditionalExpression,test:a,alternate:c,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:s.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=
this.equality();this.expect("&&");)a={type:s.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),c;c=this.expect("==","!=","===","!==");)a={type:s.BinaryExpression,operator:c.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),c;c=this.expect("<",">","<=",">=");)a={type:s.BinaryExpression,operator:c.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),
c;c=this.expect("+","-");)a={type:s.BinaryExpression,operator:c.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a={type:s.BinaryExpression,operator:c.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:s.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):
this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.constants.hasOwnProperty(this.peek().text)?a=fa(this.constants[this.consume().text]):this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var c;c=this.expect("(","[",".");)"("===c.text?(a={type:s.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===c.text?(a={type:s.MemberExpression,object:a,property:this.expression(),
computed:!0},this.consume("]")):"."===c.text?a={type:s.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var c={type:s.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return c},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.expression());while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||
this.throwError("is not a valid identifier",a);return{type:s.Identifier,name:a.text}},constant:function(){return{type:s.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:s.ArrayExpression,elements:a}},object:function(){var a=[],c;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;c={type:s.Property,kind:"init"};this.peek().constant?
c.key=this.constant():this.peek().identifier?c.key=this.identifier():this.throwError("invalid key",this.peek());this.consume(":");c.value=this.expression();a.push(c)}while(this.expect(","))}this.consume("}");return{type:s.ObjectExpression,properties:a}},throwError:function(a,c){throw da("syntax",c.text,a,c.index+1,this.text,this.text.substring(c.index));},consume:function(a){if(0===this.tokens.length)throw da("ueoe",this.text);var c=this.expect(a);c||this.throwError("is unexpected, expecting ["+a+
"]",this.peek());return c},peekToken:function(){if(0===this.tokens.length)throw da("ueoe",this.text);return this.tokens[0]},peek:function(a,c,d,e){return this.peekAhead(0,a,c,d,e)},peekAhead:function(a,c,d,e,f){if(this.tokens.length>a){a=this.tokens[a];var g=a.text;if(g===c||g===d||g===e||g===f||!(c||d||e||f))return a}return!1},expect:function(a,c,d,e){return(a=this.peek(a,c,d,e))?(this.tokens.shift(),a):!1},constants:{"true":{type:s.Literal,value:!0},"false":{type:s.Literal,value:!1},"null":{type:s.Literal,
value:null},undefined:{type:s.Literal,value:t},"this":{type:s.ThisExpression}}};rd.prototype={compile:function(a,c){var d=this,e=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:c,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};U(e,d.$filter);var f="",g;this.stage="assign";if(g=pd(e))this.state.computing="assign",f=this.nextId(),this.recurse(g,f),f="fn.assign="+this.generateFunction("assign","s,v,l");g=nd(e.body);d.stage="inputs";m(g,function(a,c){var e=
"fn"+c;d.state[e]={vars:[],body:[],own:{}};d.state.computing=e;var f=d.nextId();d.recurse(a,f);d.return_(f);d.state.inputs.push(e);a.watchId=c});this.state.computing="fn";this.stage="main";this.recurse(e);f='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+f+this.watchFns()+"return fn;";f=(new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","ifDefined","plus","text",f))(this.$filter,Wa,Ba,ld,Xf,md,a);this.state=
this.stage=t;f.literal=qd(e);f.constant=e.constant;return f},USE:"use",STRICT:"strict",watchFns:function(){var a=[],c=this.state.inputs,d=this;m(c,function(c){a.push("var "+c+"="+d.generateFunction(c,"s"))});c.length&&a.push("fn.inputs=["+c.join(",")+"];");return a.join("")},generateFunction:function(a,c){return"function("+c+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],c=this;m(this.state.filters,function(d,e){a.push(d+"=$filter("+c.escape(e)+")")});return a.length?
"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,c,d,e,f,g){var h,l,k=this,n,q;e=e||v;if(!g&&x(a.watchId))c=c||this.nextId(),this.if_("i",this.lazyAssign(c,this.computedMember("i",a.watchId)),this.lazyRecurse(a,c,d,e,f,!0));else switch(a.type){case s.Program:m(a.body,function(c,d){k.recurse(c.expression,t,t,function(a){l=a});d!==a.body.length-1?k.current().body.push(l,
";"):k.return_(l)});break;case s.Literal:q=this.escape(a.value);this.assign(c,q);e(q);break;case s.UnaryExpression:this.recurse(a.argument,t,t,function(a){l=a});q=a.operator+"("+this.ifDefined(l,0)+")";this.assign(c,q);e(q);break;case s.BinaryExpression:this.recurse(a.left,t,t,function(a){h=a});this.recurse(a.right,t,t,function(a){l=a});q="+"===a.operator?this.plus(h,l):"-"===a.operator?this.ifDefined(h,0)+a.operator+this.ifDefined(l,0):"("+h+")"+a.operator+"("+l+")";this.assign(c,q);e(q);break;case s.LogicalExpression:c=
c||this.nextId();k.recurse(a.left,c);k.if_("&&"===a.operator?c:k.not(c),k.lazyRecurse(a.right,c));e(c);break;case s.ConditionalExpression:c=c||this.nextId();k.recurse(a.test,c);k.if_(c,k.lazyRecurse(a.alternate,c),k.lazyRecurse(a.consequent,c));e(c);break;case s.Identifier:c=c||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name);Wa(a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),
function(){k.if_("inputs"===k.stage||"s",function(){f&&1!==f&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(c,k.nonComputedMember("s",a.name))})},c&&k.lazyAssign(c,k.nonComputedMember("l",a.name)));(k.state.expensiveChecks||Fb(a.name))&&k.addEnsureSafeObject(c);e(c);break;case s.MemberExpression:h=d&&(d.context=this.nextId())||this.nextId();c=c||this.nextId();k.recurse(a.object,h,t,function(){k.if_(k.notNull(h),function(){if(a.computed)l=
k.nextId(),k.recurse(a.property,l),k.addEnsureSafeMemberName(l),f&&1!==f&&k.if_(k.not(k.computedMember(h,l)),k.lazyAssign(k.computedMember(h,l),"{}")),q=k.ensureSafeObject(k.computedMember(h,l)),k.assign(c,q),d&&(d.computed=!0,d.name=l);else{Wa(a.property.name);f&&1!==f&&k.if_(k.not(k.nonComputedMember(h,a.property.name)),k.lazyAssign(k.nonComputedMember(h,a.property.name),"{}"));q=k.nonComputedMember(h,a.property.name);if(k.state.expensiveChecks||Fb(a.property.name))q=k.ensureSafeObject(q);k.assign(c,
q);d&&(d.computed=!1,d.name=a.property.name)}},function(){k.assign(c,"undefined")});e(c)},!!f);break;case s.CallExpression:c=c||this.nextId();a.filter?(l=k.filter(a.callee.name),n=[],m(a.arguments,function(a){var c=k.nextId();k.recurse(a,c);n.push(c)}),q=l+"("+n.join(",")+")",k.assign(c,q),e(c)):(l=k.nextId(),h={},n=[],k.recurse(a.callee,l,h,function(){k.if_(k.notNull(l),function(){k.addEnsureSafeFunction(l);m(a.arguments,function(a){k.recurse(a,k.nextId(),t,function(a){n.push(k.ensureSafeObject(a))})});
h.name?(k.state.expensiveChecks||k.addEnsureSafeObject(h.context),q=k.member(h.context,h.name,h.computed)+"("+n.join(",")+")"):q=l+"("+n.join(",")+")";q=k.ensureSafeObject(q);k.assign(c,q)},function(){k.assign(c,"undefined")});e(c)}));break;case s.AssignmentExpression:l=this.nextId();h={};if(!od(a.left))throw da("lval");this.recurse(a.left,t,h,function(){k.if_(k.notNull(h.context),function(){k.recurse(a.right,l);k.addEnsureSafeObject(k.member(h.context,h.name,h.computed));q=k.member(h.context,h.name,
h.computed)+a.operator+l;k.assign(c,q);e(c||q)})},1);break;case s.ArrayExpression:n=[];m(a.elements,function(a){k.recurse(a,k.nextId(),t,function(a){n.push(a)})});q="["+n.join(",")+"]";this.assign(c,q);e(q);break;case s.ObjectExpression:n=[];m(a.properties,function(a){k.recurse(a.value,k.nextId(),t,function(c){n.push(k.escape(a.key.type===s.Identifier?a.key.name:""+a.key.value)+":"+c)})});q="{"+n.join(",")+"}";this.assign(c,q);e(q);break;case s.ThisExpression:this.assign(c,"s");e("s");break;case s.NGValueParameter:this.assign(c,
"v"),e("v")}},getHasOwnProperty:function(a,c){var d=a+"."+c,e=this.current().own;e.hasOwnProperty(d)||(e[d]=this.nextId(!1,a+"&&("+this.escape(c)+" in "+a+")"));return e[d]},assign:function(a,c){if(a)return this.current().body.push(a,"=",c,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,c){return"ifDefined("+a+","+this.escape(c)+")"},plus:function(a,c){return"plus("+a+","+c+")"},return_:function(a){this.current().body.push("return ",
a,";")},if_:function(a,c,d){if(!0===a)c();else{var e=this.current().body;e.push("if(",a,"){");c();e.push("}");d&&(e.push("else{"),d(),e.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,c){return a+"."+c},computedMember:function(a,c){return a+"["+c+"]"},member:function(a,c,d){return d?this.computedMember(a,c):this.nonComputedMember(a,c)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a),
";")},addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},lazyRecurse:function(a,c,d,e,f,g){var h=this;return function(){h.recurse(a,c,d,e,f,g)}},lazyAssign:function(a,c){var d=this;return function(){d.assign(a,c)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,
stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(I(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(X(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw da("esc");},nextId:function(a,c){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(c?"="+c:""));return d},current:function(){return this.state[this.state.computing]}};
sd.prototype={compile:function(a,c){var d=this,e=this.astBuilder.ast(a);this.expression=a;this.expensiveChecks=c;U(e,d.$filter);var f,g;if(f=pd(e))g=this.recurse(f);f=nd(e.body);var h;f&&(h=[],m(f,function(a,c){var e=d.recurse(a);a.input=e;h.push(e);a.watchId=c}));var l=[];m(e.body,function(a){l.push(d.recurse(a.expression))});f=0===e.body.length?function(){}:1===e.body.length?l[0]:function(a,c){var d;m(l,function(e){d=e(a,c)});return d};g&&(f.assign=function(a,c,d){return g(a,d,c)});h&&(f.inputs=
h);f.literal=qd(e);f.constant=e.constant;return f},recurse:function(a,c,d){var e,f,g=this,h;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case s.Literal:return this.value(a.value,c);case s.UnaryExpression:return f=this.recurse(a.argument),this["unary"+a.operator](f,c);case s.BinaryExpression:return e=this.recurse(a.left),f=this.recurse(a.right),this["binary"+a.operator](e,f,c);case s.LogicalExpression:return e=this.recurse(a.left),f=this.recurse(a.right),this["binary"+a.operator](e,
f,c);case s.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),c);case s.Identifier:return Wa(a.name,g.expression),g.identifier(a.name,g.expensiveChecks||Fb(a.name),c,d,g.expression);case s.MemberExpression:return e=this.recurse(a.object,!1,!!d),a.computed||(Wa(a.property.name,g.expression),f=a.property.name),a.computed&&(f=this.recurse(a.property)),a.computed?this.computedMember(e,f,c,d,g.expression):this.nonComputedMember(e,f,
g.expensiveChecks,c,d,g.expression);case s.CallExpression:return h=[],m(a.arguments,function(a){h.push(g.recurse(a))}),a.filter&&(f=this.$filter(a.callee.name)),a.filter||(f=this.recurse(a.callee,!0)),a.filter?function(a,d,e,g){for(var r=[],m=0;m<h.length;++m)r.push(h[m](a,d,e,g));a=f.apply(t,r,g);return c?{context:t,name:t,value:a}:a}:function(a,d,e,q){var r=f(a,d,e,q),m;if(null!=r.value){Ba(r.context,g.expression);ld(r.value,g.expression);m=[];for(var s=0;s<h.length;++s)m.push(Ba(h[s](a,d,e,q),
g.expression));m=Ba(r.value.apply(r.context,m),g.expression)}return c?{value:m}:m};case s.AssignmentExpression:return e=this.recurse(a.left,!0,1),f=this.recurse(a.right),function(a,d,h,q){var m=e(a,d,h,q);a=f(a,d,h,q);Ba(m.value,g.expression);m.context[m.name]=a;return c?{value:a}:a};case s.ArrayExpression:return h=[],m(a.elements,function(a){h.push(g.recurse(a))}),function(a,d,e,f){for(var g=[],m=0;m<h.length;++m)g.push(h[m](a,d,e,f));return c?{value:g}:g};case s.ObjectExpression:return h=[],m(a.properties,
function(a){h.push({key:a.key.type===s.Identifier?a.key.name:""+a.key.value,value:g.recurse(a.value)})}),function(a,d,e,f){for(var g={},m=0;m<h.length;++m)g[h[m].key]=h[m].value(a,d,e,f);return c?{value:g}:g};case s.ThisExpression:return function(a){return c?{value:a}:a};case s.NGValueParameter:return function(a,d,e,f){return c?{value:e}:e}}},"unary+":function(a,c){return function(d,e,f,g){d=a(d,e,f,g);d=x(d)?+d:0;return c?{value:d}:d}},"unary-":function(a,c){return function(d,e,f,g){d=a(d,e,f,g);
d=x(d)?-d:0;return c?{value:d}:d}},"unary!":function(a,c){return function(d,e,f,g){d=!a(d,e,f,g);return c?{value:d}:d}},"binary+":function(a,c,d){return function(e,f,g,h){var l=a(e,f,g,h);e=c(e,f,g,h);l=md(l,e);return d?{value:l}:l}},"binary-":function(a,c,d){return function(e,f,g,h){var l=a(e,f,g,h);e=c(e,f,g,h);l=(x(l)?l:0)-(x(e)?e:0);return d?{value:l}:l}},"binary*":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)*c(e,f,g,h);return d?{value:e}:e}},"binary/":function(a,c,d){return function(e,
f,g,h){e=a(e,f,g,h)/c(e,f,g,h);return d?{value:e}:e}},"binary%":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)%c(e,f,g,h);return d?{value:e}:e}},"binary===":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)===c(e,f,g,h);return d?{value:e}:e}},"binary!==":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)!==c(e,f,g,h);return d?{value:e}:e}},"binary==":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)==c(e,f,g,h);return d?{value:e}:e}},"binary!=":function(a,c,d){return function(e,
f,g,h){e=a(e,f,g,h)!=c(e,f,g,h);return d?{value:e}:e}},"binary<":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)<c(e,f,g,h);return d?{value:e}:e}},"binary>":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)>c(e,f,g,h);return d?{value:e}:e}},"binary<=":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)<=c(e,f,g,h);return d?{value:e}:e}},"binary>=":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)>=c(e,f,g,h);return d?{value:e}:e}},"binary&&":function(a,c,d){return function(e,f,g,h){e=
a(e,f,g,h)&&c(e,f,g,h);return d?{value:e}:e}},"binary||":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)||c(e,f,g,h);return d?{value:e}:e}},"ternary?:":function(a,c,d,e){return function(f,g,h,l){f=a(f,g,h,l)?c(f,g,h,l):d(f,g,h,l);return e?{value:f}:f}},value:function(a,c){return function(){return c?{context:t,name:t,value:a}:a}},identifier:function(a,c,d,e,f){return function(g,h,l,k){g=h&&a in h?h:g;e&&1!==e&&g&&!g[a]&&(g[a]={});h=g?g[a]:t;c&&Ba(h,f);return d?{context:g,name:a,value:h}:h}},
computedMember:function(a,c,d,e,f){return function(g,h,l,k){var n=a(g,h,l,k),q,m;null!=n&&(q=c(g,h,l,k),Wa(q,f),e&&1!==e&&n&&!n[q]&&(n[q]={}),m=n[q],Ba(m,f));return d?{context:n,name:q,value:m}:m}},nonComputedMember:function(a,c,d,e,f,g){return function(h,l,k,n){h=a(h,l,k,n);f&&1!==f&&h&&!h[c]&&(h[c]={});l=null!=h?h[c]:t;(d||Fb(c))&&Ba(l,g);return e?{context:h,name:c,value:l}:l}},inputs:function(a,c){return function(d,e,f,g){return g?g[c]:a(d,e,f)}}};var fc=function(a,c,d){this.lexer=a;this.$filter=
c;this.options=d;this.ast=new s(this.lexer);this.astCompiler=d.csp?new sd(this.ast,c):new rd(this.ast,c)};fc.prototype={constructor:fc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};ga();ga();var Yf=Object.prototype.valueOf,Ca=L("$sce"),oa={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},ea=L("$compile"),Z=W.createElement("a"),wd=Aa(O.location.href);xd.$inject=["$document"];Jc.$inject=["$provide"];yd.$inject=["$locale"];Ad.$inject=["$locale"];
var Dd=".",hg={yyyy:$("FullYear",4),yy:$("FullYear",2,0,!0),y:$("FullYear",1),MMMM:Hb("Month"),MMM:Hb("Month",!0),MM:$("Month",2,1),M:$("Month",1,1),dd:$("Date",2),d:$("Date",1),HH:$("Hours",2),H:$("Hours",1),hh:$("Hours",2,-12),h:$("Hours",1,-12),mm:$("Minutes",2),m:$("Minutes",1),ss:$("Seconds",2),s:$("Seconds",1),sss:$("Milliseconds",3),EEEE:Hb("Day"),EEE:Hb("Day",!0),a:function(a,c){return 12>a.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a,c,d){a=-1*d;return a=(0<=a?"+":"")+(Gb(Math[0<a?"floor":
"ceil"](a/60),2)+Gb(Math.abs(a%60),2))},ww:Fd(2),w:Fd(1),G:hc,GG:hc,GGG:hc,GGGG:function(a,c){return 0>=a.getFullYear()?c.ERANAMES[0]:c.ERANAMES[1]}},gg=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,fg=/^\-?\d+$/;zd.$inject=["$locale"];var cg=qa(M),dg=qa(rb);Bd.$inject=["$parse"];var he=qa({restrict:"E",compile:function(a,c){if(!c.href&&!c.xlinkHref)return function(a,c){if("a"===c[0].nodeName.toLowerCase()){var f="[object SVGAnimatedString]"===sa.call(c.prop("href"))?
"xlink:href":"href";c.on("click",function(a){c.attr(f)||a.preventDefault()})}}}}),sb={};m(Ab,function(a,c){function d(a,d,f){a.$watch(f[e],function(a){f.$set(c,!!a)})}if("multiple"!=a){var e=va("ng-"+c),f=d;"checked"===a&&(f=function(a,c,f){f.ngModel!==f[e]&&d(a,c,f)});sb[e]=function(){return{restrict:"A",priority:100,link:f}}}});m(Sc,function(a,c){sb[c]=function(){return{priority:100,link:function(a,e,f){if("ngPattern"===c&&"/"==f.ngPattern.charAt(0)&&(e=f.ngPattern.match(jg))){f.$set("ngPattern",
new RegExp(e[1],e[2]));return}a.$watch(f[c],function(a){f.$set(c,a)})}}}});m(["src","srcset","href"],function(a){var c=va("ng-"+a);sb[c]=function(){return{priority:99,link:function(d,e,f){var g=a,h=a;"href"===a&&"[object SVGAnimatedString]"===sa.call(e.prop("href"))&&(h="xlinkHref",f.$attr[h]="xlink:href",g=null);f.$observe(c,function(c){c?(f.$set(h,c),Va&&g&&e.prop(g,f[h])):"href"===a&&f.$set(h,null)})}}}});var Ib={$addControl:v,$$renameControl:function(a,c){a.$name=c},$removeControl:v,$setValidity:v,
$setDirty:v,$setPristine:v,$setSubmitted:v};Gd.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Od=function(a){return["$timeout","$parse",function(c,d){function e(a){return""===a?d('this[""]').assign:d(a).assign||v}return{name:"form",restrict:a?"EAC":"E",controller:Gd,compile:function(d,g){d.addClass(Xa).addClass(lb);var h=g.name?"name":a&&g.ngForm?"ngForm":!1;return{pre:function(a,d,f,g){if(!("action"in f)){var m=function(c){a.$apply(function(){g.$commitViewValue();g.$setSubmitted()});
c.preventDefault()};d[0].addEventListener("submit",m,!1);d.on("$destroy",function(){c(function(){d[0].removeEventListener("submit",m,!1)},0,!1)})}var s=g.$$parentForm,B=h?e(g.$name):v;h&&(B(a,g),f.$observe(h,function(c){g.$name!==c&&(B(a,t),s.$$renameControl(g,c),B=e(g.$name),B(a,g))}));d.on("$destroy",function(){s.$removeControl(g);B(a,t);Q(g,Ib)})}}}}}]},ie=Od(),ve=Od(!0),ig=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,sg=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,
tg=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,ug=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Pd=/^(\d{4})-(\d{2})-(\d{2})$/,Qd=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,kc=/^(\d{4})-W(\d\d)$/,Rd=/^(\d{4})-(\d\d)$/,Sd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Td={text:function(a,c,d,e,f,g){ib(a,c,d,e,f,g);ic(e)},date:jb("date",Pd,Kb(Pd,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":jb("datetimelocal",Qd,Kb(Qd,
"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:jb("time",Sd,Kb(Sd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:jb("week",kc,function(a,c){if(ca(a))return a;if(I(a)){kc.lastIndex=0;var d=kc.exec(a);if(d){var e=+d[1],f=+d[2],g=d=0,h=0,l=0,k=Ed(e),f=7*(f-1);c&&(d=c.getHours(),g=c.getMinutes(),h=c.getSeconds(),l=c.getMilliseconds());return new Date(e,0,k.getDate()+f,d,g,h,l)}}return NaN},"yyyy-Www"),month:jb("month",Rd,Kb(Rd,["yyyy","MM"]),"yyyy-MM"),number:function(a,c,d,e,f,g){Id(a,
c,d,e);ib(a,c,d,e,f,g);e.$$parserName="number";e.$parsers.push(function(a){return e.$isEmpty(a)?null:ug.test(a)?parseFloat(a):t});e.$formatters.push(function(a){if(!e.$isEmpty(a)){if(!X(a))throw kb("numfmt",a);a=a.toString()}return a});if(x(d.min)||d.ngMin){var h;e.$validators.min=function(a){return e.$isEmpty(a)||y(h)||a>=h};d.$observe("min",function(a){x(a)&&!X(a)&&(a=parseFloat(a,10));h=X(a)&&!isNaN(a)?a:t;e.$validate()})}if(x(d.max)||d.ngMax){var l;e.$validators.max=function(a){return e.$isEmpty(a)||
y(l)||a<=l};d.$observe("max",function(a){x(a)&&!X(a)&&(a=parseFloat(a,10));l=X(a)&&!isNaN(a)?a:t;e.$validate()})}},url:function(a,c,d,e,f,g){ib(a,c,d,e,f,g);ic(e);e.$$parserName="url";e.$validators.url=function(a,c){var d=a||c;return e.$isEmpty(d)||sg.test(d)}},email:function(a,c,d,e,f,g){ib(a,c,d,e,f,g);ic(e);e.$$parserName="email";e.$validators.email=function(a,c){var d=a||c;return e.$isEmpty(d)||tg.test(d)}},radio:function(a,c,d,e){y(d.name)&&c.attr("name",++mb);c.on("click",function(a){c[0].checked&&
e.$setViewValue(d.value,a&&a.type)});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e,f,g,h,l){var k=Jd(l,a,"ngTrueValue",d.ngTrueValue,!0),n=Jd(l,a,"ngFalseValue",d.ngFalseValue,!1);c.on("click",function(a){e.$setViewValue(c[0].checked,a&&a.type)});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return!1===a};e.$formatters.push(function(a){return ka(a,k)});e.$parsers.push(function(a){return a?k:n})},hidden:v,
button:v,submit:v,reset:v,file:v},Dc=["$browser","$sniffer","$filter","$parse",function(a,c,d,e){return{restrict:"E",require:["?ngModel"],link:{pre:function(f,g,h,l){l[0]&&(Td[M(h.type)]||Td.text)(f,g,h,l[0],c,a,d,e)}}}}],vg=/^(true|false|\d+)$/,Ne=function(){return{restrict:"A",priority:100,compile:function(a,c){return vg.test(c.ngValue)?function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value",a)})}}}},ne=["$compile",function(a){return{restrict:"AC",
compile:function(c){a.$$addBindingClass(c);return function(c,e,f){a.$$addBindingInfo(e,f.ngBind);e=e[0];c.$watch(f.ngBind,function(a){e.textContent=a===t?"":a})}}}}],pe=["$interpolate","$compile",function(a,c){return{compile:function(d){c.$$addBindingClass(d);return function(d,f,g){d=a(f.attr(g.$attr.ngBindTemplate));c.$$addBindingInfo(f,d.expressions);f=f[0];g.$observe("ngBindTemplate",function(a){f.textContent=a===t?"":a})}}}}],oe=["$sce","$parse","$compile",function(a,c,d){return{restrict:"A",
compile:function(e,f){var g=c(f.ngBindHtml),h=c(f.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(e);return function(c,e,f){d.$$addBindingInfo(e,f.ngBindHtml);c.$watch(h,function(){e.html(a.getTrustedHtml(g(c))||"")})}}}}],Me=qa({restrict:"A",require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),qe=jc("",!0),se=jc("Odd",0),re=jc("Even",1),te=Ma({compile:function(a,c){c.$set("ngCloak",t);a.removeClass("ng-cloak")}}),ue=[function(){return{restrict:"A",
scope:!0,controller:"@",priority:500}}],Ic={},wg={blur:!0,focus:!0};m("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var c=va("ng-"+a);Ic[c]=["$parse","$rootScope",function(d,e){return{restrict:"A",compile:function(f,g){var h=d(g[c],null,!0);return function(c,d){d.on(a,function(d){var f=function(){h(c,{$event:d})};wg[a]&&e.$$phase?c.$evalAsync(f):c.$apply(f)})}}}}]});var xe=["$animate",
function(a){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,g){var h,l,k;c.$watch(e.ngIf,function(c){c?l||g(function(c,f){l=f;c[c.length++]=W.createComment(" end ngIf: "+e.ngIf+" ");h={clone:c};a.enter(c,d.parent(),d)}):(k&&(k.remove(),k=null),l&&(l.$destroy(),l=null),h&&(k=qb(h.clone),a.leave(k).then(function(){k=null}),h=null))})}}}],ye=["$templateRequest","$anchorScroll","$animate",function(a,c,d){return{restrict:"ECA",priority:400,
terminal:!0,transclude:"element",controller:aa.noop,compile:function(e,f){var g=f.ngInclude||f.src,h=f.onload||"",l=f.autoscroll;return function(e,f,m,r,s){var t=0,v,w,p,A=function(){w&&(w.remove(),w=null);v&&(v.$destroy(),v=null);p&&(d.leave(p).then(function(){w=null}),w=p,p=null)};e.$watch(g,function(g){var m=function(){!x(l)||l&&!e.$eval(l)||c()},q=++t;g?(a(g,!0).then(function(a){if(q===t){var c=e.$new();r.template=a;a=s(c,function(a){A();d.enter(a,null,f).then(m)});v=c;p=a;v.$emit("$includeContentLoaded",
g);e.$eval(h)}},function(){q===t&&(A(),e.$emit("$includeContentError",g))}),e.$emit("$includeContentRequested",g)):(A(),r.template=null)})}}}}],Pe=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){/SVG/.test(d[0].toString())?(d.empty(),a(Lc(f.template,W).childNodes)(c,function(a){d.append(a)},{futureParentElement:d})):(d.html(f.template),a(d.contents())(c))}}}],ze=Ma({priority:450,compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),
Le=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,c,d,e){var f=c.attr(d.$attr.ngList)||", ",g="false"!==d.ngTrim,h=g?T(f):f;e.$parsers.push(function(a){if(!y(a)){var c=[];a&&m(a.split(h),function(a){a&&c.push(g?T(a):a)});return c}});e.$formatters.push(function(a){return G(a)?a.join(f):t});e.$isEmpty=function(a){return!a||!a.length}}}},lb="ng-valid",Kd="ng-invalid",Xa="ng-pristine",Jb="ng-dirty",Md="ng-pending",kb=L("ngModel"),xg=["$scope","$exceptionHandler","$attrs",
"$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,c,d,e,f,g,h,l,k,n){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=t;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=t;this.$name=n(d.name||"",!1)(a);var q=f(d.ngModel),r=q.assign,s=q,B=r,
K=null,w,p=this;this.$$setOptions=function(a){if((p.$options=a)&&a.getterSetter){var c=f(d.ngModel+"()"),g=f(d.ngModel+"($$$p)");s=function(a){var d=q(a);C(d)&&(d=c(a));return d};B=function(a,c){C(q(a))?g(a,{$$$p:p.$modelValue}):r(a,p.$modelValue)}}else if(!q.assign)throw kb("nonassign",d.ngModel,ua(e));};this.$render=v;this.$isEmpty=function(a){return y(a)||""===a||null===a||a!==a};var A=e.inheritedData("$formController")||Ib,z=0;Hd({ctrl:this,$element:e,set:function(a,c){a[c]=!0},unset:function(a,
c){delete a[c]},parentForm:A,$animate:g});this.$setPristine=function(){p.$dirty=!1;p.$pristine=!0;g.removeClass(e,Jb);g.addClass(e,Xa)};this.$setDirty=function(){p.$dirty=!0;p.$pristine=!1;g.removeClass(e,Xa);g.addClass(e,Jb);A.$setDirty()};this.$setUntouched=function(){p.$touched=!1;p.$untouched=!0;g.setClass(e,"ng-untouched","ng-touched")};this.$setTouched=function(){p.$touched=!0;p.$untouched=!1;g.setClass(e,"ng-touched","ng-untouched")};this.$rollbackViewValue=function(){h.cancel(K);p.$viewValue=
p.$$lastCommittedViewValue;p.$render()};this.$validate=function(){if(!X(p.$modelValue)||!isNaN(p.$modelValue)){var a=p.$$rawModelValue,c=p.$valid,d=p.$modelValue,e=p.$options&&p.$options.allowInvalid;p.$$runValidators(a,p.$$lastCommittedViewValue,function(f){e||c===f||(p.$modelValue=f?a:t,p.$modelValue!==d&&p.$$writeModelToScope())})}};this.$$runValidators=function(a,c,d){function e(){var d=!0;m(p.$validators,function(e,f){var h=e(a,c);d=d&&h;g(f,h)});return d?!0:(m(p.$asyncValidators,function(a,
c){g(c,null)}),!1)}function f(){var d=[],e=!0;m(p.$asyncValidators,function(f,h){var k=f(a,c);if(!k||!C(k.then))throw kb("$asyncValidators",k);g(h,t);d.push(k.then(function(){g(h,!0)},function(a){e=!1;g(h,!1)}))});d.length?k.all(d).then(function(){h(e)},v):h(!0)}function g(a,c){l===z&&p.$setValidity(a,c)}function h(a){l===z&&d(a)}z++;var l=z;(function(){var a=p.$$parserName||"parse";if(w===t)g(a,null);else return w||(m(p.$validators,function(a,c){g(c,null)}),m(p.$asyncValidators,function(a,c){g(c,
null)})),g(a,w),w;return!0})()?e()?f():h(!1):h(!1)};this.$commitViewValue=function(){var a=p.$viewValue;h.cancel(K);if(p.$$lastCommittedViewValue!==a||""===a&&p.$$hasNativeValidators)p.$$lastCommittedViewValue=a,p.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var c=p.$$lastCommittedViewValue;if(w=y(c)?t:!0)for(var d=0;d<p.$parsers.length;d++)if(c=p.$parsers[d](c),y(c)){w=!1;break}X(p.$modelValue)&&isNaN(p.$modelValue)&&(p.$modelValue=s(a));var e=p.$modelValue,
f=p.$options&&p.$options.allowInvalid;p.$$rawModelValue=c;f&&(p.$modelValue=c,p.$modelValue!==e&&p.$$writeModelToScope());p.$$runValidators(c,p.$$lastCommittedViewValue,function(a){f||(p.$modelValue=a?c:t,p.$modelValue!==e&&p.$$writeModelToScope())})};this.$$writeModelToScope=function(){B(a,p.$modelValue);m(p.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};this.$setViewValue=function(a,c){p.$viewValue=a;p.$options&&!p.$options.updateOnDefault||p.$$debounceViewValueCommit(c)};this.$$debounceViewValueCommit=
function(c){var d=0,e=p.$options;e&&x(e.debounce)&&(e=e.debounce,X(e)?d=e:X(e[c])?d=e[c]:X(e["default"])&&(d=e["default"]));h.cancel(K);d?K=h(function(){p.$commitViewValue()},d):l.$$phase?p.$commitViewValue():a.$apply(function(){p.$commitViewValue()})};a.$watch(function(){var c=s(a);if(c!==p.$modelValue&&(p.$modelValue===p.$modelValue||c===c)){p.$modelValue=p.$$rawModelValue=c;w=t;for(var d=p.$formatters,e=d.length,f=c;e--;)f=d[e](f);p.$viewValue!==f&&(p.$viewValue=p.$$lastCommittedViewValue=f,p.$render(),
p.$$runValidators(c,f,v))}return c})}],Ke=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:xg,priority:1,compile:function(c){c.addClass(Xa).addClass("ng-untouched").addClass(lb);return{pre:function(a,c,f,g){var h=g[0],l=g[1]||Ib;h.$$setOptions(g[2]&&g[2].$options);l.$addControl(h);f.$observe("name",function(a){h.$name!==a&&l.$$renameControl(h,a)});a.$on("$destroy",function(){l.$removeControl(h)})},post:function(c,e,f,g){var h=g[0];if(h.$options&&
h.$options.updateOn)e.on(h.$options.updateOn,function(a){h.$$debounceViewValueCommit(a&&a.type)});e.on("blur",function(e){h.$touched||(a.$$phase?c.$evalAsync(h.$setTouched):c.$apply(h.$setTouched))})}}}}}],yg=/(\s+|^)default(\s+|$)/,Oe=function(){return{restrict:"A",controller:["$scope","$attrs",function(a,c){var d=this;this.$options=fa(a.$eval(c.ngModelOptions));this.$options.updateOn!==t?(this.$options.updateOnDefault=!1,this.$options.updateOn=T(this.$options.updateOn.replace(yg,function(){d.$options.updateOnDefault=
!0;return" "}))):this.$options.updateOnDefault=!0}]}},Ae=Ma({terminal:!0,priority:1E3}),zg=L("ngOptions"),Ag=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,Ie=["$compile","$parse",function(a,c){function d(a,d,e){function f(a,c,d,e,g){this.selectValue=a;this.viewValue=c;this.label=d;this.group=e;this.disabled=g}
function n(a){var c;if(!s&&Da(a))c=a;else{c=[];for(var d in a)a.hasOwnProperty(d)&&"$"!==d.charAt(0)&&c.push(d)}return c}var m=a.match(Ag);if(!m)throw zg("iexp",a,ua(d));var r=m[5]||m[7],s=m[6];a=/ as /.test(m[0])&&m[1];var t=m[9];d=c(m[2]?m[1]:r);var v=a&&c(a)||d,w=t&&c(t),p=t?function(a,c){return w(e,c)}:function(a){return Ga(a)},A=function(a,c){return p(a,C(a,c))},x=c(m[2]||m[1]),z=c(m[3]||""),y=c(m[4]||""),J=c(m[8]),F={},C=s?function(a,c){F[s]=c;F[r]=a;return F}:function(a){F[r]=a;return F};return{trackBy:t,
getTrackByValue:A,getWatchables:c(J,function(a){var c=[];a=a||[];for(var d=n(a),f=d.length,g=0;g<f;g++){var h=a===d?g:d[g],k=C(a[h],h),h=p(a[h],k);c.push(h);if(m[2]||m[1])h=x(e,k),c.push(h);m[4]&&(k=y(e,k),c.push(k))}return c}),getOptions:function(){for(var a=[],c={},d=J(e)||[],g=n(d),h=g.length,m=0;m<h;m++){var q=d===g?m:g[m],r=C(d[q],q),s=v(e,r),q=p(s,r),u=x(e,r),w=z(e,r),r=y(e,r),s=new f(q,s,u,w,r);a.push(s);c[q]=s}return{items:a,selectValueMap:c,getOptionFromViewValue:function(a){return c[A(a)]},
getViewValueFromOption:function(a){return t?aa.copy(a.viewValue):a.viewValue}}}}}var e=W.createElement("option"),f=W.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","?ngModel"],link:function(c,h,l,k){function n(a,c){a.element=c;c.disabled=a.disabled;a.value!==c.value&&(c.value=a.selectValue);a.label!==c.label&&(c.label=a.label,c.textContent=a.label)}function q(a,c,d,e){c&&M(c.nodeName)===d?d=c:(d=e.cloneNode(!1),c?a.insertBefore(d,c):a.appendChild(d));return d}function r(a){for(var c;a;)c=
a.nextSibling,Wb(a),a=c}function s(a){var c=p&&p[0],d=J&&J[0];if(c||d)for(;a&&(a===c||a===d);)a=a.nextSibling;return a}function t(){var a=F&&w.readValue();F=D.getOptions();var c={},d=h[0].firstChild;N&&h.prepend(p);d=s(d);F.items.forEach(function(a){var g,k;a.group?(g=c[a.group],g||(g=q(h[0],d,"optgroup",f),d=g.nextSibling,g.label=a.group,g=c[a.group]={groupElement:g,currentOptionElement:g.firstChild}),k=q(g.groupElement,g.currentOptionElement,"option",e),n(a,k),g.currentOptionElement=k.nextSibling):
(k=q(h[0],d,"option",e),n(a,k),d=k.nextSibling)});Object.keys(c).forEach(function(a){r(c[a].currentOptionElement)});r(d);v.$render();if(!v.$isEmpty(a)){var g=w.readValue();(D.trackBy?ka(a,g):a===g)||(v.$setViewValue(g),v.$render())}}var v=k[1];if(v){var w=k[0];k=l.multiple;for(var p,x=0,y=h.children(),C=y.length;x<C;x++)if(""===y[x].value){p=y.eq(x);break}var N=!!p,J=z(e.cloneNode(!1));J.val("?");var F,D=d(l.ngOptions,h,c);k?(v.$isEmpty=function(a){return!a||0===a.length},w.writeValue=function(a){F.items.forEach(function(a){a.element.selected=
!1});a&&a.forEach(function(a){(a=F.getOptionFromViewValue(a))&&!a.disabled&&(a.element.selected=!0)})},w.readValue=function(){var a=h.val()||[],c=[];m(a,function(a){(a=F.selectValueMap[a])&&!a.disabled&&c.push(F.getViewValueFromOption(a))});return c},D.trackBy&&c.$watchCollection(function(){if(G(v.$viewValue))return v.$viewValue.map(function(a){return D.getTrackByValue(a)})},function(){v.$render()})):(w.writeValue=function(a){var c=F.getOptionFromViewValue(a);c&&!c.disabled?h[0].value!==c.selectValue&&
(J.remove(),N||p.remove(),h[0].value=c.selectValue,c.element.selected=!0,c.element.setAttribute("selected","selected")):null===a||N?(J.remove(),N||h.prepend(p),h.val(""),p.prop("selected",!0),p.attr("selected",!0)):(N||p.remove(),h.prepend(J),h.val("?"),J.prop("selected",!0),J.attr("selected",!0))},w.readValue=function(){var a=F.selectValueMap[h.val()];return a&&!a.disabled?(N||p.remove(),J.remove(),F.getViewValueFromOption(a)):null},D.trackBy&&c.$watch(function(){return D.getTrackByValue(v.$viewValue)},
function(){v.$render()}));N?(p.remove(),a(p)(c),p.removeClass("ng-scope")):p=z(e.cloneNode(!1));t();c.$watchCollection(D.getWatchables,t)}}}}],Be=["$locale","$interpolate","$log",function(a,c,d){var e=/{}/g,f=/^when(Minus)?(.+)$/;return{link:function(g,h,l){function k(a){h.text(a||"")}var n=l.count,q=l.$attr.when&&h.attr(l.$attr.when),r=l.offset||0,s=g.$eval(q)||{},t={},x=c.startSymbol(),w=c.endSymbol(),p=x+n+"-"+r+w,A=aa.noop,z;m(l,function(a,c){var d=f.exec(c);d&&(d=(d[1]?"-":"")+M(d[2]),s[d]=h.attr(l.$attr[c]))});
m(s,function(a,d){t[d]=c(a.replace(e,p))});g.$watch(n,function(c){var e=parseFloat(c),f=isNaN(e);f||e in s||(e=a.pluralCat(e-r));e===z||f&&X(z)&&isNaN(z)||(A(),f=t[e],y(f)?(null!=c&&d.debug("ngPluralize: no rule defined for '"+e+"' in "+q),A=v,k()):A=g.$watch(f,k),z=e)})}}}],Ce=["$parse","$animate",function(a,c){var d=L("ngRepeat"),e=function(a,c,d,e,k,n,m){a[d]=e;k&&(a[k]=n);a.$index=c;a.$first=0===c;a.$last=c===m-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(c&1))};return{restrict:"A",
multiElement:!0,transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,compile:function(f,g){var h=g.ngRepeat,l=W.createComment(" end ngRepeat: "+h+" "),k=h.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!k)throw d("iexp",h);var n=k[1],q=k[2],r=k[3],s=k[4],k=n.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);if(!k)throw d("iidexp",n);var v=k[3]||k[1],x=k[2];if(r&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(r)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(r)))throw d("badident",
r);var w,p,A,y,C={$id:Ga};s?w=a(s):(A=function(a,c){return Ga(c)},y=function(a){return a});return function(a,f,g,k,n){w&&(p=function(c,d,e){x&&(C[x]=c);C[v]=d;C.$index=e;return w(a,C)});var s=ga();a.$watchCollection(q,function(g){var k,q,u=f[0],w,C=ga(),D,F,I,G,L,H,M;r&&(a[r]=g);if(Da(g))L=g,q=p||A;else for(M in q=p||y,L=[],g)g.hasOwnProperty(M)&&"$"!==M.charAt(0)&&L.push(M);D=L.length;M=Array(D);for(k=0;k<D;k++)if(F=g===L?k:L[k],I=g[F],G=q(F,I,k),s[G])H=s[G],delete s[G],C[G]=H,M[k]=H;else{if(C[G])throw m(M,
function(a){a&&a.scope&&(s[a.id]=a)}),d("dupes",h,G,I);M[k]={id:G,scope:t,clone:t};C[G]=!0}for(w in s){H=s[w];G=qb(H.clone);c.leave(G);if(G[0].parentNode)for(k=0,q=G.length;k<q;k++)G[k].$$NG_REMOVED=!0;H.scope.$destroy()}for(k=0;k<D;k++)if(F=g===L?k:L[k],I=g[F],H=M[k],H.scope){w=u;do w=w.nextSibling;while(w&&w.$$NG_REMOVED);H.clone[0]!=w&&c.move(qb(H.clone),null,z(u));u=H.clone[H.clone.length-1];e(H.scope,k,v,I,x,F,D)}else n(function(a,d){H.scope=d;var f=l.cloneNode(!1);a[a.length++]=f;c.enter(a,
null,z(u));u=f;H.clone=a;C[H.id]=H;e(H.scope,k,v,I,x,F,D)});s=C})}}}}],De=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngShow,function(c){a[c?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],we=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngHide,function(c){a[c?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ee=Ma(function(a,c,d){a.$watch(d.ngStyle,
function(a,d){d&&a!==d&&m(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),Fe=["$animate",function(a){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,f){var g=[],h=[],l=[],k=[],n=function(a,c){return function(){a.splice(c,1)}};c.$watch(e.ngSwitch||e.on,function(c){var d,e;d=0;for(e=l.length;d<e;++d)a.cancel(l[d]);d=l.length=0;for(e=k.length;d<e;++d){var s=qb(h[d].clone);k[d].$destroy();(l[d]=a.leave(s)).then(n(l,d))}h.length=0;k.length=0;(g=f.cases["!"+
c]||f.cases["?"])&&m(g,function(c){c.transclude(function(d,e){k.push(e);var f=c.element;d[d.length++]=W.createComment(" end ngSwitchWhen: ");h.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],Ge=Ma({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,c,d,e,f){e.cases["!"+d.ngSwitchWhen]=e.cases["!"+d.ngSwitchWhen]||[];e.cases["!"+d.ngSwitchWhen].push({transclude:f,element:c})}}),He=Ma({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,
c,d,e,f){e.cases["?"]=e.cases["?"]||[];e.cases["?"].push({transclude:f,element:c})}}),Je=Ma({restrict:"EAC",link:function(a,c,d,e,f){if(!f)throw L("ngTransclude")("orphan",ua(c));f(function(a){c.empty();c.append(a)})}}),je=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,d){"text/ng-template"==d.type&&a.put(d.id,c[0].text)}}}],Bg={$setViewValue:v,$render:v},Cg=["$element","$scope","$attrs",function(a,c,d){var e=this,f=new Ua;e.ngModelCtrl=Bg;e.unknownOption=z(W.createElement("option"));
e.renderUnknownOption=function(c){c="? "+Ga(c)+" ?";e.unknownOption.val(c);a.prepend(e.unknownOption);a.val(c)};c.$on("$destroy",function(){e.renderUnknownOption=v});e.removeUnknownOption=function(){e.unknownOption.parent()&&e.unknownOption.remove()};e.readValue=function(){e.removeUnknownOption();return a.val()};e.writeValue=function(c){e.hasOption(c)?(e.removeUnknownOption(),a.val(c),""===c&&e.emptyOption.prop("selected",!0)):null==c&&e.emptyOption?(e.removeUnknownOption(),a.val("")):e.renderUnknownOption(c)};
e.addOption=function(a,c){Ta(a,'"option value"');""===a&&(e.emptyOption=c);var d=f.get(a)||0;f.put(a,d+1)};e.removeOption=function(a){var c=f.get(a);c&&(1===c?(f.remove(a),""===a&&(e.emptyOption=t)):f.put(a,c-1))};e.hasOption=function(a){return!!f.get(a)}}],ke=function(){return{restrict:"E",require:["select","?ngModel"],controller:Cg,link:function(a,c,d,e){var f=e[1];if(f){var g=e[0];g.ngModelCtrl=f;f.$render=function(){g.writeValue(f.$viewValue)};c.on("change",function(){a.$apply(function(){f.$setViewValue(g.readValue())})});
if(d.multiple){g.readValue=function(){var a=[];m(c.find("option"),function(c){c.selected&&a.push(c.value)});return a};g.writeValue=function(a){var d=new Ua(a);m(c.find("option"),function(a){a.selected=x(d.get(a.value))})};var h,l=NaN;a.$watch(function(){l!==f.$viewValue||ka(h,f.$viewValue)||(h=ia(f.$viewValue),f.$render());l=f.$viewValue});f.$isEmpty=function(a){return!a||0===a.length}}}}}},me=["$interpolate",function(a){function c(a){a[0].hasAttribute("selected")&&(a[0].selected=!0)}return{restrict:"E",
priority:100,compile:function(d,e){if(y(e.value)){var f=a(d.text(),!0);f||e.$set("value",d.text())}return function(a,d,e){var k=d.parent(),m=k.data("$selectController")||k.parent().data("$selectController");m&&m.ngModelCtrl&&(f?a.$watch(f,function(a,f){e.$set("value",a);f!==a&&m.removeOption(f);m.addOption(a,d);m.ngModelCtrl.$render();c(d)}):(m.addOption(e.value,d),m.ngModelCtrl.$render(),c(d)),d.on("$destroy",function(){m.removeOption(e.value);m.ngModelCtrl.$render()}))}}}}],le=qa({restrict:"E",
terminal:!1}),Fc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){e&&(d.required=!0,e.$validators.required=function(a,c){return!d.required||!e.$isEmpty(c)},d.$observe("required",function(){e.$validate()}))}}},Ec=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f,g=d.ngPattern||d.pattern;d.$observe("pattern",function(a){I(a)&&0<a.length&&(a=new RegExp("^"+a+"$"));if(a&&!a.test)throw L("ngPattern")("noregexp",g,a,ua(c));f=a||t;e.$validate()});
e.$validators.pattern=function(a){return e.$isEmpty(a)||y(f)||f.test(a)}}}}},Hc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=-1;d.$observe("maxlength",function(a){a=Y(a);f=isNaN(a)?-1:a;e.$validate()});e.$validators.maxlength=function(a,c){return 0>f||e.$isEmpty(c)||c.length<=f}}}}},Gc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=0;d.$observe("minlength",function(a){f=Y(a)||0;e.$validate()});e.$validators.minlength=function(a,
c){return e.$isEmpty(c)||c.length>=f}}}}};O.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):(ce(),ee(aa),aa.module("ngLocale",[],["$provide",function(a){function c(a){a+="";var c=a.indexOf(".");return-1==c?0:a.length-c-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),
SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,
maxFrac:2,minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",pluralCat:function(a,e){var f=a|0,g=e;t===g&&(g=Math.min(c(a),3));Math.pow(10,g);return 1==f&&0==g?"one":"other"}})}]),z(W).ready(function(){Zd(W,yc)}))})(window,document);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
//# sourceMappingURL=angular.min.js.map
;
/**
 * @license AngularJS v1.2.29-build.594+sha.b94a47b
 * (c) 2010-2014 Google, Inc. http://angularjs.org
 * License: MIT
 */
(function (window, angular, undefined) {
    'use strict';

    var $sanitizeMinErr = angular.$$minErr('$sanitize');

    /**
     * @ngdoc module
     * @name ngSanitize
     * @description
     *
     * # ngSanitize
     *
     * The `ngSanitize` module provides functionality to sanitize HTML.
     *
     *
     * <div doc-module-components="ngSanitize"></div>
     *
     * See {@link ngSanitize.$sanitize `$sanitize`} for usage.
     */

    /*
     * HTML Parser By Misko Hevery (misko@hevery.com)
     * based on:  HTML Parser By John Resig (ejohn.org)
     * Original code by Erik Arvidsson, Mozilla Public License
     * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
     *
     * // Use like so:
     * htmlParser(htmlString, {
     *     start: function(tag, attrs, unary) {},
     *     end: function(tag) {},
     *     chars: function(text) {},
     *     comment: function(text) {}
     * });
     *
     */


    /**
     * @ngdoc service
     * @name $sanitize
     * @kind function
     *
     * @description
     *   The input is sanitized by parsing the html into tokens. All safe tokens (from a whitelist) are
     *   then serialized back to properly escaped html string. This means that no unsafe input can make
     *   it into the returned string, however, since our parser is more strict than a typical browser
     *   parser, it's possible that some obscure input, which would be recognized as valid HTML by a
     *   browser, won't make it through the sanitizer.
     *   The whitelist is configured using the functions `aHrefSanitizationWhitelist` and
     *   `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider `$compileProvider`}.
     *
     * @param {string} html Html input.
     * @returns {string} Sanitized html.
     *
     * @example
       <example module="sanitizeExample" deps="angular-sanitize.js">
       <file name="index.html">
         <script>
             angular.module('sanitizeExample', ['ngSanitize'])
               .controller('ExampleController', ['$scope', '$sce', function($scope, $sce) {
                 $scope.snippet =
                   '<p style="color:blue">an html\n' +
                   '<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' +
                   'snippet</p>';
                 $scope.deliberatelyTrustDangerousSnippet = function() {
                   return $sce.trustAsHtml($scope.snippet);
                 };
               }]);
         </script>
         <div ng-controller="ExampleController">
            Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
           <table>
             <tr>
               <td>Directive</td>
               <td>How</td>
               <td>Source</td>
               <td>Rendered</td>
             </tr>
             <tr id="bind-html-with-sanitize">
               <td>ng-bind-html</td>
               <td>Automatically uses $sanitize</td>
               <td><pre>&lt;div ng-bind-html="snippet"&gt;<br/>&lt;/div&gt;</pre></td>
               <td><div ng-bind-html="snippet"></div></td>
             </tr>
             <tr id="bind-html-with-trust">
               <td>ng-bind-html</td>
               <td>Bypass $sanitize by explicitly trusting the dangerous value</td>
               <td>
               <pre>&lt;div ng-bind-html="deliberatelyTrustDangerousSnippet()"&gt;
    &lt;/div&gt;</pre>
               </td>
               <td><div ng-bind-html="deliberatelyTrustDangerousSnippet()"></div></td>
             </tr>
             <tr id="bind-default">
               <td>ng-bind</td>
               <td>Automatically escapes</td>
               <td><pre>&lt;div ng-bind="snippet"&gt;<br/>&lt;/div&gt;</pre></td>
               <td><div ng-bind="snippet"></div></td>
             </tr>
           </table>
           </div>
       </file>
       <file name="protractor.js" type="protractor">
         it('should sanitize the html snippet by default', function() {
           expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).
             toBe('<p>an html\n<em>click here</em>\nsnippet</p>');
         });
         it('should inline raw snippet if bound to a trusted value', function() {
           expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).
             toBe("<p style=\"color:blue\">an html\n" +
                  "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
                  "snippet</p>");
         });
         it('should escape snippet without any filter', function() {
           expect(element(by.css('#bind-default div')).getInnerHtml()).
             toBe("&lt;p style=\"color:blue\"&gt;an html\n" +
                  "&lt;em onmouseover=\"this.textContent='PWN3D!'\"&gt;click here&lt;/em&gt;\n" +
                  "snippet&lt;/p&gt;");
         });
         it('should update', function() {
           element(by.model('snippet')).clear();
           element(by.model('snippet')).sendKeys('new <b onclick="alert(1)">text</b>');
           expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).
             toBe('new <b>text</b>');
           expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).toBe(
             'new <b onclick="alert(1)">text</b>');
           expect(element(by.css('#bind-default div')).getInnerHtml()).toBe(
             "new &lt;b onclick=\"alert(1)\"&gt;text&lt;/b&gt;");
         });
       </file>
       </example>
     */
    function $SanitizeProvider() {
        this.$get = ['$$sanitizeUri', function ($$sanitizeUri) {
            return function (html) {
                var buf = [];
                htmlParser(html, htmlSanitizeWriter(buf, function (uri, isImage) {
                    return !/^unsafe/.test($$sanitizeUri(uri, isImage));
                }));
                return buf.join('');
            };
        }];
    }

    function sanitizeText(chars) {
        var buf = [];
        var writer = htmlSanitizeWriter(buf, angular.noop);
        writer.chars(chars);
        return buf.join('');
    }


    // Regular Expressions for parsing tags and attributes
    var START_TAG_REGEXP =
           /^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,
      END_TAG_REGEXP = /^<\/\s*([\w:-]+)[^>]*>/,
      ATTR_REGEXP = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,
      BEGIN_TAG_REGEXP = /^</,
      BEGING_END_TAGE_REGEXP = /^<\//,
      COMMENT_REGEXP = /<!--(.*?)-->/g,
      DOCTYPE_REGEXP = /<!DOCTYPE([^>]*?)>/i,
      CDATA_REGEXP = /<!\[CDATA\[(.*?)]]>/g,
      SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
      // Match everything outside of normal chars and " (quote character)
      NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g;


    // Good source of info about elements and attributes
    // http://dev.w3.org/html5/spec/Overview.html#semantics
    // http://simon.html5.org/html-elements

    // Safe Void Elements - HTML5
    // http://dev.w3.org/html5/spec/Overview.html#void-elements
    var voidElements = makeMap("area,br,col,hr,img,wbr");

    // Elements that you can, intentionally, leave open (and which close themselves)
    // http://dev.w3.org/html5/spec/Overview.html#optional-tags
    var optionalEndTagBlockElements = makeMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),
        optionalEndTagInlineElements = makeMap("rp,rt"),
        optionalEndTagElements = angular.extend({},
                                                optionalEndTagInlineElements,
                                                optionalEndTagBlockElements);

    // Safe Block Elements - HTML5
    var blockElements = angular.extend({}, optionalEndTagBlockElements, makeMap("address,article," +
            "aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5," +
            "h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul"));

    // Inline Elements - HTML5
    var inlineElements = angular.extend({}, optionalEndTagInlineElements, makeMap("a,abbr,acronym,b," +
            "bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s," +
            "samp,small,span,strike,strong,sub,sup,time,tt,u,var"));


    // Special Elements (can contain anything)
    var specialElements = makeMap("script,style");

    var validElements = angular.extend({},
                                       voidElements,
                                       blockElements,
                                       inlineElements,
                                       optionalEndTagElements);

    //Attributes that have href and hence need to be sanitized
    var uriAttrs = makeMap("background,cite,href,longdesc,src,usemap");
    var validAttrs = angular.extend({}, uriAttrs, makeMap(
        'abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +
        'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +
        'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' +
        'scope,scrolling,shape,size,span,start,summary,target,title,type,' +
        'valign,value,vspace,width'));

    function makeMap(str) {
        var obj = {}, items = str.split(','), i;
        for (i = 0; i < items.length; i++) obj[items[i]] = true;
        return obj;
    }


    /**
     * @example
     * htmlParser(htmlString, {
     *     start: function(tag, attrs, unary) {},
     *     end: function(tag) {},
     *     chars: function(text) {},
     *     comment: function(text) {}
     * });
     *
     * @param {string} html string
     * @param {object} handler
     */
    function htmlParser(html, handler) {
        if (typeof html !== 'string') {
            if (html === null || typeof html === 'undefined') {
                html = '';
            } else {
                html = '' + html;
            }
        }
        var index, chars, match, stack = [], last = html, text;
        stack.last = function () { return stack[stack.length - 1]; };

        while (html) {
            text = '';
            chars = true;

            // Make sure we're not in a script or style element
            if (!stack.last() || !specialElements[stack.last()]) {

                // Comment
                if (html.indexOf("<!--") === 0) {
                    // comments containing -- are not allowed unless they terminate the comment
                    index = html.indexOf("--", 4);

                    if (index >= 0 && html.lastIndexOf("-->", index) === index) {
                        if (handler.comment) handler.comment(html.substring(4, index));
                        html = html.substring(index + 3);
                        chars = false;
                    }
                    // DOCTYPE
                } else if (DOCTYPE_REGEXP.test(html)) {
                    match = html.match(DOCTYPE_REGEXP);

                    if (match) {
                        html = html.replace(match[0], '');
                        chars = false;
                    }
                    // end tag
                } else if (BEGING_END_TAGE_REGEXP.test(html)) {
                    match = html.match(END_TAG_REGEXP);

                    if (match) {
                        html = html.substring(match[0].length);
                        match[0].replace(END_TAG_REGEXP, parseEndTag);
                        chars = false;
                    }

                    // start tag
                } else if (BEGIN_TAG_REGEXP.test(html)) {
                    match = html.match(START_TAG_REGEXP);

                    if (match) {
                        // We only have a valid start-tag if there is a '>'.
                        if (match[4]) {
                            html = html.substring(match[0].length);
                            match[0].replace(START_TAG_REGEXP, parseStartTag);
                        }
                        chars = false;
                    } else {
                        // no ending tag found --- this piece should be encoded as an entity.
                        text += '<';
                        html = html.substring(1);
                    }
                }

                if (chars) {
                    index = html.indexOf("<");

                    text += index < 0 ? html : html.substring(0, index);
                    html = index < 0 ? "" : html.substring(index);

                    if (handler.chars) handler.chars(decodeEntities(text));
                }

            } else {
                html = html.replace(new RegExp("(.*)<\\s*\\/\\s*" + stack.last() + "[^>]*>", 'i'),
                  function (all, text) {
                      text = text.replace(COMMENT_REGEXP, "$1").replace(CDATA_REGEXP, "$1");

                      if (handler.chars) handler.chars(decodeEntities(text));

                      return "";
                  });

                parseEndTag("", stack.last());
            }

            if (html == last) {
                throw $sanitizeMinErr('badparse', "The sanitizer was unable to parse the following block " +
                                                  "of html: {0}", html);
            }
            last = html;
        }

        // Clean up any remaining tags
        parseEndTag();

        function parseStartTag(tag, tagName, rest, unary) {
            tagName = angular.lowercase(tagName);
            if (blockElements[tagName]) {
                while (stack.last() && inlineElements[stack.last()]) {
                    parseEndTag("", stack.last());
                }
            }

            if (optionalEndTagElements[tagName] && stack.last() == tagName) {
                parseEndTag("", tagName);
            }

            unary = voidElements[tagName] || !!unary;

            if (!unary)
                stack.push(tagName);

            var attrs = {};

            rest.replace(ATTR_REGEXP,
              function (match, name, doubleQuotedValue, singleQuotedValue, unquotedValue) {
                  var value = doubleQuotedValue
                    || singleQuotedValue
                    || unquotedValue
                    || '';

                  attrs[name] = decodeEntities(value);
              });
            if (handler.start) handler.start(tagName, attrs, unary);
        }

        function parseEndTag(tag, tagName) {
            var pos = 0, i;
            tagName = angular.lowercase(tagName);
            if (tagName)
                // Find the closest opened tag of the same type
                for (pos = stack.length - 1; pos >= 0; pos--)
                    if (stack[pos] == tagName)
                        break;

            if (pos >= 0) {
                // Close all the open elements, up the stack
                for (i = stack.length - 1; i >= pos; i--)
                    if (handler.end) handler.end(stack[i]);

                // Remove the open elements from the stack
                stack.length = pos;
            }
        }
    }

    var hiddenPre = document.createElement("pre");
    var spaceRe = /^(\s*)([\s\S]*?)(\s*)$/;
    /**
     * decodes all entities into regular string
     * @param value
     * @returns {string} A string with decoded entities.
     */
    function decodeEntities(value) {
        if (!value) { return ''; }

        // Note: IE8 does not preserve spaces at the start/end of innerHTML
        // so we must capture them and reattach them afterward
        var parts = spaceRe.exec(value);
        var spaceBefore = parts[1];
        var spaceAfter = parts[3];
        var content = parts[2];
        if (content) {
            hiddenPre.innerHTML = content.replace(/</g, "&lt;");
            // innerText depends on styling as it doesn't display hidden elements.
            // Therefore, it's better to use textContent not to cause unnecessary
            // reflows. However, IE<9 don't support textContent so the innerText
            // fallback is necessary.
            content = 'textContent' in hiddenPre ?
              hiddenPre.textContent : hiddenPre.innerText;
        }
        return spaceBefore + content + spaceAfter;
    }

    /**
     * Escapes all potentially dangerous characters, so that the
     * resulting string can be safely inserted into attribute or
     * element text.
     * @param value
     * @returns {string} escaped text
     */
    function encodeEntities(value) {
        return value.
          replace(/&/g, '&amp;').
          replace(SURROGATE_PAIR_REGEXP, function (value) {
              var hi = value.charCodeAt(0);
              var low = value.charCodeAt(1);
              return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
          }).
          replace(NON_ALPHANUMERIC_REGEXP, function (value) {
              return '&#' + value.charCodeAt(0) + ';';
          }).
          replace(/</g, '&lt;').
          replace(/>/g, '&gt;');
    }

    /**
     * create an HTML/XML writer which writes to buffer
     * @param {Array} buf use buf.jain('') to get out sanitized html string
     * @returns {object} in the form of {
     *     start: function(tag, attrs, unary) {},
     *     end: function(tag) {},
     *     chars: function(text) {},
     *     comment: function(text) {}
     * }
     */
    function htmlSanitizeWriter(buf, uriValidator) {
        var ignore = false;
        var out = angular.bind(buf, buf.push);
        return {
            start: function (tag, attrs, unary) {
                tag = angular.lowercase(tag);
                if (!ignore && specialElements[tag]) {
                    ignore = tag;
                }
                if (!ignore && validElements[tag] === true) {
                    out('<');
                    out(tag);
                    angular.forEach(attrs, function (value, key) {
                        var lkey = angular.lowercase(key);
                        var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background');
                        if (validAttrs[lkey] === true &&
                          (uriAttrs[lkey] !== true || uriValidator(value, isImage))) {
                            out(' ');
                            out(key);
                            out('="');
                            out(encodeEntities(value));
                            out('"');
                        }
                    });
                    out(unary ? '/>' : '>');
                }
            },
            end: function (tag) {
                tag = angular.lowercase(tag);
                if (!ignore && validElements[tag] === true) {
                    out('</');
                    out(tag);
                    out('>');
                }
                if (tag == ignore) {
                    ignore = false;
                }
            },
            chars: function (chars) {
                if (!ignore) {
                    out(encodeEntities(chars));
                }
            }
        };
    }


    // define ngSanitize module and register $sanitize service
    angular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);

    /* global sanitizeText: false */

    /**
     * @ngdoc filter
     * @name linky
     * @kind function
     *
     * @description
     * Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and
     * plain email address links.
     *
     * Requires the {@link ngSanitize `ngSanitize`} module to be installed.
     *
     * @param {string} text Input text.
     * @param {string} target Window (_blank|_self|_parent|_top) or named frame to open links in.
     * @returns {string} Html-linkified text.
     *
     * @usage
       <span ng-bind-html="linky_expression | linky"></span>
     *
     * @example
       <example module="linkyExample" deps="angular-sanitize.js">
         <file name="index.html">
           <script>
             angular.module('linkyExample', ['ngSanitize'])
               .controller('ExampleController', ['$scope', function($scope) {
                 $scope.snippet =
                   'Pretty text with some links:\n'+
                   'http://angularjs.org/,\n'+
                   'mailto:us@somewhere.org,\n'+
                   'another@somewhere.org,\n'+
                   'and one more: ftp://127.0.0.1/.';
                 $scope.snippetWithTarget = 'http://angularjs.org/';
               }]);
           </script>
           <div ng-controller="ExampleController">
           Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
           <table>
             <tr>
               <td>Filter</td>
               <td>Source</td>
               <td>Rendered</td>
             </tr>
             <tr id="linky-filter">
               <td>linky filter</td>
               <td>
                 <pre>&lt;div ng-bind-html="snippet | linky"&gt;<br>&lt;/div&gt;</pre>
               </td>
               <td>
                 <div ng-bind-html="snippet | linky"></div>
               </td>
             </tr>
             <tr id="linky-target">
              <td>linky target</td>
              <td>
                <pre>&lt;div ng-bind-html="snippetWithTarget | linky:'_blank'"&gt;<br>&lt;/div&gt;</pre>
              </td>
              <td>
                <div ng-bind-html="snippetWithTarget | linky:'_blank'"></div>
              </td>
             </tr>
             <tr id="escaped-html">
               <td>no filter</td>
               <td><pre>&lt;div ng-bind="snippet"&gt;<br>&lt;/div&gt;</pre></td>
               <td><div ng-bind="snippet"></div></td>
             </tr>
           </table>
         </file>
         <file name="protractor.js" type="protractor">
           it('should linkify the snippet with urls', function() {
             expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
                 toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +
                      'another@somewhere.org, and one more: ftp://127.0.0.1/.');
             expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);
           });
           it('should not linkify snippet without the linky filter', function() {
             expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).
                 toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +
                      'another@somewhere.org, and one more: ftp://127.0.0.1/.');
             expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);
           });
           it('should update', function() {
             element(by.model('snippet')).clear();
             element(by.model('snippet')).sendKeys('new http://link.');
             expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
                 toBe('new http://link.');
             expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);
             expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())
                 .toBe('new http://link.');
           });
           it('should work with the target property', function() {
            expect(element(by.id('linky-target')).
                element(by.binding("snippetWithTarget | linky:'_blank'")).getText()).
                toBe('http://angularjs.org/');
            expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');
           });
         </file>
       </example>
     */
    angular.module('ngSanitize').filter('linky', ['$sanitize', function ($sanitize) {
        var LINKY_URL_REGEXP =
              /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"]/,
            MAILTO_REGEXP = /^mailto:/;

        return function (text, target) {
            if (!text) return text;
            var match;
            var raw = text;
            var html = [];
            var url;
            var i;
            while ((match = raw.match(LINKY_URL_REGEXP))) {
                // We can not end in these as they are sometimes found at the end of the sentence
                url = match[0];
                // if we did not match ftp/http/mailto then assume mailto
                if (match[2] == match[3]) url = 'mailto:' + url;
                i = match.index;
                addText(raw.substr(0, i));
                addLink(url, match[0].replace(MAILTO_REGEXP, ''));
                raw = raw.substring(i + match[0].length);
            }
            addText(raw);
            return $sanitize(html.join(''));

            function addText(text) {
                if (!text) {
                    return;
                }
                html.push(sanitizeText(text));
            }

            function addLink(url, text) {
                html.push('<a ');
                if (angular.isDefined(target)) {
                    html.push('target="');
                    html.push(target);
                    html.push('" ');
                }
                html.push('href="',
                          url.replace('"', '&quot;'),
                          '">');
                addText(text);
                html.push('</a>');
            }
        };
    }]);


})(window, window.angular);;
/**
 * @license AngularJS v1.4.3
 * (c) 2010-2015 Google, Inc. http://angularjs.org
 * License: MIT
 */
(function(window, angular, undefined) {'use strict';

/**
 * @ngdoc module
 * @name ngRoute
 * @description
 *
 * # ngRoute
 *
 * The `ngRoute` module provides routing and deeplinking services and directives for angular apps.
 *
 * ## Example
 * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
 *
 *
 * <div doc-module-components="ngRoute"></div>
 */
 /* global -ngRouteModule */
var ngRouteModule = angular.module('ngRoute', ['ng']).
                        provider('$route', $RouteProvider),
    $routeMinErr = angular.$$minErr('ngRoute');

/**
 * @ngdoc provider
 * @name $routeProvider
 *
 * @description
 *
 * Used for configuring routes.
 *
 * ## Example
 * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
 *
 * ## Dependencies
 * Requires the {@link ngRoute `ngRoute`} module to be installed.
 */
function $RouteProvider() {
  function inherit(parent, extra) {
    return angular.extend(Object.create(parent), extra);
  }

  var routes = {};

  /**
   * @ngdoc method
   * @name $routeProvider#when
   *
   * @param {string} path Route path (matched against `$location.path`). If `$location.path`
   *    contains redundant trailing slash or is missing one, the route will still match and the
   *    `$location.path` will be updated to add or drop the trailing slash to exactly match the
   *    route definition.
   *
   *    * `path` can contain named groups starting with a colon: e.g. `:name`. All characters up
   *        to the next slash are matched and stored in `$routeParams` under the given `name`
   *        when the route matches.
   *    * `path` can contain named groups starting with a colon and ending with a star:
   *        e.g.`:name*`. All characters are eagerly stored in `$routeParams` under the given `name`
   *        when the route matches.
   *    * `path` can contain optional named groups with a question mark: e.g.`:name?`.
   *
   *    For example, routes like `/color/:color/largecode/:largecode*\/edit` will match
   *    `/color/brown/largecode/code/with/slashes/edit` and extract:
   *
   *    * `color: brown`
   *    * `largecode: code/with/slashes`.
   *
   *
   * @param {Object} route Mapping information to be assigned to `$route.current` on route
   *    match.
   *
   *    Object properties:
   *
   *    - `controller` – `{(string|function()=}` – Controller fn that should be associated with
   *      newly created scope or the name of a {@link angular.Module#controller registered
   *      controller} if passed as a string.
   *    - `controllerAs` – `{string=}` – An identifier name for a reference to the controller.
   *      If present, the controller will be published to scope under the `controllerAs` name.
   *    - `template` – `{string=|function()=}` – html template as a string or a function that
   *      returns an html template as a string which should be used by {@link
   *      ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives.
   *      This property takes precedence over `templateUrl`.
   *
   *      If `template` is a function, it will be called with the following parameters:
   *
   *      - `{Array.<Object>}` - route parameters extracted from the current
   *        `$location.path()` by applying the current route
   *
   *    - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html
   *      template that should be used by {@link ngRoute.directive:ngView ngView}.
   *
   *      If `templateUrl` is a function, it will be called with the following parameters:
   *
   *      - `{Array.<Object>}` - route parameters extracted from the current
   *        `$location.path()` by applying the current route
   *
   *    - `resolve` - `{Object.<string, function>=}` - An optional map of dependencies which should
   *      be injected into the controller. If any of these dependencies are promises, the router
   *      will wait for them all to be resolved or one to be rejected before the controller is
   *      instantiated.
   *      If all the promises are resolved successfully, the values of the resolved promises are
   *      injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is
   *      fired. If any of the promises are rejected the
   *      {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired. The map object
   *      is:
   *
   *      - `key` – `{string}`: a name of a dependency to be injected into the controller.
   *      - `factory` - `{string|function}`: If `string` then it is an alias for a service.
   *        Otherwise if function, then it is {@link auto.$injector#invoke injected}
   *        and the return value is treated as the dependency. If the result is a promise, it is
   *        resolved before its value is injected into the controller. Be aware that
   *        `ngRoute.$routeParams` will still refer to the previous route within these resolve
   *        functions.  Use `$route.current.params` to access the new route parameters, instead.
   *
   *    - `redirectTo` – {(string|function())=} – value to update
   *      {@link ng.$location $location} path with and trigger route redirection.
   *
   *      If `redirectTo` is a function, it will be called with the following parameters:
   *
   *      - `{Object.<string>}` - route parameters extracted from the current
   *        `$location.path()` by applying the current route templateUrl.
   *      - `{string}` - current `$location.path()`
   *      - `{Object}` - current `$location.search()`
   *
   *      The custom `redirectTo` function is expected to return a string which will be used
   *      to update `$location.path()` and `$location.search()`.
   *
   *    - `[reloadOnSearch=true]` - {boolean=} - reload route when only `$location.search()`
   *      or `$location.hash()` changes.
   *
   *      If the option is set to `false` and url in the browser changes, then
   *      `$routeUpdate` event is broadcasted on the root scope.
   *
   *    - `[caseInsensitiveMatch=false]` - {boolean=} - match routes without being case sensitive
   *
   *      If the option is set to `true`, then the particular route can be matched without being
   *      case sensitive
   *
   * @returns {Object} self
   *
   * @description
   * Adds a new route definition to the `$route` service.
   */
  this.when = function(path, route) {
    //copy original route object to preserve params inherited from proto chain
    var routeCopy = angular.copy(route);
    if (angular.isUndefined(routeCopy.reloadOnSearch)) {
      routeCopy.reloadOnSearch = true;
    }
    if (angular.isUndefined(routeCopy.caseInsensitiveMatch)) {
      routeCopy.caseInsensitiveMatch = this.caseInsensitiveMatch;
    }
    routes[path] = angular.extend(
      routeCopy,
      path && pathRegExp(path, routeCopy)
    );

    // create redirection for trailing slashes
    if (path) {
      var redirectPath = (path[path.length - 1] == '/')
            ? path.substr(0, path.length - 1)
            : path + '/';

      routes[redirectPath] = angular.extend(
        {redirectTo: path},
        pathRegExp(redirectPath, routeCopy)
      );
    }

    return this;
  };

  /**
   * @ngdoc property
   * @name $routeProvider#caseInsensitiveMatch
   * @description
   *
   * A boolean property indicating if routes defined
   * using this provider should be matched using a case insensitive
   * algorithm. Defaults to `false`.
   */
  this.caseInsensitiveMatch = false;

   /**
    * @param path {string} path
    * @param opts {Object} options
    * @return {?Object}
    *
    * @description
    * Normalizes the given path, returning a regular expression
    * and the original path.
    *
    * Inspired by pathRexp in visionmedia/express/lib/utils.js.
    */
  function pathRegExp(path, opts) {
    var insensitive = opts.caseInsensitiveMatch,
        ret = {
          originalPath: path,
          regexp: path
        },
        keys = ret.keys = [];

    path = path
      .replace(/([().])/g, '\\$1')
      .replace(/(\/)?:(\w+)([\?\*])?/g, function(_, slash, key, option) {
        var optional = option === '?' ? option : null;
        var star = option === '*' ? option : null;
        keys.push({ name: key, optional: !!optional });
        slash = slash || '';
        return ''
          + (optional ? '' : slash)
          + '(?:'
          + (optional ? slash : '')
          + (star && '(.+?)' || '([^/]+)')
          + (optional || '')
          + ')'
          + (optional || '');
      })
      .replace(/([\/$\*])/g, '\\$1');

    ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : '');
    return ret;
  }

  /**
   * @ngdoc method
   * @name $routeProvider#otherwise
   *
   * @description
   * Sets route definition that will be used on route change when no other route definition
   * is matched.
   *
   * @param {Object|string} params Mapping information to be assigned to `$route.current`.
   * If called with a string, the value maps to `redirectTo`.
   * @returns {Object} self
   */
  this.otherwise = function(params) {
    if (typeof params === 'string') {
      params = {redirectTo: params};
    }
    this.when(null, params);
    return this;
  };


  this.$get = ['$rootScope',
               '$location',
               '$routeParams',
               '$q',
               '$injector',
               '$templateRequest',
               '$sce',
      function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce) {

    /**
     * @ngdoc service
     * @name $route
     * @requires $location
     * @requires $routeParams
     *
     * @property {Object} current Reference to the current route definition.
     * The route definition contains:
     *
     *   - `controller`: The controller constructor as define in route definition.
     *   - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for
     *     controller instantiation. The `locals` contain
     *     the resolved values of the `resolve` map. Additionally the `locals` also contain:
     *
     *     - `$scope` - The current route scope.
     *     - `$template` - The current route template HTML.
     *
     * @property {Object} routes Object with all route configuration Objects as its properties.
     *
     * @description
     * `$route` is used for deep-linking URLs to controllers and views (HTML partials).
     * It watches `$location.url()` and tries to map the path to an existing route definition.
     *
     * Requires the {@link ngRoute `ngRoute`} module to be installed.
     *
     * You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API.
     *
     * The `$route` service is typically used in conjunction with the
     * {@link ngRoute.directive:ngView `ngView`} directive and the
     * {@link ngRoute.$routeParams `$routeParams`} service.
     *
     * @example
     * This example shows how changing the URL hash causes the `$route` to match a route against the
     * URL, and the `ngView` pulls in the partial.
     *
     * <example name="$route-service" module="ngRouteExample"
     *          deps="angular-route.js" fixBase="true">
     *   <file name="index.html">
     *     <div ng-controller="MainController">
     *       Choose:
     *       <a href="Book/Moby">Moby</a> |
     *       <a href="Book/Moby/ch/1">Moby: Ch1</a> |
     *       <a href="Book/Gatsby">Gatsby</a> |
     *       <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
     *       <a href="Book/Scarlet">Scarlet Letter</a><br/>
     *
     *       <div ng-view></div>
     *
     *       <hr />
     *
     *       <pre>$location.path() = {{$location.path()}}</pre>
     *       <pre>$route.current.templateUrl = {{$route.current.templateUrl}}</pre>
     *       <pre>$route.current.params = {{$route.current.params}}</pre>
     *       <pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>
     *       <pre>$routeParams = {{$routeParams}}</pre>
     *     </div>
     *   </file>
     *
     *   <file name="book.html">
     *     controller: {{name}}<br />
     *     Book Id: {{params.bookId}}<br />
     *   </file>
     *
     *   <file name="chapter.html">
     *     controller: {{name}}<br />
     *     Book Id: {{params.bookId}}<br />
     *     Chapter Id: {{params.chapterId}}
     *   </file>
     *
     *   <file name="script.js">
     *     angular.module('ngRouteExample', ['ngRoute'])
     *
     *      .controller('MainController', function($scope, $route, $routeParams, $location) {
     *          $scope.$route = $route;
     *          $scope.$location = $location;
     *          $scope.$routeParams = $routeParams;
     *      })
     *
     *      .controller('BookController', function($scope, $routeParams) {
     *          $scope.name = "BookController";
     *          $scope.params = $routeParams;
     *      })
     *
     *      .controller('ChapterController', function($scope, $routeParams) {
     *          $scope.name = "ChapterController";
     *          $scope.params = $routeParams;
     *      })
     *
     *     .config(function($routeProvider, $locationProvider) {
     *       $routeProvider
     *        .when('/Book/:bookId', {
     *         templateUrl: 'book.html',
     *         controller: 'BookController',
     *         resolve: {
     *           // I will cause a 1 second delay
     *           delay: function($q, $timeout) {
     *             var delay = $q.defer();
     *             $timeout(delay.resolve, 1000);
     *             return delay.promise;
     *           }
     *         }
     *       })
     *       .when('/Book/:bookId/ch/:chapterId', {
     *         templateUrl: 'chapter.html',
     *         controller: 'ChapterController'
     *       });
     *
     *       // configure html5 to get links working on jsfiddle
     *       $locationProvider.html5Mode(true);
     *     });
     *
     *   </file>
     *
     *   <file name="protractor.js" type="protractor">
     *     it('should load and compile correct template', function() {
     *       element(by.linkText('Moby: Ch1')).click();
     *       var content = element(by.css('[ng-view]')).getText();
     *       expect(content).toMatch(/controller\: ChapterController/);
     *       expect(content).toMatch(/Book Id\: Moby/);
     *       expect(content).toMatch(/Chapter Id\: 1/);
     *
     *       element(by.partialLinkText('Scarlet')).click();
     *
     *       content = element(by.css('[ng-view]')).getText();
     *       expect(content).toMatch(/controller\: BookController/);
     *       expect(content).toMatch(/Book Id\: Scarlet/);
     *     });
     *   </file>
     * </example>
     */

    /**
     * @ngdoc event
     * @name $route#$routeChangeStart
     * @eventType broadcast on root scope
     * @description
     * Broadcasted before a route change. At this  point the route services starts
     * resolving all of the dependencies needed for the route change to occur.
     * Typically this involves fetching the view template as well as any dependencies
     * defined in `resolve` route property. Once  all of the dependencies are resolved
     * `$routeChangeSuccess` is fired.
     *
     * The route change (and the `$location` change that triggered it) can be prevented
     * by calling `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on}
     * for more details about event object.
     *
     * @param {Object} angularEvent Synthetic event object.
     * @param {Route} next Future route information.
     * @param {Route} current Current route information.
     */

    /**
     * @ngdoc event
     * @name $route#$routeChangeSuccess
     * @eventType broadcast on root scope
     * @description
     * Broadcasted after a route change has happened successfully.
     * The `resolve` dependencies are now available in the `current.locals` property.
     *
     * {@link ngRoute.directive:ngView ngView} listens for the directive
     * to instantiate the controller and render the view.
     *
     * @param {Object} angularEvent Synthetic event object.
     * @param {Route} current Current route information.
     * @param {Route|Undefined} previous Previous route information, or undefined if current is
     * first route entered.
     */

    /**
     * @ngdoc event
     * @name $route#$routeChangeError
     * @eventType broadcast on root scope
     * @description
     * Broadcasted if any of the resolve promises are rejected.
     *
     * @param {Object} angularEvent Synthetic event object
     * @param {Route} current Current route information.
     * @param {Route} previous Previous route information.
     * @param {Route} rejection Rejection of the promise. Usually the error of the failed promise.
     */

    /**
     * @ngdoc event
     * @name $route#$routeUpdate
     * @eventType broadcast on root scope
     * @description
     * The `reloadOnSearch` property has been set to false, and we are reusing the same
     * instance of the Controller.
     *
     * @param {Object} angularEvent Synthetic event object
     * @param {Route} current Current/previous route information.
     */

    var forceReload = false,
        preparedRoute,
        preparedRouteIsUpdateOnly,
        $route = {
          routes: routes,

          /**
           * @ngdoc method
           * @name $route#reload
           *
           * @description
           * Causes `$route` service to reload the current route even if
           * {@link ng.$location $location} hasn't changed.
           *
           * As a result of that, {@link ngRoute.directive:ngView ngView}
           * creates new scope and reinstantiates the controller.
           */
          reload: function() {
            forceReload = true;
            $rootScope.$evalAsync(function() {
              // Don't support cancellation of a reload for now...
              prepareRoute();
              commitRoute();
            });
          },

          /**
           * @ngdoc method
           * @name $route#updateParams
           *
           * @description
           * Causes `$route` service to update the current URL, replacing
           * current route parameters with those specified in `newParams`.
           * Provided property names that match the route's path segment
           * definitions will be interpolated into the location's path, while
           * remaining properties will be treated as query params.
           *
           * @param {!Object<string, string>} newParams mapping of URL parameter names to values
           */
          updateParams: function(newParams) {
            if (this.current && this.current.$$route) {
              newParams = angular.extend({}, this.current.params, newParams);
              $location.path(interpolate(this.current.$$route.originalPath, newParams));
              // interpolate modifies newParams, only query params are left
              $location.search(newParams);
            } else {
              throw $routeMinErr('norout', 'Tried updating route when with no current route');
            }
          }
        };

    $rootScope.$on('$locationChangeStart', prepareRoute);
    $rootScope.$on('$locationChangeSuccess', commitRoute);

    return $route;

    /////////////////////////////////////////////////////

    /**
     * @param on {string} current url
     * @param route {Object} route regexp to match the url against
     * @return {?Object}
     *
     * @description
     * Check if the route matches the current url.
     *
     * Inspired by match in
     * visionmedia/express/lib/router/router.js.
     */
    function switchRouteMatcher(on, route) {
      var keys = route.keys,
          params = {};

      if (!route.regexp) return null;

      var m = route.regexp.exec(on);
      if (!m) return null;

      for (var i = 1, len = m.length; i < len; ++i) {
        var key = keys[i - 1];

        var val = m[i];

        if (key && val) {
          params[key.name] = val;
        }
      }
      return params;
    }

    function prepareRoute($locationEvent) {
      var lastRoute = $route.current;

      preparedRoute = parseRoute();
      preparedRouteIsUpdateOnly = preparedRoute && lastRoute && preparedRoute.$$route === lastRoute.$$route
          && angular.equals(preparedRoute.pathParams, lastRoute.pathParams)
          && !preparedRoute.reloadOnSearch && !forceReload;

      if (!preparedRouteIsUpdateOnly && (lastRoute || preparedRoute)) {
        if ($rootScope.$broadcast('$routeChangeStart', preparedRoute, lastRoute).defaultPrevented) {
          if ($locationEvent) {
            $locationEvent.preventDefault();
          }
        }
      }
    }

    function commitRoute() {
      var lastRoute = $route.current;
      var nextRoute = preparedRoute;

      if (preparedRouteIsUpdateOnly) {
        lastRoute.params = nextRoute.params;
        angular.copy(lastRoute.params, $routeParams);
        $rootScope.$broadcast('$routeUpdate', lastRoute);
      } else if (nextRoute || lastRoute) {
        forceReload = false;
        $route.current = nextRoute;
        if (nextRoute) {
          if (nextRoute.redirectTo) {
            if (angular.isString(nextRoute.redirectTo)) {
              $location.path(interpolate(nextRoute.redirectTo, nextRoute.params)).search(nextRoute.params)
                       .replace();
            } else {
              $location.url(nextRoute.redirectTo(nextRoute.pathParams, $location.path(), $location.search()))
                       .replace();
            }
          }
        }

        $q.when(nextRoute).
          then(function() {
            if (nextRoute) {
              var locals = angular.extend({}, nextRoute.resolve),
                  template, templateUrl;

              angular.forEach(locals, function(value, key) {
                locals[key] = angular.isString(value) ?
                    $injector.get(value) : $injector.invoke(value, null, null, key);
              });

              if (angular.isDefined(template = nextRoute.template)) {
                if (angular.isFunction(template)) {
                  template = template(nextRoute.params);
                }
              } else if (angular.isDefined(templateUrl = nextRoute.templateUrl)) {
                if (angular.isFunction(templateUrl)) {
                  templateUrl = templateUrl(nextRoute.params);
                }
                if (angular.isDefined(templateUrl)) {
                  nextRoute.loadedTemplateUrl = $sce.valueOf(templateUrl);
                  template = $templateRequest(templateUrl);
                }
              }
              if (angular.isDefined(template)) {
                locals['$template'] = template;
              }
              return $q.all(locals);
            }
          }).
          then(function(locals) {
            // after route change
            if (nextRoute == $route.current) {
              if (nextRoute) {
                nextRoute.locals = locals;
                angular.copy(nextRoute.params, $routeParams);
              }
              $rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute);
            }
          }, function(error) {
            if (nextRoute == $route.current) {
              $rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error);
            }
          });
      }
    }


    /**
     * @returns {Object} the current active route, by matching it against the URL
     */
    function parseRoute() {
      // Match a route
      var params, match;
      angular.forEach(routes, function(route, path) {
        if (!match && (params = switchRouteMatcher($location.path(), route))) {
          match = inherit(route, {
            params: angular.extend({}, $location.search(), params),
            pathParams: params});
          match.$$route = route;
        }
      });
      // No route matched; fallback to "otherwise" route
      return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});
    }

    /**
     * @returns {string} interpolation of the redirect path with the parameters
     */
    function interpolate(string, params) {
      var result = [];
      angular.forEach((string || '').split(':'), function(segment, i) {
        if (i === 0) {
          result.push(segment);
        } else {
          var segmentMatch = segment.match(/(\w+)(?:[?*])?(.*)/);
          var key = segmentMatch[1];
          result.push(params[key]);
          result.push(segmentMatch[2] || '');
          delete params[key];
        }
      });
      return result.join('');
    }
  }];
}

ngRouteModule.provider('$routeParams', $RouteParamsProvider);


/**
 * @ngdoc service
 * @name $routeParams
 * @requires $route
 *
 * @description
 * The `$routeParams` service allows you to retrieve the current set of route parameters.
 *
 * Requires the {@link ngRoute `ngRoute`} module to be installed.
 *
 * The route parameters are a combination of {@link ng.$location `$location`}'s
 * {@link ng.$location#search `search()`} and {@link ng.$location#path `path()`}.
 * The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched.
 *
 * In case of parameter name collision, `path` params take precedence over `search` params.
 *
 * The service guarantees that the identity of the `$routeParams` object will remain unchanged
 * (but its properties will likely change) even when a route change occurs.
 *
 * Note that the `$routeParams` are only updated *after* a route change completes successfully.
 * This means that you cannot rely on `$routeParams` being correct in route resolve functions.
 * Instead you can use `$route.current.params` to access the new route's parameters.
 *
 * @example
 * ```js
 *  // Given:
 *  // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
 *  // Route: /Chapter/:chapterId/Section/:sectionId
 *  //
 *  // Then
 *  $routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'}
 * ```
 */
function $RouteParamsProvider() {
  this.$get = function() { return {}; };
}

ngRouteModule.directive('ngView', ngViewFactory);
ngRouteModule.directive('ngView', ngViewFillContentFactory);


/**
 * @ngdoc directive
 * @name ngView
 * @restrict ECA
 *
 * @description
 * # Overview
 * `ngView` is a directive that complements the {@link ngRoute.$route $route} service by
 * including the rendered template of the current route into the main layout (`index.html`) file.
 * Every time the current route changes, the included view changes with it according to the
 * configuration of the `$route` service.
 *
 * Requires the {@link ngRoute `ngRoute`} module to be installed.
 *
 * @animations
 * enter - animation is used to bring new content into the browser.
 * leave - animation is used to animate existing content away.
 *
 * The enter and leave animation occur concurrently.
 *
 * @scope
 * @priority 400
 * @param {string=} onload Expression to evaluate whenever the view updates.
 *
 * @param {string=} autoscroll Whether `ngView` should call {@link ng.$anchorScroll
 *                  $anchorScroll} to scroll the viewport after the view is updated.
 *
 *                  - If the attribute is not set, disable scrolling.
 *                  - If the attribute is set without value, enable scrolling.
 *                  - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated
 *                    as an expression yields a truthy value.
 * @example
    <example name="ngView-directive" module="ngViewExample"
             deps="angular-route.js;angular-animate.js"
             animations="true" fixBase="true">
      <file name="index.html">
        <div ng-controller="MainCtrl as main">
          Choose:
          <a href="Book/Moby">Moby</a> |
          <a href="Book/Moby/ch/1">Moby: Ch1</a> |
          <a href="Book/Gatsby">Gatsby</a> |
          <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
          <a href="Book/Scarlet">Scarlet Letter</a><br/>

          <div class="view-animate-container">
            <div ng-view class="view-animate"></div>
          </div>
          <hr />

          <pre>$location.path() = {{main.$location.path()}}</pre>
          <pre>$route.current.templateUrl = {{main.$route.current.templateUrl}}</pre>
          <pre>$route.current.params = {{main.$route.current.params}}</pre>
          <pre>$routeParams = {{main.$routeParams}}</pre>
        </div>
      </file>

      <file name="book.html">
        <div>
          controller: {{book.name}}<br />
          Book Id: {{book.params.bookId}}<br />
        </div>
      </file>

      <file name="chapter.html">
        <div>
          controller: {{chapter.name}}<br />
          Book Id: {{chapter.params.bookId}}<br />
          Chapter Id: {{chapter.params.chapterId}}
        </div>
      </file>

      <file name="animations.css">
        .view-animate-container {
          position:relative;
          height:100px!important;
          background:white;
          border:1px solid black;
          height:40px;
          overflow:hidden;
        }

        .view-animate {
          padding:10px;
        }

        .view-animate.ng-enter, .view-animate.ng-leave {
          -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
          transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;

          display:block;
          width:100%;
          border-left:1px solid black;

          position:absolute;
          top:0;
          left:0;
          right:0;
          bottom:0;
          padding:10px;
        }

        .view-animate.ng-enter {
          left:100%;
        }
        .view-animate.ng-enter.ng-enter-active {
          left:0;
        }
        .view-animate.ng-leave.ng-leave-active {
          left:-100%;
        }
      </file>

      <file name="script.js">
        angular.module('ngViewExample', ['ngRoute', 'ngAnimate'])
          .config(['$routeProvider', '$locationProvider',
            function($routeProvider, $locationProvider) {
              $routeProvider
                .when('/Book/:bookId', {
                  templateUrl: 'book.html',
                  controller: 'BookCtrl',
                  controllerAs: 'book'
                })
                .when('/Book/:bookId/ch/:chapterId', {
                  templateUrl: 'chapter.html',
                  controller: 'ChapterCtrl',
                  controllerAs: 'chapter'
                });

              $locationProvider.html5Mode(true);
          }])
          .controller('MainCtrl', ['$route', '$routeParams', '$location',
            function($route, $routeParams, $location) {
              this.$route = $route;
              this.$location = $location;
              this.$routeParams = $routeParams;
          }])
          .controller('BookCtrl', ['$routeParams', function($routeParams) {
            this.name = "BookCtrl";
            this.params = $routeParams;
          }])
          .controller('ChapterCtrl', ['$routeParams', function($routeParams) {
            this.name = "ChapterCtrl";
            this.params = $routeParams;
          }]);

      </file>

      <file name="protractor.js" type="protractor">
        it('should load and compile correct template', function() {
          element(by.linkText('Moby: Ch1')).click();
          var content = element(by.css('[ng-view]')).getText();
          expect(content).toMatch(/controller\: ChapterCtrl/);
          expect(content).toMatch(/Book Id\: Moby/);
          expect(content).toMatch(/Chapter Id\: 1/);

          element(by.partialLinkText('Scarlet')).click();

          content = element(by.css('[ng-view]')).getText();
          expect(content).toMatch(/controller\: BookCtrl/);
          expect(content).toMatch(/Book Id\: Scarlet/);
        });
      </file>
    </example>
 */


/**
 * @ngdoc event
 * @name ngView#$viewContentLoaded
 * @eventType emit on the current ngView scope
 * @description
 * Emitted every time the ngView content is reloaded.
 */
ngViewFactory.$inject = ['$route', '$anchorScroll', '$animate'];
function ngViewFactory($route, $anchorScroll, $animate) {
  return {
    restrict: 'ECA',
    terminal: true,
    priority: 400,
    transclude: 'element',
    link: function(scope, $element, attr, ctrl, $transclude) {
        var currentScope,
            currentElement,
            previousLeaveAnimation,
            autoScrollExp = attr.autoscroll,
            onloadExp = attr.onload || '';

        scope.$on('$routeChangeSuccess', update);
        update();

        function cleanupLastView() {
          if (previousLeaveAnimation) {
            $animate.cancel(previousLeaveAnimation);
            previousLeaveAnimation = null;
          }

          if (currentScope) {
            currentScope.$destroy();
            currentScope = null;
          }
          if (currentElement) {
            previousLeaveAnimation = $animate.leave(currentElement);
            previousLeaveAnimation.then(function() {
              previousLeaveAnimation = null;
            });
            currentElement = null;
          }
        }

        function update() {
          var locals = $route.current && $route.current.locals,
              template = locals && locals.$template;

          if (angular.isDefined(template)) {
            var newScope = scope.$new();
            var current = $route.current;

            // Note: This will also link all children of ng-view that were contained in the original
            // html. If that content contains controllers, ... they could pollute/change the scope.
            // However, using ng-view on an element with additional content does not make sense...
            // Note: We can't remove them in the cloneAttchFn of $transclude as that
            // function is called before linking the content, which would apply child
            // directives to non existing elements.
            var clone = $transclude(newScope, function(clone) {
              $animate.enter(clone, null, currentElement || $element).then(function onNgViewEnter() {
                if (angular.isDefined(autoScrollExp)
                  && (!autoScrollExp || scope.$eval(autoScrollExp))) {
                  $anchorScroll();
                }
              });
              cleanupLastView();
            });

            currentElement = clone;
            currentScope = current.scope = newScope;
            currentScope.$emit('$viewContentLoaded');
            currentScope.$eval(onloadExp);
          } else {
            cleanupLastView();
          }
        }
    }
  };
}

// This directive is called during the $transclude call of the first `ngView` directive.
// It will replace and compile the content of the element with the loaded template.
// We need this directive so that the element content is already filled when
// the link function of another directive on the same element as ngView
// is called.
ngViewFillContentFactory.$inject = ['$compile', '$controller', '$route'];
function ngViewFillContentFactory($compile, $controller, $route) {
  return {
    restrict: 'ECA',
    priority: -400,
    link: function(scope, $element) {
      var current = $route.current,
          locals = current.locals;

      $element.html(locals.$template);

      var link = $compile($element.contents());

      if (current.controller) {
        locals.$scope = scope;
        var controller = $controller(current.controller, locals);
        if (current.controllerAs) {
          scope[current.controllerAs] = controller;
        }
        $element.data('$ngControllerController', controller);
        $element.children().data('$ngControllerController', controller);
      }

      link(scope);
    }
  };
}


})(window, window.angular);
;
/*!
 * ui-select
 * http://github.com/angular-ui/ui-select
 * Version: 0.13.1 - 2015-09-30T05:39:26.655Z
 * License: MIT
 */


(function () {
    "use strict";

    var KEY = {
        TAB: 9,
        ENTER: 13,
        ESC: 27,
        SPACE: 32,
        LEFT: 37,
        UP: 38,
        RIGHT: 39,
        DOWN: 40,
        SHIFT: 16,
        CTRL: 17,
        ALT: 18,
        PAGE_UP: 33,
        PAGE_DOWN: 34,
        HOME: 36,
        END: 35,
        BACKSPACE: 8,
        DELETE: 46,
        COMMAND: 91,

        MAP: {
            91: "COMMAND", 8: "BACKSPACE", 9: "TAB", 13: "ENTER", 16: "SHIFT", 17: "CTRL", 18: "ALT", 19: "PAUSEBREAK", 20: "CAPSLOCK", 27: "ESC", 32: "SPACE", 33: "PAGE_UP", 34: "PAGE_DOWN", 35: "END", 36: "HOME", 37: "LEFT", 38: "UP", 39: "RIGHT", 40: "DOWN", 43: "+", 44: "PRINTSCREEN", 45: "INSERT", 46: "DELETE", 48: "0", 49: "1", 50: "2", 51: "3", 52: "4", 53: "5", 54: "6", 55: "7", 56: "8", 57: "9", 59: ";", 61: "=", 65: "A", 66: "B", 67: "C", 68: "D", 69: "E", 70: "F", 71: "G", 72: "H", 73: "I", 74: "J", 75: "K", 76: "L", 77: "M", 78: "N", 79: "O", 80: "P", 81: "Q", 82: "R", 83: "S", 84: "T", 85: "U", 86: "V", 87: "W", 88: "X", 89: "Y", 90: "Z", 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111: "/", 112: "F1", 113: "F2", 114: "F3", 115: "F4", 116: "F5", 117: "F6", 118: "F7", 119: "F8", 120: "F9", 121: "F10", 122: "F11", 123: "F12", 144: "NUMLOCK", 145: "SCROLLLOCK", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'"
        },

        isControl: function (e) {
            var k = e.which;
            switch (k) {
                case KEY.COMMAND:
                case KEY.SHIFT:
                case KEY.CTRL:
                case KEY.ALT:
                    return true;
            }

            if (e.metaKey) return true;

            return false;
        },
        isFunctionKey: function (k) {
            k = k.which ? k.which : k;
            return k >= 112 && k <= 123;
        },
        isVerticalMovement: function (k) {
            return ~[KEY.UP, KEY.DOWN].indexOf(k);
        },
        isHorizontalMovement: function (k) {
            return ~[KEY.LEFT, KEY.RIGHT, KEY.BACKSPACE, KEY.DELETE].indexOf(k);
        }
    };

    /**
     * Add querySelectorAll() to jqLite.
     *
     * jqLite find() is limited to lookups by tag name.
     * TODO This will change with future versions of AngularJS, to be removed when this happens
     *
     * See jqLite.find - why not use querySelectorAll? https://github.com/angular/angular.js/issues/3586
     * See feat(jqLite): use querySelectorAll instead of getElementsByTagName in jqLite.find https://github.com/angular/angular.js/pull/3598
     */
    if (angular.element.prototype.querySelectorAll === undefined) {
        angular.element.prototype.querySelectorAll = function (selector) {
            return angular.element(this[0].querySelectorAll(selector));
        };
    }

    /**
     * Add closest() to jqLite.
     */
    if (angular.element.prototype.closest === undefined) {
        angular.element.prototype.closest = function (selector) {
            var elem = this[0];
            var matchesSelector = elem.matches || elem.webkitMatchesSelector || elem.mozMatchesSelector || elem.msMatchesSelector;

            while (elem) {
                if (matchesSelector.bind(elem)(selector)) {
                    return elem;
                } else {
                    elem = elem.parentElement;
                }
            }
            return false;
        };
    }

    var latestId = 0;

    var uis = angular.module('ui.select', [])

    .constant('uiSelectConfig', {
        theme: 'bootstrap',
        searchEnabled: true,
        sortable: false,
        placeholder: '', // Empty by default, like HTML tag <select>
        refreshDelay: 1000, // In milliseconds
        closeOnSelect: true,
        dropdownPosition: 'auto',
        generateId: function () {
            return latestId++;
        },
        appendToBody: false
    })

    // See Rename minErr and make it accessible from outside https://github.com/angular/angular.js/issues/6913
    .service('uiSelectMinErr', function () {
        var minErr = angular.$$minErr('ui.select');
        return function () {
            var error = minErr.apply(this, arguments);
            var message = error.message.replace(new RegExp('\nhttp://errors.angularjs.org/.*'), '');
            return new Error(message);
        };
    })

    // Recreates old behavior of ng-transclude. Used internally.
    .directive('uisTranscludeAppend', function () {
        return {
            link: function (scope, element, attrs, ctrl, transclude) {
                transclude(scope, function (clone) {
                    element.append(clone);
                });
            }
        };
    })

    /**
     * Highlights text that matches $select.search.
     *
     * Taken from AngularUI Bootstrap Typeahead
     * See https://github.com/angular-ui/bootstrap/blob/0.10.0/src/typeahead/typeahead.js#L340
     */
    .filter('highlight', function () {
        function escapeRegexp(queryToEscape) {
            return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
        }

        return function (matchItem, query) {
            return query && matchItem ? matchItem.replace(new RegExp(escapeRegexp(query), 'gi'), '<span class="ui-select-highlight">$&</span>') : matchItem;
        };
    })

    /**
     * A read-only equivalent of jQuery's offset function: http://api.jquery.com/offset/
     *
     * Taken from AngularUI Bootstrap Position:
     * See https://github.com/angular-ui/bootstrap/blob/master/src/position/position.js#L70
     */
    .factory('uisOffset',
      ['$document', '$window',
      function ($document, $window) {

          return function (element) {
              var boundingClientRect = element[0].getBoundingClientRect();
              return {
                  width: boundingClientRect.width || element.prop('offsetWidth'),
                  height: boundingClientRect.height || element.prop('offsetHeight'),
                  top: boundingClientRect.top + ($window.pageYOffset || $document[0].documentElement.scrollTop),
                  left: boundingClientRect.left + ($window.pageXOffset || $document[0].documentElement.scrollLeft)
              };
          };
      }]);

    uis.directive('uiSelectChoices',
      ['uiSelectConfig', 'uisRepeatParser', 'uiSelectMinErr', '$compile',
      function (uiSelectConfig, RepeatParser, uiSelectMinErr, $compile) {

          return {
              restrict: 'EA',
              require: '^uiSelect',
              replace: true,
              transclude: true,
              templateUrl: function (tElement) {
                  // Gets theme attribute from parent (ui-select)
                  var theme = tElement.parent().attr('theme') || uiSelectConfig.theme;
                  return theme + '/choices.tpl.html';
              },

              compile: function (tElement, tAttrs) {

                  if (!tAttrs.repeat) throw uiSelectMinErr('repeat', "Expected 'repeat' expression.");

                  return function link(scope, element, attrs, $select, transcludeFn) {

                      // var repeat = RepeatParser.parse(attrs.repeat);
                      var groupByExp = attrs.groupBy;
                      var groupFilterExp = attrs.groupFilter;

                      $select.parseRepeatAttr(attrs.repeat, groupByExp, groupFilterExp); //Result ready at $select.parserResult

                      $select.disableChoiceExpression = attrs.uiDisableChoice;
                      $select.onHighlightCallback = attrs.onHighlight;
                      //open select depend on scroll position - for mobile
                      $select.dropdownPosition = "auto";//attrs.position ? attrs.position.toLowerCase() : uiSelectConfig.dropdownPosition;

                      if (groupByExp) {
                          var groups = element.querySelectorAll('.ui-select-choices-group');
                          if (groups.length !== 1) throw uiSelectMinErr('rows', "Expected 1 .ui-select-choices-group but got '{0}'.", groups.length);
                          groups.attr('ng-repeat', RepeatParser.getGroupNgRepeatExpression());
                      }

                      var choices = element.querySelectorAll('.ui-select-choices-row');
                      if (choices.length !== 1) {
                          throw uiSelectMinErr('rows', "Expected 1 .ui-select-choices-row but got '{0}'.", choices.length);
                      }

                      choices.attr('ng-repeat', $select.parserResult.repeatExpression(groupByExp))
                          .attr('ng-if', '$select.open') //Prevent unnecessary watches when dropdown is closed
                          .attr('ng-click', '$select.select(' + $select.parserResult.itemName + ',false,$event)');

                      var rowsInner = element.querySelectorAll('.ui-select-choices-row-inner');
                      if (rowsInner.length !== 1) throw uiSelectMinErr('rows', "Expected 1 .ui-select-choices-row-inner but got '{0}'.", rowsInner.length);
                      rowsInner.attr('uis-transclude-append', ''); //Adding uisTranscludeAppend directive to row element after choices element has ngRepeat

                      $compile(element, transcludeFn)(scope); //Passing current transcludeFn to be able to append elements correctly from uisTranscludeAppend

                      scope.$watch('$select.search', function (newValue) {
                          if (newValue && !$select.open && $select.multiple) $select.activate(false, true);
                          $select.activeIndex = $select.tagging.isActivated ? -1 : 0;
                          $select.refresh(attrs.refresh);
                      });

                      attrs.$observe('refreshDelay', function () {
                          // $eval() is needed otherwise we get a string instead of a number
                          var refreshDelay = scope.$eval(attrs.refreshDelay);
                          $select.refreshDelay = refreshDelay !== undefined ? refreshDelay : uiSelectConfig.refreshDelay;
                      });
                  };
              }
          };
      }]);

    /**
     * Contains ui-select "intelligence".
     *
     * The goal is to limit dependency on the DOM whenever possible and
     * put as much logic in the controller (instead of the link functions) as possible so it can be easily tested.
     */
    uis.controller('uiSelectCtrl',
      ['$scope', '$element', '$timeout', '$filter', 'uisRepeatParser', 'uiSelectMinErr', 'uiSelectConfig', '$parse',
      function ($scope, $element, $timeout, $filter, RepeatParser, uiSelectMinErr, uiSelectConfig, $parse) {

          var ctrl = this;

          var EMPTY_SEARCH = '';

          ctrl.placeholder = uiSelectConfig.placeholder;
          ctrl.searchEnabled = uiSelectConfig.searchEnabled;
          ctrl.sortable = uiSelectConfig.sortable;
          ctrl.refreshDelay = uiSelectConfig.refreshDelay;

          ctrl.removeSelected = false; //If selected item(s) should be removed from dropdown list
          ctrl.closeOnSelect = true; //Initialized inside uiSelect directive link function
          ctrl.search = EMPTY_SEARCH;

          ctrl.activeIndex = 0; //Dropdown of choices
          ctrl.items = []; //All available choices

          ctrl.open = false;
          ctrl.focus = false;
          ctrl.disabled = false;
          ctrl.selected = undefined;

          ctrl.dropdownPosition = 'auto';

          ctrl.focusser = undefined; //Reference to input element used to handle focus events
          ctrl.resetSearchInput = true;
          ctrl.multiple = undefined; // Initialized inside uiSelect directive link function
          ctrl.disableChoiceExpression = undefined; // Initialized inside uiSelectChoices directive link function
          ctrl.tagging = { isActivated: false, fct: undefined };
          ctrl.taggingTokens = { isActivated: false, tokens: undefined };
          ctrl.lockChoiceExpression = undefined; // Initialized inside uiSelectMatch directive link function
          ctrl.clickTriggeredSelect = false;
          ctrl.$filter = $filter;

          ctrl.searchInput = $element.querySelectorAll('input.ui-select-search');
          if (ctrl.searchInput.length !== 1) {
              throw uiSelectMinErr('searchInput', "Expected 1 input.ui-select-search but got '{0}'.", ctrl.searchInput.length);
          }

          ctrl.isEmpty = function () {
              return angular.isUndefined(ctrl.selected) || ctrl.selected === null || ctrl.selected === '';
          };

          // Most of the time the user does not want to empty the search input when in typeahead mode
          function _resetSearchInput() {
              if (ctrl.resetSearchInput || (ctrl.resetSearchInput === undefined && uiSelectConfig.resetSearchInput)) {
                  ctrl.search = EMPTY_SEARCH;
                  //reset activeIndex
                  if (ctrl.selected && ctrl.items.length && !ctrl.multiple) {
                      ctrl.activeIndex = ctrl.items.indexOf(ctrl.selected);
                  }
              }
          }

          function _groupsFilter(groups, groupNames) {
              var i, j, result = [];
              for (i = 0; i < groupNames.length ; i++) {
                  for (j = 0; j < groups.length ; j++) {
                      if (groups[j].name == [groupNames[i]]) {
                          result.push(groups[j]);
                      }
                  }
              }
              return result;
          }

          // When the user clicks on ui-select, displays the dropdown list
          ctrl.activate = function (initSearchValue, avoidReset) {
              if (!ctrl.disabled && !ctrl.open) {
                  if (!avoidReset) _resetSearchInput();

                  $scope.$broadcast('uis:activate');

                  ctrl.open = true;

                  ctrl.activeIndex = ctrl.activeIndex >= ctrl.items.length ? 0 : ctrl.activeIndex;

                  // ensure that the index is set to zero for tagging variants
                  // that where first option is auto-selected
                  if (ctrl.activeIndex === -1 && ctrl.taggingLabel !== false) {
                      ctrl.activeIndex = 0;
                  }

                  // Give it time to appear before focus
                  $timeout(function () {
                      ctrl.search = initSearchValue || ctrl.search;
                      ctrl.searchInput[0].focus();
                      if (!ctrl.tagging.isActivated && ctrl.items.length > 1) {
                          _ensureHighlightVisible();
                      }
                  });
              }
          };

          ctrl.findGroupByName = function (name) {
              return ctrl.groups && ctrl.groups.filter(function (group) {
                  return group.name === name;
              })[0];
          };

          ctrl.parseRepeatAttr = function (repeatAttr, groupByExp, groupFilterExp) {
              function updateGroups(items) {
                  var groupFn = $scope.$eval(groupByExp);
                  ctrl.groups = [];
                  angular.forEach(items, function (item) {
                      var groupName = angular.isFunction(groupFn) ? groupFn(item) : item[groupFn];
                      var group = ctrl.findGroupByName(groupName);
                      if (group) {
                          group.items.push(item);
                      }
                      else {
                          ctrl.groups.push({ name: groupName, items: [item] });
                      }
                  });
                  if (groupFilterExp) {
                      var groupFilterFn = $scope.$eval(groupFilterExp);
                      if (angular.isFunction(groupFilterFn)) {
                          ctrl.groups = groupFilterFn(ctrl.groups);
                      } else if (angular.isArray(groupFilterFn)) {
                          ctrl.groups = _groupsFilter(ctrl.groups, groupFilterFn);
                      }
                  }
                  ctrl.items = [];
                  ctrl.groups.forEach(function (group) {
                      ctrl.items = ctrl.items.concat(group.items);
                  });
              }

              function setPlainItems(items) {
                  ctrl.items = items;
              }

              ctrl.setItemsFn = groupByExp ? updateGroups : setPlainItems;

              ctrl.parserResult = RepeatParser.parse(repeatAttr);

              ctrl.isGrouped = !!groupByExp;
              ctrl.itemProperty = ctrl.parserResult.itemName;

              //If collection is an Object, convert it to Array

              var originalSource = ctrl.parserResult.source;

              //When an object is used as source, we better create an array and use it as 'source'
              var createArrayFromObject = function () {
                  $scope.$uisSource = Object.keys(originalSource($scope)).map(function (v) {
                      var result = {};
                      result[ctrl.parserResult.keyName] = v;
                      result.value = $scope.peopleObj[v];
                      return result;
                  });
              };

              if (ctrl.parserResult.keyName) { // Check for (key,value) syntax
                  createArrayFromObject();
                  ctrl.parserResult.source = $parse('$uisSource' + ctrl.parserResult.filters);
                  $scope.$watch(originalSource, function (newVal, oldVal) {
                      if (newVal !== oldVal) createArrayFromObject();
                  }, true);
              }

              ctrl.refreshItems = function (data) {
                  data = data || ctrl.parserResult.source($scope);
                  var selectedItems = ctrl.selected;
                  //TODO should implement for single mode removeSelected
                  if (ctrl.isEmpty() || (angular.isArray(selectedItems) && !selectedItems.length) || !ctrl.removeSelected) {
                      ctrl.setItemsFn(data);
                  } else {
                      if (data !== undefined) {
                          var filteredItems = data.filter(function (i) { return selectedItems && selectedItems.indexOf(i) < 0; });
                          ctrl.setItemsFn(filteredItems);
                      }
                  }
                  if (ctrl.dropdownPosition === 'auto' || ctrl.dropdownPosition === 'up') {
                      $scope.calculateDropdownPos();
                  }
              };

              // See https://github.com/angular/angular.js/blob/v1.2.15/src/ng/directive/ngRepeat.js#L259
              $scope.$watchCollection(ctrl.parserResult.source, function (items) {
                  if (items === undefined || items === null) {
                      // If the user specifies undefined or null => reset the collection
                      // Special case: items can be undefined if the user did not initialized the collection on the scope
                      // i.e $scope.addresses = [] is missing
                      ctrl.items = [];
                  } else {
                      if (!angular.isArray(items)) {
                          throw uiSelectMinErr('items', "Expected an array but got '{0}'.", items);
                      } else {
                          //Remove already selected items (ex: while searching)
                          //TODO Should add a test
                          ctrl.refreshItems(items);
                          ctrl.ngModel.$modelValue = null; //Force scope model value and ngModel value to be out of sync to re-run formatters
                      }
                  }
              });

          };

          var _refreshDelayPromise;

          /**
           * Typeahead mode: lets the user refresh the collection using his own function.
           *
           * See Expose $select.search for external / remote filtering https://github.com/angular-ui/ui-select/pull/31
           */
          ctrl.refresh = function (refreshAttr) {
              if (refreshAttr !== undefined) {

                  // Debounce
                  // See https://github.com/angular-ui/bootstrap/blob/0.10.0/src/typeahead/typeahead.js#L155
                  // FYI AngularStrap typeahead does not have debouncing: https://github.com/mgcrea/angular-strap/blob/v2.0.0-rc.4/src/typeahead/typeahead.js#L177
                  if (_refreshDelayPromise) {
                      $timeout.cancel(_refreshDelayPromise);
                  }
                  _refreshDelayPromise = $timeout(function () {
                      $scope.$eval(refreshAttr);
                  }, ctrl.refreshDelay);
              }
          };

          ctrl.isActive = function (itemScope) {
              if (!ctrl.open) {
                  return false;
              }
              var itemIndex = ctrl.items.indexOf(itemScope[ctrl.itemProperty]);
              var isActive = itemIndex === ctrl.activeIndex;

              if (!isActive || (itemIndex < 0 && ctrl.taggingLabel !== false) || (itemIndex < 0 && ctrl.taggingLabel === false)) {
                  return false;
              }

              if (isActive && !angular.isUndefined(ctrl.onHighlightCallback)) {
                  itemScope.$eval(ctrl.onHighlightCallback);
              }

              return isActive;
          };

          ctrl.isDisabled = function (itemScope) {

              if (!ctrl.open) return;

              var itemIndex = ctrl.items.indexOf(itemScope[ctrl.itemProperty]);
              var isDisabled = false;
              var item;

              if (itemIndex >= 0 && !angular.isUndefined(ctrl.disableChoiceExpression)) {
                  item = ctrl.items[itemIndex];
                  isDisabled = !!(itemScope.$eval(ctrl.disableChoiceExpression)); // force the boolean value
                  item._uiSelectChoiceDisabled = isDisabled; // store this for later reference
              }

              return isDisabled;
          };


          // When the user selects an item with ENTER or clicks the dropdown
          ctrl.select = function (item, skipFocusser, $event) {
              if (item === undefined || !item._uiSelectChoiceDisabled) {

                  if (!ctrl.items && !ctrl.search) return;

                  if (!item || !item._uiSelectChoiceDisabled) {
                      if (ctrl.tagging.isActivated) {
                          // if taggingLabel is disabled, we pull from ctrl.search val
                          if (ctrl.taggingLabel === false) {
                              if (ctrl.activeIndex < 0) {
                                  item = ctrl.tagging.fct !== undefined ? ctrl.tagging.fct(ctrl.search) : ctrl.search;
                                  if (!item || angular.equals(ctrl.items[0], item)) {
                                      return;
                                  }
                              } else {
                                  // keyboard nav happened first, user selected from dropdown
                                  item = ctrl.items[ctrl.activeIndex];
                              }
                          } else {
                              // tagging always operates at index zero, taggingLabel === false pushes
                              // the ctrl.search value without having it injected
                              if (ctrl.activeIndex === 0) {
                                  // ctrl.tagging pushes items to ctrl.items, so we only have empty val
                                  // for `item` if it is a detected duplicate
                                  if (item === undefined) return;

                                  // create new item on the fly if we don't already have one;
                                  // use tagging function if we have one
                                  if (ctrl.tagging.fct !== undefined && typeof item === 'string') {
                                      item = ctrl.tagging.fct(ctrl.search);
                                      if (!item) return;
                                      // if item type is 'string', apply the tagging label
                                  } else if (typeof item === 'string') {
                                      // trim the trailing space
                                      item = item.replace(ctrl.taggingLabel, '').trim();
                                  }
                              }
                          }
                          // search ctrl.selected for dupes potentially caused by tagging and return early if found
                          if (ctrl.selected && angular.isArray(ctrl.selected) && ctrl.selected.filter(function (selection) { return angular.equals(selection, item); }).length > 0) {
                              ctrl.close(skipFocusser);
                              return;
                          }
                      }

                      $scope.$broadcast('uis:select', item);

                      var locals = {};
                      locals[ctrl.parserResult.itemName] = item;

                      $timeout(function () {
                          ctrl.onSelectCallback($scope, {
                              $item: item,
                              $model: ctrl.parserResult.modelMapper($scope, locals)
                          });
                      });

                      if (ctrl.closeOnSelect) {
                          ctrl.close(skipFocusser);
                      }
                      if ($event && $event.type === 'click') {
                          ctrl.clickTriggeredSelect = true;
                      }
                  }
              }
          };

          // Closes the dropdown
          ctrl.close = function (skipFocusser) {
              if (!ctrl.open) return;
              if (ctrl.ngModel && ctrl.ngModel.$setTouched) ctrl.ngModel.$setTouched();
              _resetSearchInput();
              ctrl.open = false;

              //This will pop up keyboard on mobiles, so it is disabled.
              //$scope.$broadcast('uis:close', skipFocusser);

          };

          ctrl.setFocus = function () {
              if (!ctrl.focus) ctrl.focusInput[0].focus();
          };

          ctrl.clear = function ($event) {
              ctrl.select(undefined);
              $event.stopPropagation();
              $timeout(function () {
                  ctrl.focusser[0].focus();
              }, 0, false);
          };

          // Toggle dropdown
          ctrl.toggle = function (e) {
              if (ctrl.open) {
                  ctrl.close();
                  e.preventDefault();
                  e.stopPropagation();
              } else {
                  ctrl.activate();
              }
          };

          ctrl.isLocked = function (itemScope, itemIndex) {
              var isLocked, item = ctrl.selected[itemIndex];

              if (item && !angular.isUndefined(ctrl.lockChoiceExpression)) {
                  isLocked = !!(itemScope.$eval(ctrl.lockChoiceExpression)); // force the boolean value
                  item._uiSelectChoiceLocked = isLocked; // store this for later reference
              }

              return isLocked;
          };

          var sizeWatch = null;
          ctrl.sizeSearchInput = function () {

              var input = ctrl.searchInput[0],
                  container = ctrl.searchInput.parent().parent()[0],
                  calculateContainerWidth = function () {
                      // Return the container width only if the search input is visible
                      return container.clientWidth * !!input.offsetParent;
                  },
                  updateIfVisible = function (containerWidth) {
                      if (containerWidth === 0) {
                          return false;
                      }
                      var inputWidth = containerWidth - input.offsetLeft - 10;
                      if (inputWidth < 50) inputWidth = containerWidth;
                      ctrl.searchInput.css('width', inputWidth + 'px');
                      return true;
                  };

              ctrl.searchInput.css('width', '10px');
              $timeout(function () { //Give tags time to render correctly
                  if (sizeWatch === null && !updateIfVisible(calculateContainerWidth())) {
                      sizeWatch = $scope.$watch(calculateContainerWidth, function (containerWidth) {
                          if (updateIfVisible(containerWidth)) {
                              sizeWatch();
                              sizeWatch = null;
                          }
                      });
                  }
              });
          };

          function _handleDropDownSelection(key) {
              var processed = true;
              switch (key) {
                  case KEY.DOWN:
                      if (!ctrl.open && ctrl.multiple) ctrl.activate(false, true); //In case its the search input in 'multiple' mode
                      else if (ctrl.activeIndex < ctrl.items.length - 1) { ctrl.activeIndex++; }
                      break;
                  case KEY.UP:
                      if (!ctrl.open && ctrl.multiple) ctrl.activate(false, true); //In case its the search input in 'multiple' mode
                      else if (ctrl.activeIndex > 0 || (ctrl.search.length === 0 && ctrl.tagging.isActivated && ctrl.activeIndex > -1)) { ctrl.activeIndex--; }
                      break;
                  case KEY.TAB:
                      if (!ctrl.multiple || ctrl.open) ctrl.select(ctrl.items[ctrl.activeIndex], true);
                      break;
                  case KEY.ENTER:
                      if (ctrl.open && (ctrl.tagging.isActivated || ctrl.activeIndex >= 0)) {
                          ctrl.select(ctrl.items[ctrl.activeIndex]); // Make sure at least one dropdown item is highlighted before adding if not in tagging mode
                      } else {
                          ctrl.activate(false, true); //In case its the search input in 'multiple' mode
                      }
                      break;
                  case KEY.ESC:
                      ctrl.close();
                      break;
                  default:
                      processed = false;
              }
              return processed;
          }

          // Bind to keyboard shortcuts
          ctrl.searchInput.on('keydown', function (e) {

              var key = e.which;

              // if(~[KEY.ESC,KEY.TAB].indexOf(key)){
              //   //TODO: SEGURO?
              //   ctrl.close();
              // }

              $scope.$apply(function () {

                  var tagged = false;

                  if (ctrl.items.length > 0 || ctrl.tagging.isActivated) {
                      _handleDropDownSelection(key);
                      if (ctrl.taggingTokens.isActivated) {
                          for (var i = 0; i < ctrl.taggingTokens.tokens.length; i++) {
                              if (ctrl.taggingTokens.tokens[i] === KEY.MAP[e.keyCode]) {
                                  // make sure there is a new value to push via tagging
                                  if (ctrl.search.length > 0) {
                                      tagged = true;
                                  }
                              }
                          }
                          if (tagged) {
                              $timeout(function () {
                                  ctrl.searchInput.triggerHandler('tagged');
                                  var newItem = ctrl.search.replace(KEY.MAP[e.keyCode], '').trim();
                                  if (ctrl.tagging.fct) {
                                      newItem = ctrl.tagging.fct(newItem);
                                  }
                                  if (newItem) ctrl.select(newItem, true);
                              });
                          }
                      }
                  }

              });

              if (KEY.isVerticalMovement(key) && ctrl.items.length > 0) {
                  _ensureHighlightVisible();
              }

              if (key === KEY.ENTER || key === KEY.ESC) {
                  e.preventDefault();
                  e.stopPropagation();
              }

          });

          // If tagging try to split by tokens and add items
          ctrl.searchInput.on('paste', function (e) {
              var data = e.originalEvent.clipboardData.getData('text/plain');
              if (data && data.length > 0 && ctrl.taggingTokens.isActivated && ctrl.tagging.fct) {
                  var items = data.split(ctrl.taggingTokens.tokens[0]); // split by first token only
                  if (items && items.length > 0) {
                      angular.forEach(items, function (item) {
                          var newItem = ctrl.tagging.fct(item);
                          if (newItem) {
                              ctrl.select(newItem, true);
                          }
                      });
                      e.preventDefault();
                      e.stopPropagation();
                  }
              }
          });

          ctrl.searchInput.on('tagged', function () {
              $timeout(function () {
                  _resetSearchInput();
              });
          });

          // See https://github.com/ivaynberg/select2/blob/3.4.6/select2.js#L1431
          function _ensureHighlightVisible() {
              var container = $element.querySelectorAll('.ui-select-choices-content');
              var choices = container.querySelectorAll('.ui-select-choices-row');
              if (choices.length < 1) {
                  throw uiSelectMinErr('choices', "Expected multiple .ui-select-choices-row but got '{0}'.", choices.length);
              }

              if (ctrl.activeIndex < 0) {
                  return;
              }

              var highlighted = choices[ctrl.activeIndex];
              var posY = highlighted.offsetTop + highlighted.clientHeight - container[0].scrollTop;
              var height = container[0].offsetHeight;

              if (posY > height) {
                  container[0].scrollTop += posY - height;
              } else if (posY < highlighted.clientHeight) {
                  if (ctrl.isGrouped && ctrl.activeIndex === 0)
                      container[0].scrollTop = 0; //To make group header visible when going all the way up
                  else
                      container[0].scrollTop -= highlighted.clientHeight - posY;
              }
          }

          $scope.$on('$destroy', function () {
              ctrl.searchInput.off('keyup keydown tagged blur paste');
          });

      }]);

    uis.directive('uiSelect',
      ['$document', 'uiSelectConfig', 'uiSelectMinErr', 'uisOffset', '$compile', '$parse', '$timeout',
      function ($document, uiSelectConfig, uiSelectMinErr, uisOffset, $compile, $parse, $timeout) {

          return {
              restrict: 'EA',
              templateUrl: function (tElement, tAttrs) {
                  var theme = tAttrs.theme || uiSelectConfig.theme;
                  return theme + (angular.isDefined(tAttrs.multiple) ? '/select-multiple.tpl.html' : '/select.tpl.html');
              },
              replace: true,
              transclude: true,
              require: ['uiSelect', '^ngModel'],
              scope: true,

              controller: 'uiSelectCtrl',
              controllerAs: '$select',
              compile: function (tElement, tAttrs) {

                  //Multiple or Single depending if multiple attribute presence
                  if (angular.isDefined(tAttrs.multiple))
                      tElement.append("<ui-select-multiple/>").removeAttr('multiple');
                  else
                      tElement.append("<ui-select-single/>");

                  return function (scope, element, attrs, ctrls, transcludeFn) {

                      var $select = ctrls[0];
                      var ngModel = ctrls[1];

                      $select.generatedId = uiSelectConfig.generateId();
                      $select.baseTitle = attrs.title || 'Select box';
                      $select.focusserTitle = $select.baseTitle + ' focus';
                      $select.focusserId = 'focusser-' + $select.generatedId;

                      $select.closeOnSelect = function () {
                          if (angular.isDefined(attrs.closeOnSelect)) {
                              return $parse(attrs.closeOnSelect)();
                          } else {
                              return uiSelectConfig.closeOnSelect;
                          }
                      }();

                      $select.onSelectCallback = $parse(attrs.onSelect);
                      $select.onRemoveCallback = $parse(attrs.onRemove);

                      //Limit the number of selections allowed
                      $select.limit = (angular.isDefined(attrs.limit)) ? parseInt(attrs.limit, 10) : undefined;

                      //Set reference to ngModel from uiSelectCtrl
                      $select.ngModel = ngModel;

                      $select.choiceGrouped = function (group) {
                          return $select.isGrouped && group && group.name;
                      };

                      if (attrs.tabindex) {
                          attrs.$observe('tabindex', function (value) {
                              $select.focusInput.attr("tabindex", value);
                              element.removeAttr("tabindex");
                          });
                      }

                      scope.$watch('searchEnabled', function () {
                          var searchEnabled = scope.$eval(attrs.searchEnabled);
                          $select.searchEnabled = searchEnabled !== undefined ? searchEnabled : uiSelectConfig.searchEnabled;
                      });

                      scope.$watch('sortable', function () {
                          var sortable = scope.$eval(attrs.sortable);
                          $select.sortable = sortable !== undefined ? sortable : uiSelectConfig.sortable;
                      });

                      attrs.$observe('disabled', function () {
                          // No need to use $eval() (thanks to ng-disabled) since we already get a boolean instead of a string
                          $select.disabled = attrs.disabled !== undefined ? attrs.disabled : false;
                      });

                      attrs.$observe('resetSearchInput', function () {
                          // $eval() is needed otherwise we get a string instead of a boolean
                          var resetSearchInput = scope.$eval(attrs.resetSearchInput);
                          $select.resetSearchInput = resetSearchInput !== undefined ? resetSearchInput : true;
                      });

                      attrs.$observe('tagging', function () {
                          if (attrs.tagging !== undefined) {
                              // $eval() is needed otherwise we get a string instead of a boolean
                              var taggingEval = scope.$eval(attrs.tagging);
                              $select.tagging = { isActivated: true, fct: taggingEval !== true ? taggingEval : undefined };
                          }
                          else {
                              $select.tagging = { isActivated: false, fct: undefined };
                          }
                      });

                      attrs.$observe('taggingLabel', function () {
                          if (attrs.tagging !== undefined) {
                              // check eval for FALSE, in this case, we disable the labels
                              // associated with tagging
                              if (attrs.taggingLabel === 'false') {
                                  $select.taggingLabel = false;
                              }
                              else {
                                  $select.taggingLabel = attrs.taggingLabel !== undefined ? attrs.taggingLabel : '(new)';
                              }
                          }
                      });

                      attrs.$observe('taggingTokens', function () {
                          if (attrs.tagging !== undefined) {
                              var tokens = attrs.taggingTokens !== undefined ? attrs.taggingTokens.split('|') : [',', 'ENTER'];
                              $select.taggingTokens = { isActivated: true, tokens: tokens };
                          }
                      });

                      //Automatically gets focus when loaded
                      if (angular.isDefined(attrs.autofocus)) {
                          $timeout(function () {
                              $select.setFocus();
                          });
                      }

                      //Gets focus based on scope event name (e.g. focus-on='SomeEventName')
                      if (angular.isDefined(attrs.focusOn)) {
                          scope.$on(attrs.focusOn, function () {
                              $timeout(function () {
                                  $select.setFocus();
                              });
                          });
                      }

                      function onDocumentClick(e) {
                          if (!$select.open) return; //Skip it if dropdown is close

                          var contains = false;

                          if (window.jQuery) {
                              // Firefox 3.6 does not support element.contains()
                              // See Node.contains https://developer.mozilla.org/en-US/docs/Web/API/Node.contains
                              contains = window.jQuery.contains(element[0], e.target);
                          } else {
                              contains = element[0].contains(e.target);
                          }

                          if (!contains && !$select.clickTriggeredSelect) {
                              //Will lose focus only with certain targets
                              var focusableControls = ['input', 'button', 'textarea'];
                              var targetController = angular.element(e.target).controller('uiSelect'); //To check if target is other ui-select
                              var skipFocusser = targetController && targetController !== $select; //To check if target is other ui-select
                              if (!skipFocusser) skipFocusser = ~focusableControls.indexOf(e.target.tagName.toLowerCase()); //Check if target is input, button or textarea
                              $select.close(skipFocusser);
                              scope.$digest();
                          }
                          $select.clickTriggeredSelect = false;
                      }

                      // See Click everywhere but here event http://stackoverflow.com/questions/12931369
                      $document.on('click', onDocumentClick);

                      scope.$on('$destroy', function () {
                          $document.off('click', onDocumentClick);
                      });

                      // Move transcluded elements to their correct position in main template
                      transcludeFn(scope, function (clone) {
                          // See Transclude in AngularJS http://blog.omkarpatil.com/2012/11/transclude-in-angularjs.html

                          // One day jqLite will be replaced by jQuery and we will be able to write:
                          // var transcludedElement = clone.filter('.my-class')
                          // instead of creating a hackish DOM element:
                          var transcluded = angular.element('<div>').append(clone);

                          var transcludedMatch = transcluded.querySelectorAll('.ui-select-match');
                          transcludedMatch.removeAttr('ui-select-match'); //To avoid loop in case directive as attr
                          transcludedMatch.removeAttr('data-ui-select-match'); // Properly handle HTML5 data-attributes
                          if (transcludedMatch.length !== 1) {
                              throw uiSelectMinErr('transcluded', "Expected 1 .ui-select-match but got '{0}'.", transcludedMatch.length);
                          }
                          element.querySelectorAll('.ui-select-match').replaceWith(transcludedMatch);

                          var transcludedChoices = transcluded.querySelectorAll('.ui-select-choices');
                          transcludedChoices.removeAttr('ui-select-choices'); //To avoid loop in case directive as attr
                          transcludedChoices.removeAttr('data-ui-select-choices'); // Properly handle HTML5 data-attributes
                          if (transcludedChoices.length !== 1) {
                              throw uiSelectMinErr('transcluded', "Expected 1 .ui-select-choices but got '{0}'.", transcludedChoices.length);
                          }
                          element.querySelectorAll('.ui-select-choices').replaceWith(transcludedChoices);
                      });
                      
                      // Support for appending the select field to the body when its open
                      var appendToBody = scope.$eval(attrs.appendToBody);
                      if (appendToBody !== undefined ? appendToBody : uiSelectConfig.appendToBody) {
                          scope.$watch('$select.open', function (isOpen) {
                              if (isOpen) {
                                  positionDropdown();
                              } else {
                                  resetDropdown();
                              }
                          });

                          // Move the dropdown back to its original location when the scope is destroyed. Otherwise
                          // it might stick around when the user routes away or the select field is otherwise removed
                          scope.$on('$destroy', function () {
                              resetDropdown();
                          });
                      }

                      // Hold on to a reference to the .ui-select-container element for appendToBody support
                      var placeholder = null,
                          originalWidth = '';

                      function positionDropdown() {
                          // Remember the absolute position of the element
                          var offset = uisOffset(element);
                          // Clone the element into a placeholder element to take its original place in the DOM
                          placeholder = angular.element('<div class="ui-select-placeholder"></div>');
                          placeholder[0].style.width = offset.width + 'px';
                          placeholder[0].style.height = offset.height + 'px';
                          element.after(placeholder);

                          // Remember the original value of the element width inline style, so it can be restored
                          // when the dropdown is closed
                          originalWidth = element[0].style.width;

                          // Now move the actual dropdown element to the end of the body
                          $document.find('body').append(element);

                          element[0].style.position = 'absolute';
                          element[0].style.left = offset.left + 'px';
                          element[0].style.top = offset.top + 'px';
                          element[0].style.width = offset.width + 'px';
                      }

                      function resetDropdown() {
                          if (placeholder === null) {
                              // The dropdown has not actually been display yet, so there's nothing to reset
                              return;
                          }

                          // Move the dropdown element back to its original location in the DOM
                          placeholder.replaceWith(element);
                          placeholder = null;

                          element[0].style.position = '';
                          element[0].style.left = '';
                          element[0].style.top = '';
                          element[0].style.width = originalWidth;
                      }

                      // Hold on to a reference to the .ui-select-dropdown element for direction support.
                      var dropdown = null,
                          directionUpClassName = 'direction-up';

                      // Support changing the direction of the dropdown if there isn't enough space to render it.
                      scope.$watch('$select.open', function () {

                          if ($select.dropdownPosition === 'auto' || $select.dropdownPosition === 'up') {
                              scope.calculateDropdownPos();
                          }

                      });

                      var setDropdownPosUp = function (offset, offsetDropdown) {

                          offset = offset || uisOffset(element);
                          offsetDropdown = offsetDropdown || uisOffset(dropdown);

                          dropdown[0].style.position = 'absolute';
                          dropdown[0].style.top = (offsetDropdown.height * -1) + 'px';
                          element.addClass(directionUpClassName);

                      };

                      var setDropdownPosDown = function (offset, offsetDropdown) {

                          element.removeClass(directionUpClassName);

                          offset = offset || uisOffset(element);
                          offsetDropdown = offsetDropdown || uisOffset(dropdown);

                          dropdown[0].style.position = '';
                          dropdown[0].style.top = '';

                      };

                      scope.calculateDropdownPos = function () {

                          if ($select.open) {
                              dropdown = angular.element(element).querySelectorAll('.ui-select-dropdown');
                              if (dropdown.length === 0) {
                                  return;
                              }

                              // Hide the dropdown so there is no flicker until $timeout is done executing.
                              dropdown[0].style.opacity = 0;
                              // Delay positioning the dropdown until all choices have been added so its height is correct.
                              $timeout(function () {

                                  if ($select.dropdownPosition === 'up') {
                                      //Go UP
                                      setDropdownPosUp(offset, offsetDropdown);

                                  } else { //AUTO

                                      element.removeClass(directionUpClassName);

                                      var offset = uisOffset(element);
                                      var offsetDropdown = uisOffset(dropdown);

                                      //https://code.google.com/p/chromium/issues/detail?id=342307#c4
                                      var scrollTop = $document[0].documentElement.scrollTop || $document[0].body.scrollTop; //To make it cross browser (blink, webkit, IE, Firefox).

                                      // Determine if the direction of the dropdown needs to be changed.
                                      if (offset.top + offset.height + offsetDropdown.height > scrollTop + $document[0].documentElement.clientHeight) {
                                          //Go UP
                                          setDropdownPosUp(offset, offsetDropdown);
                                      } else {
                                          //Go DOWN
                                          setDropdownPosDown(offset, offsetDropdown);
                                      }

                                  }

                                  // Display the dropdown once it has been positioned.
                                  dropdown[0].style.opacity = 1;
                              });
                          } else {
                              if (dropdown === null || dropdown.length === 0) {
                                  return;
                              }

                              // Reset the position of the dropdown.
                              dropdown[0].style.position = '';
                              dropdown[0].style.top = '';
                              element.removeClass(directionUpClassName);
                          }
                      };
                  };
              }
          };
      }]);

    uis.directive('uiSelectMatch', ['uiSelectConfig', function (uiSelectConfig) {
        return {
            restrict: 'EA',
            require: '^uiSelect',
            replace: true,
            transclude: true,
            templateUrl: function (tElement) {
                // Gets theme attribute from parent (ui-select)
                var theme = tElement.parent().attr('theme') || uiSelectConfig.theme;
                var multi = tElement.parent().attr('multiple');
                return theme + (multi ? '/match-multiple.tpl.html' : '/match.tpl.html');
            },
            link: function (scope, element, attrs, $select) {
                $select.lockChoiceExpression = attrs.uiLockChoice;
                attrs.$observe('placeholder', function (placeholder) {
                    $select.placeholder = placeholder !== undefined ? placeholder : uiSelectConfig.placeholder;
                });

                function setAllowClear(allow) {
                    $select.allowClear = (angular.isDefined(allow)) ? (allow === '') ? true : (allow.toLowerCase() === 'true') : false;
                }

                attrs.$observe('allowClear', setAllowClear);
                setAllowClear(attrs.allowClear);

                if ($select.multiple) {
                    $select.sizeSearchInput();
                }

            }
        };
    }]);

    uis.directive('uiSelectMultiple', ['uiSelectMinErr', '$timeout', function (uiSelectMinErr, $timeout) {
        return {
            restrict: 'EA',
            require: ['^uiSelect', '^ngModel'],

            controller: ['$scope', '$timeout', function ($scope, $timeout) {

                var ctrl = this,
                    $select = $scope.$select,
                    ngModel;

                //Wait for link fn to inject it 
                $scope.$evalAsync(function () { ngModel = $scope.ngModel; });

                ctrl.activeMatchIndex = -1;

                ctrl.updateModel = function () {
                    ngModel.$setViewValue(Date.now()); //Set timestamp as a unique string to force changes
                    ctrl.refreshComponent();
                };

                ctrl.refreshComponent = function () {
                    //Remove already selected items
                    //e.g. When user clicks on a selection, the selected array changes and 
                    //the dropdown should remove that item
                    $select.refreshItems();
                    $select.sizeSearchInput();
                };

                // Remove item from multiple select
                ctrl.removeChoice = function (index) {

                    var removedChoice = $select.selected[index];

                    // if the choice is locked, can't remove it
                    if (removedChoice._uiSelectChoiceLocked) return;

                    var locals = {};
                    locals[$select.parserResult.itemName] = removedChoice;

                    $select.selected.splice(index, 1);
                    ctrl.activeMatchIndex = -1;
                    $select.sizeSearchInput();

                    // Give some time for scope propagation.
                    $timeout(function () {
                        $select.onRemoveCallback($scope, {
                            $item: removedChoice,
                            $model: $select.parserResult.modelMapper($scope, locals)
                        });
                    });

                    ctrl.updateModel();

                };

                ctrl.getPlaceholder = function () {
                    //Refactor single?
                    if ($select.selected && $select.selected.length) return;
                    return $select.placeholder;
                };


            }],
            controllerAs: '$selectMultiple',

            link: function (scope, element, attrs, ctrls) {

                var $select = ctrls[0];
                var ngModel = scope.ngModel = ctrls[1];
                var $selectMultiple = scope.$selectMultiple;

                //$select.selected = raw selected objects (ignoring any property binding)

                $select.multiple = true;
                $select.removeSelected = true;

                //Input that will handle focus
                $select.focusInput = $select.searchInput;

                //From view --> model
                ngModel.$parsers.unshift(function () {
                    var locals = {},
                        result,
                        resultMultiple = [];
                    for (var j = $select.selected.length - 1; j >= 0; j--) {
                        locals = {};
                        locals[$select.parserResult.itemName] = $select.selected[j];
                        result = $select.parserResult.modelMapper(scope, locals);
                        resultMultiple.unshift(result);
                    }
                    return resultMultiple;
                });

                // From model --> view
                ngModel.$formatters.unshift(function (inputValue) {
                    var data = $select.parserResult.source(scope, { $select: { search: '' } }), //Overwrite $search
                        locals = {},
                        result;
                    if (!data) return inputValue;
                    var resultMultiple = [];
                    var checkFnMultiple = function (list, value) {
                        if (!list || !list.length) return;
                        for (var p = list.length - 1; p >= 0; p--) {
                            locals[$select.parserResult.itemName] = list[p];
                            result = $select.parserResult.modelMapper(scope, locals);
                            if ($select.parserResult.trackByExp) {
                                var matches = /\.(.+)/.exec($select.parserResult.trackByExp);
                                if (matches.length > 0 && result[matches[1]] == value[matches[1]]) {
                                    resultMultiple.unshift(list[p]);
                                    return true;
                                }
                            }
                            if (angular.equals(result, value)) {
                                resultMultiple.unshift(list[p]);
                                return true;
                            }
                        }
                        return false;
                    };
                    if (!inputValue) return resultMultiple; //If ngModel was undefined
                    for (var k = inputValue.length - 1; k >= 0; k--) {
                        //Check model array of currently selected items 
                        if (!checkFnMultiple($select.selected, inputValue[k])) {
                            //Check model array of all items available
                            if (!checkFnMultiple(data, inputValue[k])) {
                                //If not found on previous lists, just add it directly to resultMultiple
                                resultMultiple.unshift(inputValue[k]);
                            }
                        }
                    }
                    return resultMultiple;
                });

                //Watch for external model changes 
                scope.$watchCollection(function () { return ngModel.$modelValue; }, function (newValue, oldValue) {
                    if (oldValue != newValue) {
                        ngModel.$modelValue = null; //Force scope model value and ngModel value to be out of sync to re-run formatters
                        $selectMultiple.refreshComponent();
                    }
                });

                ngModel.$render = function () {
                    // Make sure that model value is array
                    if (!angular.isArray(ngModel.$viewValue)) {
                        // Have tolerance for null or undefined values
                        if (angular.isUndefined(ngModel.$viewValue) || ngModel.$viewValue === null) {
                            $select.selected = [];
                        } else {
                            throw uiSelectMinErr('multiarr', "Expected model value to be array but got '{0}'", ngModel.$viewValue);
                        }
                    }
                    $select.selected = ngModel.$viewValue;
                    scope.$evalAsync(); //To force $digest
                };

                scope.$on('uis:select', function (event, item) {
                    if ($select.selected.length >= $select.limit) {
                        return;
                    }
                    $select.selected.push(item);
                    $selectMultiple.updateModel();
                });

                scope.$on('uis:activate', function () {
                    $selectMultiple.activeMatchIndex = -1;
                });

                scope.$watch('$select.disabled', function (newValue, oldValue) {
                    // As the search input field may now become visible, it may be necessary to recompute its size
                    if (oldValue && !newValue) $select.sizeSearchInput();
                });

                $select.searchInput.on('keydown', function (e) {
                    var key = e.which;
                    scope.$apply(function () {
                        var processed = false;
                        // var tagged = false; //Checkme
                        if (KEY.isHorizontalMovement(key)) {
                            processed = _handleMatchSelection(key);
                        }
                        if (processed && key != KEY.TAB) {
                            //TODO Check si el tab selecciona aun correctamente
                            //Crear test
                            e.preventDefault();
                            e.stopPropagation();
                        }
                    });
                });
                function _getCaretPosition(el) {
                    if (angular.isNumber(el.selectionStart)) return el.selectionStart;
                        // selectionStart is not supported in IE8 and we don't want hacky workarounds so we compromise
                    else return el.value.length;
                }
                // Handles selected options in "multiple" mode
                function _handleMatchSelection(key) {
                    var caretPosition = _getCaretPosition($select.searchInput[0]),
                        length = $select.selected.length,
                        // none  = -1,
                        first = 0,
                        last = length - 1,
                        curr = $selectMultiple.activeMatchIndex,
                        next = $selectMultiple.activeMatchIndex + 1,
                        prev = $selectMultiple.activeMatchIndex - 1,
                        newIndex = curr;

                    if (caretPosition > 0 || ($select.search.length && key == KEY.RIGHT)) return false;

                    $select.close();

                    function getNewActiveMatchIndex() {
                        switch (key) {
                            case KEY.LEFT:
                                // Select previous/first item
                                if (~$selectMultiple.activeMatchIndex) return prev;
                                    // Select last item
                                else return last;
                                break;
                            case KEY.RIGHT:
                                // Open drop-down
                                if (!~$selectMultiple.activeMatchIndex || curr === last) {
                                    $select.activate();
                                    return false;
                                }
                                    // Select next/last item
                                else return next;
                                break;
                            case KEY.BACKSPACE:
                                // Remove selected item and select previous/first
                                if (~$selectMultiple.activeMatchIndex) {
                                    $selectMultiple.removeChoice(curr);
                                    return prev;
                                }
                                    // Select last item
                                else return last;
                                break;
                            case KEY.DELETE:
                                // Remove selected item and select next item
                                if (~$selectMultiple.activeMatchIndex) {
                                    $selectMultiple.removeChoice($selectMultiple.activeMatchIndex);
                                    return curr;
                                }
                                else return false;
                        }
                    }

                    newIndex = getNewActiveMatchIndex();

                    if (!$select.selected.length || newIndex === false) $selectMultiple.activeMatchIndex = -1;
                    else $selectMultiple.activeMatchIndex = Math.min(last, Math.max(first, newIndex));

                    return true;
                }

                $select.searchInput.on('keyup', function (e) {

                    if (!KEY.isVerticalMovement(e.which)) {
                        scope.$evalAsync(function () {
                            $select.activeIndex = $select.taggingLabel === false ? -1 : 0;
                        });
                    }
                    // Push a "create new" item into array if there is a search string
                    if ($select.tagging.isActivated && $select.search.length > 0) {

                        // return early with these keys
                        if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC || KEY.isVerticalMovement(e.which)) {
                            return;
                        }
                        // always reset the activeIndex to the first item when tagging
                        $select.activeIndex = $select.taggingLabel === false ? -1 : 0;
                        // taggingLabel === false bypasses all of this
                        if ($select.taggingLabel === false) return;

                        var items = angular.copy($select.items);
                        var stashArr = angular.copy($select.items);
                        var newItem;
                        var item;
                        var hasTag = false;
                        var dupeIndex = -1;
                        var tagItems;
                        var tagItem;

                        // case for object tagging via transform `$select.tagging.fct` function
                        if ($select.tagging.fct !== undefined) {
                            tagItems = $select.$filter('filter')(items, { 'isTag': true });
                            if (tagItems.length > 0) {
                                tagItem = tagItems[0];
                            }
                            // remove the first element, if it has the `isTag` prop we generate a new one with each keyup, shaving the previous
                            if (items.length > 0 && tagItem) {
                                hasTag = true;
                                items = items.slice(1, items.length);
                                stashArr = stashArr.slice(1, stashArr.length);
                            }
                            newItem = $select.tagging.fct($select.search);
                            newItem.isTag = true;
                            // verify the the tag doesn't match the value of an existing item
                            if (stashArr.filter(function (origItem) { return angular.equals(origItem, $select.tagging.fct($select.search)); }).length > 0) {
                                return;
                            }
                            newItem.isTag = true;
                            // handle newItem string and stripping dupes in tagging string context
                        } else {
                            // find any tagging items already in the $select.items array and store them
                            tagItems = $select.$filter('filter')(items, function (item) {
                                return item.match($select.taggingLabel);
                            });
                            if (tagItems.length > 0) {
                                tagItem = tagItems[0];
                            }
                            item = items[0];
                            // remove existing tag item if found (should only ever be one tag item)
                            if (item !== undefined && items.length > 0 && tagItem) {
                                hasTag = true;
                                items = items.slice(1, items.length);
                                stashArr = stashArr.slice(1, stashArr.length);
                            }
                            newItem = $select.search + ' ' + $select.taggingLabel;
                            if (_findApproxDupe($select.selected, $select.search) > -1) {
                                return;
                            }
                            // verify the the tag doesn't match the value of an existing item from
                            // the searched data set or the items already selected
                            if (_findCaseInsensitiveDupe(stashArr.concat($select.selected))) {
                                // if there is a tag from prev iteration, strip it / queue the change
                                // and return early
                                if (hasTag) {
                                    items = stashArr;
                                    scope.$evalAsync(function () {
                                        $select.activeIndex = 0;
                                        $select.items = items;
                                    });
                                }
                                return;
                            }
                            if (_findCaseInsensitiveDupe(stashArr)) {
                                // if there is a tag from prev iteration, strip it
                                if (hasTag) {
                                    $select.items = stashArr.slice(1, stashArr.length);
                                }
                                return;
                            }
                        }
                        if (hasTag) dupeIndex = _findApproxDupe($select.selected, newItem);
                        // dupe found, shave the first item
                        if (dupeIndex > -1) {
                            items = items.slice(dupeIndex + 1, items.length - 1);
                        } else {
                            items = [];
                            items.push(newItem);
                            items = items.concat(stashArr);
                        }
                        scope.$evalAsync(function () {
                            $select.activeIndex = 0;
                            $select.items = items;
                        });
                    }
                });
                function _findCaseInsensitiveDupe(arr) {
                    if (arr === undefined || $select.search === undefined) {
                        return false;
                    }
                    var hasDupe = arr.filter(function (origItem) {
                        if ($select.search.toUpperCase() === undefined || origItem === undefined) {
                            return false;
                        }
                        return origItem.toUpperCase() === $select.search.toUpperCase();
                    }).length > 0;

                    return hasDupe;
                }
                function _findApproxDupe(haystack, needle) {
                    var dupeIndex = -1;
                    if (angular.isArray(haystack)) {
                        var tempArr = angular.copy(haystack);
                        for (var i = 0; i < tempArr.length; i++) {
                            // handle the simple string version of tagging
                            if ($select.tagging.fct === undefined) {
                                // search the array for the match
                                if (tempArr[i] + ' ' + $select.taggingLabel === needle) {
                                    dupeIndex = i;
                                }
                                // handle the object tagging implementation
                            } else {
                                var mockObj = tempArr[i];
                                mockObj.isTag = true;
                                if (angular.equals(mockObj, needle)) {
                                    dupeIndex = i;
                                }
                            }
                        }
                    }
                    return dupeIndex;
                }

                $select.searchInput.on('blur', function () {
                    $timeout(function () {
                        $selectMultiple.activeMatchIndex = -1;
                    });
                });

            }
        };
    }]);

    uis.directive('uiSelectSingle', ['$timeout', '$compile', function ($timeout, $compile) {
        return {
            restrict: 'EA',
            require: ['^uiSelect', '^ngModel'],
            link: function (scope, element, attrs, ctrls) {

                var $select = ctrls[0];
                var ngModel = ctrls[1];

                //From view --> model
                ngModel.$parsers.unshift(function (inputValue) {
                    var locals = {},
                        result;
                    locals[$select.parserResult.itemName] = inputValue;
                    result = $select.parserResult.modelMapper(scope, locals);
                    return result;
                });

                //From model --> view
                ngModel.$formatters.unshift(function (inputValue) {
                    var data = $select.parserResult.source(scope, { $select: { search: '' } }), //Overwrite $search
                        locals = {},
                        result;
                    if (data) {
                        var checkFnSingle = function (d) {
                            locals[$select.parserResult.itemName] = d;
                            result = $select.parserResult.modelMapper(scope, locals);
                            return result == inputValue;
                        };
                        //If possible pass same object stored in $select.selected
                        if ($select.selected && checkFnSingle($select.selected)) {
                            return $select.selected;
                        }
                        for (var i = data.length - 1; i >= 0; i--) {
                            if (checkFnSingle(data[i])) return data[i];
                        }
                    }
                    return inputValue;
                });

                //Update viewValue if model change
                scope.$watch('$select.selected', function (newValue) {
                    if (ngModel.$viewValue !== newValue) {
                        ngModel.$setViewValue(newValue);
                    }
                });

                ngModel.$render = function () {
                    $select.selected = ngModel.$viewValue;
                };

                scope.$on('uis:select', function (event, item) {
                    $select.selected = item;
                });

                scope.$on('uis:close', function (event, skipFocusser) {
                    $timeout(function () {
                        $select.focusser.prop('disabled', false);
                        if (!skipFocusser) $select.focusser[0].focus();
                    }, 0, false);
                });

                scope.$on('uis:activate', function () {
                    focusser.prop('disabled', true); //Will reactivate it on .close()
                });

                //Idea from: https://github.com/ivaynberg/select2/blob/79b5bf6db918d7560bdd959109b7bcfb47edaf43/select2.js#L1954
                var focusser = angular.element("<input ng-disabled='$select.disabled' class='ui-select-focusser ui-select-offscreen' type='text' id='{{ $select.focusserId }}' aria-label='{{ $select.focusserTitle }}' aria-haspopup='true' role='button' />");
                $compile(focusser)(scope);
                $select.focusser = focusser;

                //Input that will handle focus
                $select.focusInput = focusser;

                element.parent().append(focusser);
                focusser.bind("focus", function () {
                    scope.$evalAsync(function () {
                        $select.focus = true;
                    });
                });
                focusser.bind("blur", function () {
                    scope.$evalAsync(function () {
                        $select.focus = false;
                    });
                });
                focusser.bind("keydown", function (e) {

                    if (e.which === KEY.BACKSPACE) {
                        e.preventDefault();
                        e.stopPropagation();
                        $select.select(undefined);
                        scope.$apply();
                        return;
                    }

                    if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC) {
                        return;
                    }

                    if (e.which == KEY.DOWN || e.which == KEY.UP || e.which == KEY.ENTER || e.which == KEY.SPACE) {
                        e.preventDefault();
                        e.stopPropagation();
                        $select.activate();
                    }

                    scope.$digest();
                });

                focusser.bind("keyup input", function (e) {

                    if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC || e.which == KEY.ENTER || e.which === KEY.BACKSPACE) {
                        return;
                    }

                    $select.activate(focusser.val()); //User pressed some regular key, so we pass it to the search input
                    focusser.val('');
                    scope.$digest();

                });


            }
        };
    }]);
    // Make multiple matches sortable
    uis.directive('uiSelectSort', ['$timeout', 'uiSelectConfig', 'uiSelectMinErr', function ($timeout, uiSelectConfig, uiSelectMinErr) {
        return {
            require: '^uiSelect',
            link: function (scope, element, attrs, $select) {
                if (scope[attrs.uiSelectSort] === null) {
                    throw uiSelectMinErr('sort', "Expected a list to sort");
                }

                var options = angular.extend({
                    axis: 'horizontal'
                },
                  scope.$eval(attrs.uiSelectSortOptions));

                var axis = options.axis,
                  draggingClassName = 'dragging',
                  droppingClassName = 'dropping',
                  droppingBeforeClassName = 'dropping-before',
                  droppingAfterClassName = 'dropping-after';

                scope.$watch(function () {
                    return $select.sortable;
                }, function (n) {
                    if (n) {
                        element.attr('draggable', true);
                    } else {
                        element.removeAttr('draggable');
                    }
                });

                element.on('dragstart', function (e) {
                    element.addClass(draggingClassName);

                    (e.dataTransfer || e.originalEvent.dataTransfer).setData('text/plain', scope.$index);
                });

                element.on('dragend', function () {
                    element.removeClass(draggingClassName);
                });

                var move = function (from, to) {
                    /*jshint validthis: true */
                    this.splice(to, 0, this.splice(from, 1)[0]);
                };

                var dragOverHandler = function (e) {
                    e.preventDefault();

                    var offset = axis === 'vertical' ? e.offsetY || e.layerY || (e.originalEvent ? e.originalEvent.offsetY : 0) : e.offsetX || e.layerX || (e.originalEvent ? e.originalEvent.offsetX : 0);

                    if (offset < (this[axis === 'vertical' ? 'offsetHeight' : 'offsetWidth'] / 2)) {
                        element.removeClass(droppingAfterClassName);
                        element.addClass(droppingBeforeClassName);

                    } else {
                        element.removeClass(droppingBeforeClassName);
                        element.addClass(droppingAfterClassName);
                    }
                };

                var dropTimeout;

                var dropHandler = function (e) {
                    e.preventDefault();

                    var droppedItemIndex = parseInt((e.dataTransfer || e.originalEvent.dataTransfer).getData('text/plain'), 10);

                    // prevent event firing multiple times in firefox
                    $timeout.cancel(dropTimeout);
                    dropTimeout = $timeout(function () {
                        _dropHandler(droppedItemIndex);
                    }, 20);
                };

                var _dropHandler = function (droppedItemIndex) {
                    var theList = scope.$eval(attrs.uiSelectSort),
                      itemToMove = theList[droppedItemIndex],
                      newIndex = null;

                    if (element.hasClass(droppingBeforeClassName)) {
                        if (droppedItemIndex < scope.$index) {
                            newIndex = scope.$index - 1;
                        } else {
                            newIndex = scope.$index;
                        }
                    } else {
                        if (droppedItemIndex < scope.$index) {
                            newIndex = scope.$index;
                        } else {
                            newIndex = scope.$index + 1;
                        }
                    }

                    move.apply(theList, [droppedItemIndex, newIndex]);

                    scope.$apply(function () {
                        scope.$emit('uiSelectSort:change', {
                            array: theList,
                            item: itemToMove,
                            from: droppedItemIndex,
                            to: newIndex
                        });
                    });

                    element.removeClass(droppingClassName);
                    element.removeClass(droppingBeforeClassName);
                    element.removeClass(droppingAfterClassName);

                    element.off('drop', dropHandler);
                };

                element.on('dragenter', function () {
                    if (element.hasClass(draggingClassName)) {
                        return;
                    }

                    element.addClass(droppingClassName);

                    element.on('dragover', dragOverHandler);
                    element.on('drop', dropHandler);
                });

                element.on('dragleave', function (e) {
                    if (e.target != element) {
                        return;
                    }
                    element.removeClass(droppingClassName);
                    element.removeClass(droppingBeforeClassName);
                    element.removeClass(droppingAfterClassName);

                    element.off('dragover', dragOverHandler);
                    element.off('drop', dropHandler);
                });
            }
        };
    }]);

    /**
     * Parses "repeat" attribute.
     *
     * Taken from AngularJS ngRepeat source code
     * See https://github.com/angular/angular.js/blob/v1.2.15/src/ng/directive/ngRepeat.js#L211
     *
     * Original discussion about parsing "repeat" attribute instead of fully relying on ng-repeat:
     * https://github.com/angular-ui/ui-select/commit/5dd63ad#commitcomment-5504697
     */

    uis.service('uisRepeatParser', ['uiSelectMinErr', '$parse', function (uiSelectMinErr, $parse) {
        var self = this;

        /**
         * Example:
         * expression = "address in addresses | filter: {street: $select.search} track by $index"
         * itemName = "address",
         * source = "addresses | filter: {street: $select.search}",
         * trackByExp = "$index",
         */
        self.parse = function (expression) {


            var match;
            var isObjectCollection = /\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)/.test(expression);
            // If an array is used as collection

            // if (isObjectCollection){
            //00000000000000000000000000000111111111000000000000000222222222222220033333333333333333333330000444444444444444444000000000000000556666660000077777777777755000000000000000000000088888880000000
            match = expression.match(/^\s*(?:([\s\S]+?)\s+as\s+)?(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(([\w]+)?\s*(|\s*[\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);

            // 1 Alias
            // 2 Item
            // 3 Key on (key,value)
            // 4 Value on (key,value)
            // 5 Collection expresion (only used when using an array collection)
            // 6 Object that will be converted to Array when using (key,value) syntax
            // 7 Filters that will be applied to #6 when using (key,value) syntax
            // 8 Track by

            if (!match) {
                throw uiSelectMinErr('iexp', "Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",
                        expression);
            }
            if (!match[6] && isObjectCollection) {
                throw uiSelectMinErr('iexp', "Expected expression in form of '_item_ as (_key_, _item_) in _ObjCollection_ [ track by _id_]' but got '{0}'.",
                        expression);
            }

            return {
                itemName: match[4] || match[2], // (lhs) Left-hand side,
                keyName: match[3], //for (key, value) syntax
                source: $parse(!match[3] ? match[5] : match[6]),
                sourceName: match[6],
                filters: match[7],
                trackByExp: match[8],
                modelMapper: $parse(match[1] || match[4] || match[2]),
                repeatExpression: function (grouped) {
                    var expression = this.itemName + ' in ' + (grouped ? '$group.items' : '$select.items');
                    if (this.trackByExp) {
                        expression += ' track by ' + this.trackByExp;
                    }
                    return expression;
                }
            };

        };

        self.getGroupNgRepeatExpression = function () {
            return '$group in $select.groups';
        };

    }]);

}());
angular.module("ui.select").run(["$templateCache", function ($templateCache) {
    $templateCache.put("bootstrap/choices.tpl.html", "<ul class=\"ui-select-choices ui-select-choices-content ui-select-dropdown dropdown-menu\" role=\"listbox\" ng-show=\"$select.items.length > 0\"><li class=\"ui-select-choices-group\" id=\"ui-select-choices-{{ $select.generatedId }}\"><div class=\"divider\" ng-show=\"$select.isGrouped && $index > 0\"></div><div ng-show=\"$select.isGrouped\" class=\"ui-select-choices-group-label dropdown-header\" ng-bind=\"$group.name\"></div><div id=\"ui-select-choices-row-{{ $select.generatedId }}-{{$index}}\" class=\"ui-select-choices-row\" ng-class=\"{active: $select.isActive(this), disabled: $select.isDisabled(this)}\" role=\"option\"><a href=\"javascript:void(0)\" class=\"ui-select-choices-row-inner\"></a></div></li></ul>");
    $templateCache.put("bootstrap/match-multiple.tpl.html", "<span class=\"ui-select-match\"><span ng-repeat=\"$item in $select.selected\"><span class=\"ui-select-match-item btn btn-default btn-xs\" tabindex=\"-1\" type=\"button\" ng-disabled=\"$select.disabled\" ng-click=\"$selectMultiple.activeMatchIndex = $index;\" ng-class=\"{\'btn-primary\':$selectMultiple.activeMatchIndex === $index, \'select-locked\':$select.isLocked(this, $index)}\" ui-select-sort=\"$select.selected\"><span class=\"close ui-select-match-close\" ng-hide=\"$select.disabled\" ng-click=\"$selectMultiple.removeChoice($index)\">&nbsp;&times;</span> <span uis-transclude-append=\"\"></span></span></span></span>");
    $templateCache.put("bootstrap/match.tpl.html", "<div class=\"ui-select-match\" ng-hide=\"$select.open\" ng-disabled=\"$select.disabled\" ng-class=\"{\'btn-default-focus\':$select.focus}\"><span tabindex=\"-1\" class=\"btn btn-default form-control ui-select-toggle\" aria-label=\"{{ $select.baseTitle }} activate\" ng-disabled=\"$select.disabled\" ng-click=\"$select.activate()\" style=\"outline: 0;\"><span ng-show=\"$select.isEmpty()\" class=\"ui-select-placeholder text-muted\">{{$select.placeholder}}</span> <span ng-hide=\"$select.isEmpty()\" class=\"ui-select-match-text pull-left\" ng-class=\"{\'ui-select-allow-clear\': $select.allowClear && !$select.isEmpty()}\" ng-transclude=\"\"></span> <i class=\"caret pull-right\" ng-click=\"$select.toggle($event)\"></i> <a ng-show=\"$select.allowClear && !$select.isEmpty()\" aria-label=\"{{ $select.baseTitle }} clear\" style=\"margin-right: 10px\" ng-click=\"$select.clear($event)\" class=\"btn btn-xs btn-link pull-right\"><i class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></i></a></span></div>");
    $templateCache.put("bootstrap/select-multiple.tpl.html", "<div class=\"ui-select-container ui-select-multiple ui-select-bootstrap dropdown form-control\" ng-class=\"{open: $select.open}\"><div><div class=\"ui-select-match\"></div><input type=\"text\" autocomplete=\"false\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" class=\"ui-select-search input-xs\" placeholder=\"{{$selectMultiple.getPlaceholder()}}\" ng-disabled=\"$select.disabled\" ng-hide=\"$select.disabled\" ng-click=\"$select.activate()\" ng-model=\"$select.search\" role=\"combobox\" aria-label=\"{{ $select.baseTitle }}\" ondrop=\"return false;\"></div><div class=\"ui-select-choices\"></div></div>");
    //$templateCache.put("bootstrap/select.tpl.html", "<div class=\"ui-select-container ui-select-bootstrap dropdown\" ng-class=\"{open: $select.open}\"><div class=\"ui-select-match\"></div><input type=\"text\" autocomplete=\"false\" tabindex=\"-1\" aria-expanded=\"true\" aria-label=\"{{ $select.baseTitle }}\" aria-owns=\"ui-select-choices-{{ $select.generatedId }}\" aria-activedescendant=\"ui-select-choices-row-{{ $select.generatedId }}-{{ $select.activeIndex }}\" class=\"form-control ui-select-search\" placeholder=\"{{$select.placeholder}}\" ng-model=\"$select.search\" ng-show=\"$select.searchEnabled && $select.open\"><div class=\"ui-select-choices\"></div></div>");
    $templateCache.put("bootstrap/select.tpl.html", "<div class=\"ui-select-container ui-select-bootstrap dropdown\" ng-class=\"{open: $select.open}\"><div class=\"ui-select-match\"></div><input type=\"text\" autocomplete=\"off\" tabindex=\"-1\" aria-expanded=\"true\" aria-label=\"{{ $select.baseTitle }}\" aria-owns=\"ui-select-choices-{{ $select.generatedId }}\" aria-activedescendant=\"ui-select-choices-row-{{ $select.generatedId }}-{{ $select.activeIndex }}\" class=\"form-control ui-select-search\" placeholder=\"{{$select.placeholder}}\" readonly ng-model=\"$select.search\" ng-show=\"$select.searchEnabled && $select.open\"><div class=\"ui-select-choices\"></div></div>");
    $templateCache.put("select2/choices.tpl.html", "<ul class=\"ui-select-choices ui-select-choices-content select2-results\"><li class=\"ui-select-choices-group\" ng-class=\"{\'select2-result-with-children\': $select.choiceGrouped($group) }\"><div ng-show=\"$select.choiceGrouped($group)\" class=\"ui-select-choices-group-label select2-result-label\" ng-bind=\"$group.name\"></div><ul role=\"listbox\" id=\"ui-select-choices-{{ $select.generatedId }}\" ng-class=\"{\'select2-result-sub\': $select.choiceGrouped($group), \'select2-result-single\': !$select.choiceGrouped($group) }\"><li role=\"option\" id=\"ui-select-choices-row-{{ $select.generatedId }}-{{$index}}\" class=\"ui-select-choices-row\" ng-class=\"{\'select2-highlighted\': $select.isActive(this), \'select2-disabled\': $select.isDisabled(this)}\"><div class=\"select2-result-label ui-select-choices-row-inner\"></div></li></ul></li></ul>");
    $templateCache.put("select2/match-multiple.tpl.html", "<span class=\"ui-select-match\"><li class=\"ui-select-match-item select2-search-choice\" ng-repeat=\"$item in $select.selected\" ng-class=\"{\'select2-search-choice-focus\':$selectMultiple.activeMatchIndex === $index, \'select2-locked\':$select.isLocked(this, $index)}\" ui-select-sort=\"$select.selected\"><span uis-transclude-append=\"\"></span> <a href=\"javascript:;\" class=\"ui-select-match-close select2-search-choice-close\" ng-click=\"$selectMultiple.removeChoice($index)\" tabindex=\"-1\"></a></li></span>");
    $templateCache.put("select2/match.tpl.html", "<a class=\"select2-choice ui-select-match\" ng-class=\"{\'select2-default\': $select.isEmpty()}\" ng-click=\"$select.toggle($event)\" aria-label=\"{{ $select.baseTitle }} select\"><span ng-show=\"$select.isEmpty()\" class=\"select2-chosen\">{{$select.placeholder}}</span> <span ng-hide=\"$select.isEmpty()\" class=\"select2-chosen\" ng-transclude=\"\"></span> <abbr ng-if=\"$select.allowClear && !$select.isEmpty()\" class=\"select2-search-choice-close\" ng-click=\"$select.clear($event)\"></abbr> <span class=\"select2-arrow ui-select-toggle\"><b></b></span></a>");
    $templateCache.put("select2/select-multiple.tpl.html", "<div class=\"ui-select-container ui-select-multiple select2 select2-container select2-container-multi\" ng-class=\"{\'select2-container-active select2-dropdown-open open\': $select.open, \'select2-container-disabled\': $select.disabled}\"><ul class=\"select2-choices\"><span class=\"ui-select-match\"></span><li class=\"select2-search-field\"><input type=\"text\" autocomplete=\"false\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" role=\"combobox\" aria-expanded=\"true\" aria-owns=\"ui-select-choices-{{ $select.generatedId }}\" aria-label=\"{{ $select.baseTitle }}\" aria-activedescendant=\"ui-select-choices-row-{{ $select.generatedId }}-{{ $select.activeIndex }}\" class=\"select2-input ui-select-search\" placeholder=\"{{$selectMultiple.getPlaceholder()}}\" ng-disabled=\"$select.disabled\" ng-hide=\"$select.disabled\" ng-model=\"$select.search\" ng-click=\"$select.activate()\" style=\"width: 34px;\" ondrop=\"return false;\"></li></ul><div class=\"ui-select-dropdown select2-drop select2-with-searchbox select2-drop-active\" ng-class=\"{\'select2-display-none\': !$select.open}\"><div class=\"ui-select-choices\"></div></div></div>");
    $templateCache.put("select2/select.tpl.html", "<div class=\"ui-select-container select2 select2-container\" ng-class=\"{\'select2-container-active select2-dropdown-open open\': $select.open, \'select2-container-disabled\': $select.disabled, \'select2-container-active\': $select.focus, \'select2-allowclear\': $select.allowClear && !$select.isEmpty()}\"><div class=\"ui-select-match\"></div><div class=\"ui-select-dropdown select2-drop select2-with-searchbox select2-drop-active\" ng-class=\"{\'select2-display-none\': !$select.open}\"><div class=\"select2-search\" ng-show=\"$select.searchEnabled\"><input type=\"text\" autocomplete=\"false\" autocorrect=\"false\" autocapitalize=\"off\" spellcheck=\"false\" role=\"combobox\" aria-expanded=\"true\" aria-owns=\"ui-select-choices-{{ $select.generatedId }}\" aria-label=\"{{ $select.baseTitle }}\" aria-activedescendant=\"ui-select-choices-row-{{ $select.generatedId }}-{{ $select.activeIndex }}\" class=\"ui-select-search select2-input\" ng-model=\"$select.search\"></div><div class=\"ui-select-choices\"></div></div></div>");
    $templateCache.put("selectize/choices.tpl.html", "<div ng-show=\"$select.open\" class=\"ui-select-choices ui-select-dropdown selectize-dropdown single\"><div class=\"ui-select-choices-content selectize-dropdown-content\"><div class=\"ui-select-choices-group optgroup\" role=\"listbox\"><div ng-show=\"$select.isGrouped\" class=\"ui-select-choices-group-label optgroup-header\" ng-bind=\"$group.name\"></div><div role=\"option\" class=\"ui-select-choices-row\" ng-class=\"{active: $select.isActive(this), disabled: $select.isDisabled(this)}\"><div class=\"option ui-select-choices-row-inner\" data-selectable=\"\"></div></div></div></div></div>");
    $templateCache.put("selectize/match.tpl.html", "<div ng-hide=\"($select.open || $select.isEmpty())\" class=\"ui-select-match\" ng-transclude=\"\"></div>");
    $templateCache.put("selectize/select.tpl.html", "<div class=\"ui-select-container selectize-control single\" ng-class=\"{\'open\': $select.open}\"><div class=\"selectize-input\" ng-class=\"{\'focus\': $select.open, \'disabled\': $select.disabled, \'selectize-focus\' : $select.focus}\" ng-click=\"$select.activate()\"><div class=\"ui-select-match\"></div><input type=\"text\" autocomplete=\"false\" tabindex=\"-1\" class=\"ui-select-search ui-select-toggle\" ng-click=\"$select.toggle($event)\" placeholder=\"{{$select.placeholder}}\" ng-model=\"$select.search\" ng-hide=\"!$select.searchEnabled || ($select.selected && !$select.open)\" ng-disabled=\"$select.disabled\" aria-label=\"{{ $select.baseTitle }}\"></div><div class=\"ui-select-choices\"></div></div>");
}]);;
/*
 jQuery UI Slider plugin wrapper
*/
angular.module('ui.slider', []).value('uiSliderConfig',{}).directive('uiSlider', ['uiSliderConfig', '$timeout', function(uiSliderConfig, $timeout) {
    uiSliderConfig = uiSliderConfig || {};
    return {
        require: 'ngModel',
        compile: function() {
            var preLink = function (scope, elm, attrs, ngModel) {

                function parseNumber(n, decimals) {
                    return (decimals) ? parseFloat(n) : parseInt(n, 10);
                }

                var directiveOptions = angular.copy(scope.$eval(attrs.uiSlider));
                var options = angular.extend(directiveOptions || {}, uiSliderConfig);
                // Object holding range values
                var prevRangeValues = {
                    min: null,
                    max: null
                };

                // convenience properties
                var properties = ['min', 'max', 'step', 'lowerBound', 'upperBound'];
                var useDecimals = (!angular.isUndefined(attrs.useDecimals)) ? true : false;

                var init = function() {
                    // When ngModel is assigned an array of values then range is expected to be true.
                    // Warn user and change range to true else an error occurs when trying to drag handle
                    if (angular.isArray(ngModel.$viewValue) && options.range !== true) {
                        console.warn('Change your range option of ui-slider. When assigning ngModel an array of values then the range option should be set to true.');
                        options.range = true;
                    }

                    // Ensure the convenience properties are passed as options if they're defined
                    // This avoids init ordering issues where the slider's initial state (eg handle
                    // position) is calculated using widget defaults
                    // Note the properties take precedence over any duplicates in options
                    angular.forEach(properties, function(property) {
                        if (angular.isDefined(attrs[property])) {
                            options[property] = parseNumber(attrs[property], useDecimals);
                        }
                    });

                    elm.slider(options);
                    init = angular.noop;
                };

                // Find out if decimals are to be used for slider
                angular.forEach(properties, function(property) {
                    // support {{}} and watch for updates
                    attrs.$observe(property, function(newVal) {
                        if (!!newVal) {
                            init();
                            options[property] = parseNumber(newVal, useDecimals);
                            elm.slider('option', property, parseNumber(newVal, useDecimals));
                            ngModel.$render();
                        }
                    });
                });
                attrs.$observe('disabled', function(newVal) {
                    init();
                    elm.slider('option', 'disabled', !!newVal);
                });

                // Watch ui-slider (byVal) for changes and update
                scope.$watch(attrs.uiSlider, function(newVal) {
                    init();
                    if(newVal !== undefined) {
                      elm.slider('option', newVal);
                    }
                }, true);

                // Late-bind to prevent compiler clobbering
                $timeout(init, 0, true);

                // Update model value from slider
                elm.bind('slide', function(event, ui) {
                    var valuesChanged;

                    if (ui.values) {
                        var boundedValues = ui.values.slice();

                        if (options.lowerBound && boundedValues[0] < options.lowerBound) {
                            boundedValues[0] = Math.max(boundedValues[0], options.lowerBound);
                        }
                        if (options.upperBound && boundedValues[1] > options.upperBound) {
                            boundedValues[1] = Math.min(boundedValues[1], options.upperBound);
                        }

                        if (boundedValues[0] !== ui.values[0] || boundedValues[1] !== ui.values[1]) {
                            valuesChanged = true;
                            ui.values = boundedValues;
                        }
                    } else {
                        var boundedValue = ui.value;

                        if (options.lowerBound && boundedValue < options.lowerBound) {
                            boundedValue = Math.max(boundedValue, options.lowerBound);
                        }
                        if (options.upperBound && boundedValue > options.upperBound) {
                            boundedValue = Math.min(boundedValue, options.upperBound);
                        }

                        if (boundedValue !== ui.value) {
                            valuesChanged = true;
                            ui.value = boundedValue;
                        }
                    }


                    ngModel.$setViewValue(ui.values || ui.value);
                    scope.$apply();

                    if (valuesChanged) {
                        setTimeout(function() {
                            elm.slider('value', ui.values || ui.value);
                        }, 0);

                        return false;
                    }
                });

                // Update slider from model value
                ngModel.$render = function() {
                    init();
                    var method = options.range === true ? 'values' : 'value';
                    
                    if (options.range !== true && isNaN(ngModel.$viewValue) && !(ngModel.$viewValue instanceof Array)) {
                        ngModel.$viewValue = 0;
                    }
                    else if (options.range && !angular.isDefined(ngModel.$viewValue)) {
                            ngModel.$viewValue = [0,0];
                    }

                    // Do some sanity check of range values
                    if (options.range === true) {
                        
                        // Check outer bounds for min and max values
                        if (angular.isDefined(options.min) && options.min > ngModel.$viewValue[0]) {
                            ngModel.$viewValue[0] = options.min;
                        }
                        if (angular.isDefined(options.max) && options.max < ngModel.$viewValue[1]) {
                            ngModel.$viewValue[1] = options.max;
                        }

                        // Check min and max range values
                        if (ngModel.$viewValue[0] > ngModel.$viewValue[1]) {
                            // Min value should be less to equal to max value
                            if (prevRangeValues.min >= ngModel.$viewValue[1]) {
                                ngModel.$viewValue[0] = prevRangeValues.min;
                            }
                            // Max value should be less to equal to min value
                            if (prevRangeValues.max <= ngModel.$viewValue[0]) {
                                ngModel.$viewValue[1] = prevRangeValues.max;
                            }
                        }

                        // Store values for later user
                        prevRangeValues.min = ngModel.$viewValue[0];
                        prevRangeValues.max = ngModel.$viewValue[1];

                    }
                    elm.slider(method, ngModel.$viewValue);
                };

                scope.$watch(attrs.ngModel, function() {
                    if (options.range === true) {
                        ngModel.$render();
                    }
                }, true);

                function destroy() {
                    if (elm.hasClass('ui-slider')) {
                        elm.slider('destroy');
                    }
                }

                scope.$on("$destroy", destroy);
                elm.one('$destroy', destroy);
            };

            var postLink = function (scope, element, attrs, ngModel) {
                // Add tick marks if 'tick' and 'step' attributes have been setted on element.
                // Support horizontal slider bar so far. 'tick' and 'step' attributes are required.
                var options = angular.extend({}, scope.$eval(attrs.uiSlider));
                var properties = ['max', 'step', 'tick'];
                angular.forEach(properties, function(property) {
                    if (angular.isDefined(attrs[property])) {
                        options[property] = attrs[property];
                    }
                });
                if (angular.isDefined(options['tick']) && angular.isDefined(options['step'])) {
                    var total = parseInt(parseInt(options['max'])/parseInt(options['step']));
                    for (var i = total; i >= 0; i--) {
                        var left = ((i / total) * 100) + '%';
                        $("<div/>").addClass("ui-slider-tick").appendTo(element).css({left: left});
                    };
                }
            }

            return {
                pre: preLink,
                post: postLink
            };
        }
    };
}]);
;
/*
 AngularJS v1.4.4
 (c) 2010-2015 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(A,h,B){'use strict';function v(h){return["$animate",function(q){return{restrict:"AE",transclude:"element",terminal:!0,require:"^^ngMessages",link:function(m,e,a,g,k){var c=e[0],n,l=a.ngMessage||a.when;a=a.ngMessageExp||a.whenExp;var p=function(d){n=d?w(d)?d:d.split(/[\s,]+/):null;g.reRender()};a?(p(m.$eval(a)),m.$watchCollection(a,p)):p(l);var f,r;g.register(c,r={test:function(d){var b=n;d=b?w(b)?0<=b.indexOf(d):b.hasOwnProperty(d):void 0;return d},attach:function(){f||k(m,function(d){q.enter(d,
null,e);f=d;f.on("$destroy",function(){f&&(g.deregister(c),r.detach())})})},detach:function(){if(f){var d=f;f=null;q.leave(d)}}})}}}]}var w=h.isArray,x=h.forEach,y=h.isString,z=h.element;h.module("ngMessages",[]).directive("ngMessages",["$animate",function(h){function q(e,a){return y(a)&&0===a.length||m(e.$eval(a))}function m(e){return y(e)?e.length:!!e}return{require:"ngMessages",restrict:"AE",controller:["$element","$scope","$attrs",function(e,a,g){function k(a,d){for(var b=d,e=[];b&&b!==a;){var c=
b.$$ngMessageNode;if(c&&c.length)return l[c];b.childNodes.length&&-1==e.indexOf(b)?(e.push(b),b=b.childNodes[b.childNodes.length-1]):b=b.previousSibling||b.parentNode}}var c=this,n=0,l=this.messages={},p,f;this.render=function(r){r=r||{};p=!1;f=r;for(var d=q(a,g.ngMessagesMultiple)||q(a,g.multiple),b=[],n={},s=c.head,k=!1,l=0;null!=s;){l++;var t=s.message,u=!1;k||x(r,function(b,a){!u&&m(b)&&t.test(a)&&!n[a]&&(u=n[a]=!0,t.attach())});u?k=!d:b.push(t);s=s.next}x(b,function(b){b.detach()});b.length!==
l?h.setClass(e,"ng-active","ng-inactive"):h.setClass(e,"ng-inactive","ng-active")};a.$watchCollection(g.ngMessages||g["for"],c.render);this.reRender=function(){p||(p=!0,a.$evalAsync(function(){p&&f&&c.render(f)}))};this.register=function(a,d){var b=n.toString();l[b]={message:d};var g=e[0],f=l[b];c.head?(g=k(g,a))?(f.next=g.next,g.next=f):(f.next=c.head,c.head=f):c.head=f;a.$$ngMessageNode=b;n++;c.reRender()};this.deregister=function(a){var d=a.$$ngMessageNode;delete a.$$ngMessageNode;var b=l[d];(a=
k(e[0],a))?a.next=b.next:c.head=b.next;delete l[d];c.reRender()}}]}}]).directive("ngMessagesInclude",["$templateRequest","$document","$compile",function(h,q,m){return{restrict:"AE",require:"^^ngMessages",link:function(e,a,g){var k=g.ngMessagesInclude||g.src;h(k).then(function(c){m(c)(e,function(c){a.after(c);c=z(q[0].createComment(" ngMessagesInclude: "+k+" "));a.after(c);a.remove()})})}}}]).directive("ngMessage",v("AE")).directive("ngMessageExp",v("A"))})(window,window.angular);
//# sourceMappingURL=angular-messages.min.js.map
;
(function () {
    var app = angular.module('app.Common.validations.UniValidationModule', ['ngMessages']);
})();
//# sourceMappingURL=app.module.js.map;
var app;
(function (app) {
    var Common;
    (function (Common) {
        var validations;
        (function (validations) {
            var UniValidationModule;
            (function (UniValidationModule) {
                'use strict';
                /***** REGEX *****/
                var regExp = (function () {
                    function regExp() {
                    }
                    return regExp;
                }());
                regExp.ID = /^[0-9]{9}$/;
                regExp.PASSPORT = /^[0-9]{9}$/; //duplicated incase they want to change only passport regex.
                regExp.USERNAME_SINGLE_WORD = /^[a-zA-Z0-9]{6,8}$/;
                //public static USERNAME_SINGLE_WORD: RegExp = /^[A-Za-z0-9?-?-_\.]{6,8}$/;
                regExp.PASSWORD = /^(?=.*[0-9])(?=.*[a-zA-Z])([a-zA-Z0-9]+){8,20}$/;
                regExp.EMAIL = /^([\?!\/]*)+\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w{2,}([-.]\w+)*$/;
                regExp.URL = /^([\a-zA-Z0-9\.-]+)\.([a-zA-Z\.]{2,6})([\/\w \.-]*)*\/?$/;
                regExp.ALPHANUMERIC = /^[a-zA-Z0-9 ]+$/;
                regExp.HEBREW = /^[א-ת '"-]+$/;
                regExp.ENGLISH = /[^a-zA-Z '"-]/;
                regExp.HEBREWENGLISH = /[^א-תa-zA-Z '"-]/g;
                regExp.HEBREWSPECIALCHAR = /^[א-ת\.,"'()-_*\s]*$/;
                regExp.NUMBER = /^[0-9]+\d*$/;
                regExp.APARTMENT_NUMBER = /^[0-9 \ /]+\d*$/;
                regExp.FLOAT_NUM = /^[0-9,]{1,}[.]{0,1}[0-9]{0,}$/;
                regExp.SMART_FLOAT = /^[0-9]+(\.[0-9]{1,2})?$/;
                regExp.CARD_NUMBER = /^[0-9]{8,16}$/;
                regExp.PHONE_BODY = /^[0-9]{7}$/;
                regExp.DAY = /^(0?[1-9]|[12][0-9]|3[01])$/;
                regExp.MONTH = /^(0?[1-9]|1[012])$/;
                regExp.SearchCharacters = /^[^!]*$/;
                regExp.SPECIAL_CHARACTERS = /^[a-za-zא-ת0-9\.,-\s]*$/;
                regExp.FULL_PHONE_NUMBER = /^[0-9]{9,10}$/; // Suggestion: /^0(5\d|[2346789])\d{7}$/
                regExp.POSITIVE_NUMBER_DECIMAL = /^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/;
                UniValidationModule.regExp = regExp;
                //angular.module("UniValidationModule").constant('REG_EXP', UniValidationModule.regExp);
            })(UniValidationModule = validations.UniValidationModule || (validations.UniValidationModule = {}));
        })(validations = Common.validations || (Common.validations = {}));
    })(Common = app.Common || (app.Common = {}));
})(app || (app = {}));
(function (app) {
    var Common;
    (function (Common) {
        var validations;
        (function (validations) {
            var UniValidationModule;
            (function (UniValidationModule) {
                // ********Start directive definitions **********
                var ignorIgnorableValidations = function (attrs) {
                    return (attrs["ignorIgnorableValidations"] != undefined && attrs["ignorIgnorableValidations"].toLowerCase() == 'true');
                };
                var allowNullOrEmptyOrUndefined = function (modelValue) {
                    return isNullOrEmptyOrUndefined(modelValue);
                };
                /**
                 * Directive for validating digits only
                 */
                var uniNumberValidator = (function () {
                    function uniNumberValidator() {
                        // Usage:
                        // <input type="text" uni-number-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.number = function (modelValue) {
                                return UniValidationModule.regExp.NUMBER.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return uniNumberValidator;
                }());
                UniValidationModule.uniNumberValidator = uniNumberValidator;
                var maxValueValidator = (function () {
                    function maxValueValidator() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.maxNumberValidator = function (modelValue) {
                                if (modelValue != null) {
                                    var currentValue = parseInt(modelValue);
                                    if (isNaN(currentValue))
                                        return true;
                                    var maxValue = parseInt(attrs.maxValueValidator);
                                    return currentValue <= maxValue;
                                }
                                return true;
                            };
                        };
                    }
                    return maxValueValidator;
                }());
                UniValidationModule.maxValueValidator = maxValueValidator;
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('maxValueValidator', [function () { return new UniValidationModule.maxValueValidator(); }]);
                var minValueValidator = (function () {
                    function minValueValidator() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.minNumberValidator = function (modelValue) {
                                if (modelValue != undefined) {
                                    var currentValue = parseInt(modelValue);
                                    if (isNaN(currentValue))
                                        return true;
                                    var minValue = parseInt(attrs.minValueValidator);
                                    return currentValue >= minValue;
                                }
                                return true;
                            };
                        };
                    }
                    return minValueValidator;
                }());
                UniValidationModule.minValueValidator = minValueValidator;
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('minValueValidator', [function () { return new UniValidationModule.minValueValidator(); }]);
                var uniApartmentNumberValidator = (function () {
                    function uniApartmentNumberValidator() {
                        // Usage:
                        // <input type="text" uni-apartment-number-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.apartmentNumber = function (modelValue) {
                                return UniValidationModule.regExp.APARTMENT_NUMBER.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return uniApartmentNumberValidator;
                }());
                UniValidationModule.uniApartmentNumberValidator = uniApartmentNumberValidator;
                var uniUrlAddress = (function () {
                    function uniUrlAddress() {
                        // Usage:
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.urlAddress = function (modelValue) {
                                return UniValidationModule.regExp.URL.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return uniUrlAddress;
                }());
                UniValidationModule.uniUrlAddress = uniUrlAddress;
                var floatNumberValidator = (function () {
                    function floatNumberValidator($filter) {
                        var _this = this;
                        this.$filter = $filter;
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            var filter = _this.$filter;
                            function thousandSeparator(val, filter) {
                                if (val == 0) {
                                    return "";
                                }
                                return filter(attrs["filter"])(val);
                            }
                            ctrls[0].$formatters.unshift(function (viewValue) {
                                return thousandSeparator(viewValue, filter);
                            });
                            ctrls[0].$validators.floatNumber = function (modelValue) {
                                //element.val(thousandSeparator(modelValue, filter));
                                return UniValidationModule.regExp.FLOAT_NUM.test(modelValue);
                            };
                            element.bind("input", function (event) {
                                var value = this.value.replace(/[^(0-9\.)]/g, '');
                                element.val(thousandSeparator(value, filter));
                            });
                        };
                    }
                    return floatNumberValidator;
                }());
                UniValidationModule.floatNumberValidator = floatNumberValidator;
                /**
               * Directive for validating digits only
               */
                var uniLengthValidator = (function () {
                    function uniLengthValidator() {
                        // Usage: (this will me exactly 7 - (length of string)
                        // <input type="text" uni-length-validator="7">
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.lengthCheck = function (modelValue) {
                                return (modelValue) ? (modelValue && modelValue.length == attrs.uniLengthValidator) : false;
                                //return (modelValue && modelValue.length == attrs.uniLengthValidator);
                            };
                        };
                    }
                    return uniLengthValidator;
                }());
                UniValidationModule.uniLengthValidator = uniLengthValidator;
                /**
               * Directive for validating digits only
               */
                var uniLengthValidatorIgnoreEmpty = (function () {
                    function uniLengthValidatorIgnoreEmpty() {
                        // Usage: (this will me exactly 7 - (length of string)
                        // <input type="text" uni-length-validator="7">
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.lengthCheck = function (modelValue) {
                                if (!modelValue)
                                    return true;
                                return (modelValue) ? (modelValue && modelValue.length == attrs.uniLengthValidatorIgnoreEmpty) : false;
                                //return (modelValue && modelValue.length == attrs.uniLengthValidator);
                            };
                        };
                    }
                    return uniLengthValidatorIgnoreEmpty;
                }());
                UniValidationModule.uniLengthValidatorIgnoreEmpty = uniLengthValidatorIgnoreEmpty;
                //attrs.uniLengthValidator
                /**
               * Directive for validating Search Input
               */
                var uniSearchValidator = (function () {
                    function uniSearchValidator() {
                        // Usage:
                        // <input type="text" uni-alpha-numeric-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            element.bind("input", function (event) {
                                var strings = ["!", "?", ":", "<", ">", "%", "(", ")", ",", "\"", "[", "]", ";", "~", "`", "'", "|", "\\", "{", "}"];
                                if (strings.indexOf(this.value) > -1) {
                                    var value = this.value.replace(this.value, "");
                                    element.val(value);
                                }
                                //if (this.value.indexOf("!") > -1) {
                                //    var value = this.value.replace("!", "");
                                //    element.val(value);
                                //} else if (this.value.indexOf("?") > -1) {
                                //    var value = this.value.replace("?", "");
                                //    element.val(value);
                                //}
                                //else if (this.value.indexOf(":") > -1) {
                                //    var value = this.value.replace(":", "");
                                //    element.val(value);
                                //}
                                //else if (this.value.indexOf(";") > -1) {
                                //    var value = this.value.replace(";", "");
                                //    element.val(value);
                                //}
                            });
                        };
                    }
                    return uniSearchValidator;
                }());
                UniValidationModule.uniSearchValidator = uniSearchValidator;
                /**
                 * Directive for validating english and numbers only
                 */
                var uniAlphaNumericValidator = (function () {
                    function uniAlphaNumericValidator() {
                        // Usage:
                        // <input type="text" uni-alpha-numeric-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.alphaNumeric = function (modelValue) {
                                return UniValidationModule.regExp.ALPHANUMERIC.test(modelValue);
                            };
                        };
                    }
                    return uniAlphaNumericValidator;
                }());
                UniValidationModule.uniAlphaNumericValidator = uniAlphaNumericValidator;
                var uniHebrewValidator = (function () {
                    function uniHebrewValidator() {
                        // Usage:
                        // <input type="text" uni-alpha-numeric-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.hebrewOnly = function (modelValue) {
                                return UniValidationModule.regExp.HEBREW.test(modelValue);
                            };
                        };
                    }
                    return uniHebrewValidator;
                }());
                UniValidationModule.uniHebrewValidator = uniHebrewValidator;
                var uniEnglishValidator = (function () {
                    function uniEnglishValidator() {
                        // Usage:
                        // <input type="text" uni-alpha-numeric-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.englishOnly = function (modelValue) {
                                return !UniValidationModule.regExp.ENGLISH.test(modelValue);
                            };
                        };
                    }
                    return uniEnglishValidator;
                }());
                UniValidationModule.uniEnglishValidator = uniEnglishValidator;
                var specialCharactersValidator = (function () {
                    function specialCharactersValidator() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.specialCharacters = function (modelValue) {
                                //console.log("special characters");
                                return UniValidationModule.regExp.SPECIAL_CHARACTERS.test(modelValue);
                            };
                        };
                    }
                    return specialCharactersValidator;
                }());
                UniValidationModule.specialCharactersValidator = specialCharactersValidator;
                /**
                 * Directive for validating ID
                 */
                var uniIdValidator = (function () {
                    function uniIdValidator() {
                        // Usage:
                        // <input type="text" uni-id-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.userId = function (modelValue) {
                                if (!!modelValue && modelValue.length > 0) {
                                    return UniValidationModule.regExp.ID.test(modelValue) && IsValidID(modelValue);
                                }
                                else {
                                    return true;
                                }
                            };
                        };
                    }
                    return uniIdValidator;
                }());
                UniValidationModule.uniIdValidator = uniIdValidator;
                /**
                 * Directive for validating PASSPORT
                 */
                var uniPassportValidator = (function () {
                    function uniPassportValidator() {
                        // Usage:
                        // <input type="text" uni-passport-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.passport = function (modelValue) {
                                if (!!modelValue && modelValue.length > 0) {
                                    return UniValidationModule.regExp.PASSPORT.test(modelValue);
                                }
                                else {
                                    return true;
                                }
                            };
                        };
                    }
                    return uniPassportValidator;
                }());
                UniValidationModule.uniPassportValidator = uniPassportValidator;
                /**
                 * Directive for validating ID for Dayal only
                 */
                //export class idValidator implements ng.IDirective {
                //    public restrict: string = 'A';
                //    public require: string[] = ['ngModel'];
                //    public replace: boolean = false;
                //    public link: Function = (scope: ng.IScope,
                //        element: ng.IAugmentedJQuery,
                //        attrs: ng.IAttributes,
                //        ctrls: any
                //    ) => {
                //        ctrls[0].$validators.userId = function (modelValue) {
                //            if (!!modelValue && modelValue.length > 0) {
                //                return IsValidID(modelValue);
                //            }
                //            else {
                //                return true;
                //            }
                //        };
                //    }
                //}
                /**
                 * Directive for validating ID for Dayal only
                 */
                var idValidator = (function () {
                    function idValidator() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.userId = function (modelValue) {
                                if (!!modelValue && modelValue.length > 0) {
                                    return IsValidID(modelValue);
                                }
                                else {
                                    return true;
                                }
                            };
                        };
                    }
                    return idValidator;
                }());
                UniValidationModule.idValidator = idValidator;
                /**
                 * Directive for validating user name
                 */
                var uniNameValidator = (function () {
                    function uniNameValidator() {
                        // Usage:
                        // <input type="text" uni-name-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.userName = function (modelValue) {
                                return UniValidationModule.regExp.USERNAME_SINGLE_WORD.test(modelValue);
                            };
                        };
                    }
                    return uniNameValidator;
                }());
                UniValidationModule.uniNameValidator = uniNameValidator;
                /**
                 * Directive for validating user password
                 */
                var uniPasswordValidator = (function () {
                    function uniPasswordValidator() {
                        // Usage:
                        // <input type="text" uni-password-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.userPassword = function (modelValue) {
                                return UniValidationModule.regExp.PASSWORD.test(modelValue);
                            };
                        };
                    }
                    return uniPasswordValidator;
                }());
                UniValidationModule.uniPasswordValidator = uniPasswordValidator;
                /**
                 * Directive for validating equality of multiple fields
                 */
                var mustEqualToValidator = (function () {
                    function mustEqualToValidator() {
                        // Usage:
                        // <input type="text" uni-must-equal-to-validator>
                        // Requirement:       
                        // Provide model name for compare to 'uni-must-equal-to-validato' attribute in second input,    
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.scope = { uniMustEqualToValidator: '=' };
                        this.link = function (scope, element, attrs, ctrls) {
                            function isEqualToOther(value) {
                                var match = scope["uniMustEqualToValidator"];
                                return value === match;
                                //return match;
                            }
                            scope.$watch('uniMustEqualToValidator', function (pass) {
                                ctrls[0].$validate();
                            });
                            ctrls[0].$validators.notEqualTo = function (modelValue, viewValue) {
                                var value = modelValue || viewValue;
                                return isEqualToOther(value);
                            };
                        };
                    }
                    return mustEqualToValidator;
                }());
                UniValidationModule.mustEqualToValidator = mustEqualToValidator;
                /**
                 * Directive for remove phone validating fields
                 */
                var removeValidator = (function () {
                    function removeValidator() {
                        // Usage:
                        // <input type="text" uni-remove-validator>
                        // Requirement:
                        // Provide 'form-name' attribute with form name, 
                        // throws exception if it is not provided.
                        // Provide field name for compare to 'uni-remove-validator' attribute,
                        // throws exception if it is not provided.
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            function isEmpty() {
                                var otherInput = scope[attrs["formName"]][attrs["uniRemoveValidator"]];
                                var otherValue = otherInput.$modelValue || otherInput.$viewValue;
                                if (otherValue == undefined || otherValue == "") {
                                    return true;
                                }
                                return false;
                            }
                            if (!(attrs["formName"]) || attrs["formName"] == "") {
                                throw 'For this directive to function correctly you need to supply the form-name attribute';
                            }
                            ctrls[0].$validators.phoneBody = function (modelValue, viewValue) {
                                var value = modelValue || viewValue;
                                if (isEmpty()) {
                                    return UniValidationModule.regExp.PHONE_BODY.test(value);
                                }
                                else {
                                    var tempVal = (value == undefined || value == "") ? true : UniValidationModule.regExp.PHONE_BODY.test(value);
                                    return tempVal;
                                }
                            };
                        };
                    }
                    return removeValidator;
                }());
                UniValidationModule.removeValidator = removeValidator;
                /**
                 * Directive for remove phone validating fields
                 */
                var startWithZeroPhoneValidator = (function () {
                    function startWithZeroPhoneValidator() {
                        // Usage:
                        // <input type="text" start-with-zero-phone-validator>
                        // Requirement:
                        // gets a number, 
                        //return true/false if the first digit is zero
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            function isStartWithZero(modelValue) {
                                var value = modelValue;
                                value = (String)(value);
                                value = value.slice(0, 1);
                                if (value == '0') {
                                    return true;
                                }
                                else {
                                    return false;
                                }
                            }
                            ctrls[0].$validators.phoneStartWithZero = function (modelValue, viewValue) {
                                var value = modelValue || viewValue;
                                return isStartWithZero(value);
                            };
                        };
                    }
                    return startWithZeroPhoneValidator;
                }());
                UniValidationModule.startWithZeroPhoneValidator = startWithZeroPhoneValidator;
                var fullPhoneBodyValidator = (function () {
                    function fullPhoneBodyValidator() {
                        // Usage:
                        // <input type="text" uni-full-phone-body-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.phoneBody = function (modelValue) {
                                return UniValidationModule.regExp.FULL_PHONE_NUMBER.test(modelValue);
                            };
                        };
                    }
                    return fullPhoneBodyValidator;
                }());
                UniValidationModule.fullPhoneBodyValidator = fullPhoneBodyValidator;
                /**
                 * Directive for validating email
                 */
                var emailValidator = (function () {
                    function emailValidator() {
                        // Usage:
                        // <input type="text" uni-email-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.userEmail = function (modelValue) {
                                return UniValidationModule.regExp.EMAIL.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue) || ignorIgnorableValidations(attrs);
                            };
                        };
                    }
                    return emailValidator;
                }());
                UniValidationModule.emailValidator = emailValidator;
                /**
                 * Directive for validating phone body (7 digits)
                 */
                var phoneBodyValidator = (function () {
                    function phoneBodyValidator() {
                        // Usage:
                        // <input type="text" uni-phone-body-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.phoneBody = function (modelValue) {
                                return UniValidationModule.regExp.PHONE_BODY.test(modelValue) || ignorIgnorableValidations(attrs);
                            };
                        };
                    }
                    return phoneBodyValidator;
                }());
                UniValidationModule.phoneBodyValidator = phoneBodyValidator;
                /**
                * Directive for validating phone body and allow empty value (7 digits)
                */
                var phoneBodyOrEmptyValidator = (function () {
                    function phoneBodyOrEmptyValidator() {
                        // Usage:
                        // <input type="text" uni-phone-body-or-empty-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.phoneBody = function (modelValue) {
                                if (modelValue == "")
                                    return true;
                                else {
                                    return UniValidationModule.regExp.PHONE_BODY.test(modelValue);
                                }
                            };
                        };
                    }
                    return phoneBodyOrEmptyValidator;
                }());
                UniValidationModule.phoneBodyOrEmptyValidator = phoneBodyOrEmptyValidator;
                /**
                 * Directive for validating credit card number (8-16digits)
                 */
                var uniCardNumberValidator = (function () {
                    function uniCardNumberValidator() {
                        // Usage:
                        // <input type="text" uni-card-number-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.cardNumber = function (modelValue) {
                                return UniValidationModule.regExp.CARD_NUMBER.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return uniCardNumberValidator;
                }());
                UniValidationModule.uniCardNumberValidator = uniCardNumberValidator;
                /**
                 * Directive for validating day number (01-31)
                 */
                var uniDayValidator = (function () {
                    function uniDayValidator() {
                        // Usage:
                        // <input type="text" uni-day-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.day = function (modelValue) {
                                return UniValidationModule.regExp.DAY.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return uniDayValidator;
                }());
                UniValidationModule.uniDayValidator = uniDayValidator;
                /**
                 * Directive for validating month number (01-12)
                 */
                var uniMonthValidator = (function () {
                    function uniMonthValidator() {
                        // Usage:
                        // <input type="text" uni-month-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.month = function (modelValue) {
                                return UniValidationModule.regExp.MONTH.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return uniMonthValidator;
                }());
                UniValidationModule.uniMonthValidator = uniMonthValidator;
                /**
                 * Directive for validating year number
                 */
                var uniYearValidator = (function () {
                    function uniYearValidator() {
                        // Usage:
                        // <input type="text" uni-year-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.year = function (modelValue, viewValue) {
                                var value = modelValue || viewValue;
                                var today = new Date();
                                var year = today.getFullYear();
                                if (modelValue.length != 4 || parseInt(modelValue) < 1900 || parseInt(modelValue) > (year - 16)) {
                                    return false;
                                }
                                else {
                                    return true;
                                }
                            };
                        };
                    }
                    return uniYearValidator;
                }());
                UniValidationModule.uniYearValidator = uniYearValidator;
                /**
                 * Directive for validating year by minimum age
                 */
                var uniYearMinAgeValidator = (function () {
                    function uniYearMinAgeValidator() {
                        // Usage:
                        // <input type="text" uni-year-min-age-validator="18">
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.year = function (modelValue, viewValue) {
                                var value = modelValue || viewValue;
                                var today = new Date();
                                var year = today.getFullYear();
                                if (modelValue.length != 4 || parseInt(modelValue) < 1900 || parseInt(modelValue) > (year - attrs.uniYearMinAgeValidator)) {
                                    return false;
                                }
                                else {
                                    return true;
                                }
                            };
                        };
                    }
                    return uniYearMinAgeValidator;
                }());
                UniValidationModule.uniYearMinAgeValidator = uniYearMinAgeValidator;
                //export class hebrewWithSpecialChar implements ng.IDirective {
                //    public restrict: string = 'A';
                //    public require: string[] = ['ngModel'];
                //    public link: Function = (
                //        scope: ng.IScope,
                //        element: ng.IAugmentedJQuery,
                //        attrs: ng.IAttributes,
                //        ctrls: any
                //        ) => {
                //        ctrls[0].$validators.hebrewWithChar = function (modelValue, viewValue) {
                //            element.bind("input", function (event) {
                //                var value = this.value.replace(/[^א-ת \.\(\)\-\"\'\_\,\*]*/g, '');
                //                element.val(value);
                //            });
                //            return UniValidationModule.regExp.HEBREWSPECIALCHAR.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                //        };
                //    }
                //}
                //export class onlyHebrewAndSpecialChar implements ng.IDirective {
                //    public restrict: string = 'A';
                //    public require: string[] = ['ngModel'];
                //    public replace: boolean = false;
                //    public link: Function = (scope: ng.IScope,
                //        element: ng.IAugmentedJQuery,
                //        attrs: ng.IAttributes,
                //        ctrls: any
                //    ) => {
                //        ctrls[0].$validators.hebrewWithChar = function (modelValue) {
                //            return UniValidationModule.regExp.HEBREWSPECIALCHAR.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                //        };
                //    }
                //}
                var hebrewWithSpecialCharAndNumbers = (function () {
                    function hebrewWithSpecialCharAndNumbers() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.hebrewWithCharAndNumbers = function (modelValue, viewValue) {
                                element.bind("input", function (event) {
                                    var value = this.value.replace(/[^א-ת0-9 \.\(\)\-\"\'\_\,\*]*/g, '');
                                    if (attrs["maxlength"]) {
                                        value = value.toString().substring(0, attrs["maxlength"]);
                                    }
                                    element.val(value);
                                });
                                return UniValidationModule.regExp.HEBREWSPECIALCHAR.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return hebrewWithSpecialCharAndNumbers;
                }());
                UniValidationModule.hebrewWithSpecialCharAndNumbers = hebrewWithSpecialCharAndNumbers;
                var hebrewWithSpecialChar = (function () {
                    function hebrewWithSpecialChar() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.hebrewWithChar = function (modelValue, viewValue) {
                                element.bind("input", function (event) {
                                    var value = this.value.replace(/[^א-ת \.\(\)\-\"\'\_\,\*]*/g, '');
                                    if (attrs["maxlength"]) {
                                        value = value.toString().substring(0, attrs["maxlength"]);
                                    }
                                    element.val(value);
                                });
                                return UniValidationModule.regExp.HEBREWSPECIALCHAR.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return hebrewWithSpecialChar;
                }());
                UniValidationModule.hebrewWithSpecialChar = hebrewWithSpecialChar;
                var onlyHebrewAndSpecialChar = (function () {
                    function onlyHebrewAndSpecialChar() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.hebrewWithChar = function (modelValue) {
                                return UniValidationModule.regExp.HEBREWSPECIALCHAR.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return onlyHebrewAndSpecialChar;
                }());
                UniValidationModule.onlyHebrewAndSpecialChar = onlyHebrewAndSpecialChar;
                var ignoreNonHebrew = (function () {
                    function ignoreNonHebrew() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.hebrewOnly = function (modelValue, viewValue) {
                                element.bind("input", function (event) {
                                    var value = this.value.replace(/[^א-ת '"-]/g, '');
                                    element.val(value);
                                });
                                return UniValidationModule.regExp.HEBREW.test(modelValue);
                            };
                        };
                    }
                    return ignoreNonHebrew;
                }());
                UniValidationModule.ignoreNonHebrew = ignoreNonHebrew;
                var ignoreNonEnglishNumber = (function () {
                    function ignoreNonEnglishNumber() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.hebrewOnly = function (modelValue, viewValue) {
                                element.bind("input", function (event) {
                                    var value = this.value.replace(/[^א-ת '"-]/g, '');
                                    element.val(value);
                                });
                                return UniValidationModule.regExp.HEBREW.test(modelValue);
                            };
                        };
                    }
                    return ignoreNonEnglishNumber;
                }());
                UniValidationModule.ignoreNonEnglishNumber = ignoreNonEnglishNumber;
                var ignoreNonHebrewEnglish = (function () {
                    function ignoreNonHebrewEnglish() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.hebrewEnglishOnly = function (modelValue, viewValue) {
                                element.bind("input", function (event) {
                                    var value = this.value.replace(UniValidationModule.regExp.HEBREWENGLISH, '');
                                    element.val(value);
                                });
                                return !UniValidationModule.regExp.HEBREWENGLISH.test(modelValue);
                            };
                        };
                    }
                    return ignoreNonHebrewEnglish;
                }());
                UniValidationModule.ignoreNonHebrewEnglish = ignoreNonHebrewEnglish;
                var ignoreNonEnglish = (function () {
                    function ignoreNonEnglish() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            element.bind("input", function (event) {
                                var value = this.value.replace(/[^a-zA-Z ]/g, '');
                                element.val(value);
                            });
                        };
                    }
                    return ignoreNonEnglish;
                }());
                UniValidationModule.ignoreNonEnglish = ignoreNonEnglish;
                var ignoreNonEnglishNumbers = (function () {
                    function ignoreNonEnglishNumbers() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            element.bind("input", function (event) {
                                var value = this.value.replace(/[^a-zA-Z0-9 ]/g, '');
                                element.val(value);
                            });
                        };
                    }
                    return ignoreNonEnglishNumbers;
                }());
                UniValidationModule.ignoreNonEnglishNumbers = ignoreNonEnglishNumbers;
                var numberMin = (function () {
                    function numberMin() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.numberMin = function (modelValue) {
                                if (modelValue != undefined && modelValue.toString().indexOf(",") > -1) {
                                    return ((parseInt(attrs["min"]) > parseInt((modelValue != null ? modelValue : "").split(',').join(''))) ? false : true);
                                }
                                else {
                                    return ((parseInt(attrs["min"]) > parseInt((modelValue != null ? modelValue : ""))) ? false : true);
                                }
                            };
                        };
                    }
                    return numberMin;
                }());
                UniValidationModule.numberMin = numberMin;
                var numberMax = (function () {
                    function numberMax() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.numberMax = function (modelValue) {
                                if (modelValue != undefined && modelValue.toString().indexOf(",") > -1) {
                                    return ((parseInt(attrs["max"]) < parseInt((modelValue != null ? modelValue : "").split(',').join(''))) ? false : true);
                                }
                                else {
                                    return ((parseInt(attrs["max"]) < parseInt((modelValue != null ? modelValue : ""))) ? false : true);
                                }
                            };
                        };
                    }
                    return numberMax;
                }());
                UniValidationModule.numberMax = numberMax;
                var phoneBodyValidatorNotRequired = (function () {
                    function phoneBodyValidatorNotRequired() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.phoneBodyValidatorNotRequired = function (modelValue) {
                                if (modelValue == "")
                                    return true;
                                else {
                                    return modelValue.length > 6;
                                }
                            };
                        };
                    }
                    return phoneBodyValidatorNotRequired;
                }());
                UniValidationModule.phoneBodyValidatorNotRequired = phoneBodyValidatorNotRequired;
                var smartFloat = (function () {
                    function smartFloat($filter) {
                        this.$filter = $filter;
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            element.bind("input", function (event) {
                                var value = this.value.replace(/[^0-9\.]/g, '');
                                element.val(value);
                            });
                            ctrls[0].$validators.smartFloat = function (modelValue, viewValue) {
                                return UniValidationModule.regExp.SMART_FLOAT.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return smartFloat;
                }());
                UniValidationModule.smartFloat = smartFloat;
                var format = (function () {
                    function format($filter) {
                        var _this = this;
                        this.$filter = $filter;
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            var filter = _this.$filter;
                            function thousandSeparator(val, filter) {
                                if (val == 0) {
                                    return "";
                                }
                                return filter(attrs["format"])(val);
                            }
                            ctrls[0].$formatters.unshift(function (viewValue) {
                                return thousandSeparator(viewValue, filter);
                            });
                            element.bind("input", function (event) {
                                //var value
                                //if (this.value.indexOf("0") == 0) {
                                //   value= this.value.replace("0", "");
                                //   this.value = this.value.replace("0", "");
                                //}
                                var value = this.value.replace(/[^0-9]/g, '');
                                element.val(thousandSeparator(value, filter));
                            });
                        };
                    }
                    return format;
                }());
                UniValidationModule.format = format;
                var newFormat = (function () {
                    function newFormat($filter) {
                        var _this = this;
                        this.$filter = $filter;
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            var filter = _this.$filter;
                            ctrls[0].$formatters.unshift(function (viewValue) {
                                return filter(attrs["newFormat"])(ctrls[0].$modelValue); //thousandSeparator(viewValue, filter);
                            });
                            ctrls[0].$parsers.unshift(function (viewValue) {
                                var value = viewValue.replace(/[^\d|\-+|\.+]/g, '');
                                (value) ? element.val(filter(attrs["newFormat"])(value)) : element.val(value);
                                return value;
                            });
                        };
                    }
                    return newFormat;
                }());
                UniValidationModule.newFormat = newFormat;
                var positiveNumber = (function () {
                    function positiveNumber($filter) {
                        this.$filter = $filter;
                        this.restrict = 'A';
                        this.scope = {
                            'ngModel': '=',
                        };
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            element.bind('input', function (v) {
                                var value = this.value.replace(/\D/g, '');
                                element.val(value);
                                scope.$apply(function () {
                                    scope["ngModel"] = element.val();
                                    element.data('old-value', element.val());
                                });
                            });
                        };
                    }
                    return positiveNumber;
                }());
                UniValidationModule.positiveNumber = positiveNumber;
                var positiveNumberDecimal = (function () {
                    function positiveNumberDecimal($filter) {
                        this.$filter = $filter;
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            element.bind("input", function (event) {
                                var value = this.value.replace(/[^0-9.]/g, '');
                                element.val(value);
                            });
                        };
                    }
                    return positiveNumberDecimal;
                }());
                UniValidationModule.positiveNumberDecimal = positiveNumberDecimal;
                var zipCode = (function () {
                    function zipCode() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            element.bind("input", function (event) {
                                var value = this.value;
                                if (this.value.length > 7) {
                                    value = this.value.substring(0, 7);
                                }
                                element.val(value);
                            });
                        };
                    }
                    return zipCode;
                }());
                UniValidationModule.zipCode = zipCode;
                var poBox = (function () {
                    function poBox() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.poBox = function (modelValue) {
                                if (modelValue.length == 0)
                                    return true;
                                else if (modelValue.length < 5) {
                                    return false;
                                }
                                else {
                                    return true;
                                }
                            };
                        };
                    }
                    return poBox;
                }());
                UniValidationModule.poBox = poBox;
                /**
                * Directive for select right option on the ul option list and not the first option
                */
                var showSelectedValueOfModel = (function () {
                    function showSelectedValueOfModel() {
                        // Usage:
                        // <input type="text" show-selected-value-of-model>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            scope.$on('openDDL', function (event, data) {
                                var idStr = "#select2-" + data.selectName + "-results";
                                var ul = angular.element(idStr).children('.select2-results__option');
                                var tempLi;
                                var len = ul.length;
                                for (var li = 0; li < len; li++) {
                                    tempLi = angular.element(idStr).children('.select2-results__option')[li];
                                    if (!!tempLi.attributes["aria-selected"]) {
                                        if (data.text == tempLi.textContent && tempLi.attributes["aria-selected"].value == "false") {
                                            tempLi.attributes["aria-selected"].value = "true";
                                        }
                                        else if (data.text != tempLi.textContent && tempLi.attributes["aria-selected"].value == "true") {
                                            tempLi.attributes["aria-selected"].value = "false";
                                        }
                                    }
                                }
                            });
                        };
                    }
                    return showSelectedValueOfModel;
                }());
                UniValidationModule.showSelectedValueOfModel = showSelectedValueOfModel;
                /**
                * Directive for fix unwanted behavior of mark not selected value
                */
                var markSelectedValue = (function () {
                    function markSelectedValue() {
                        // Usage:
                        // <input type="text" mark-selected-value>
                        this.restrict = 'A';
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            element.bind('click', function (element) {
                                scope.$broadcast('openDDL', {
                                    text: element["toElement"]["innerText"],
                                    selectName: element["toElement"].id.split("-")[1]
                                });
                            });
                        };
                    }
                    return markSelectedValue;
                }());
                UniValidationModule.markSelectedValue = markSelectedValue;
                /**
                * Directive for fix unwanted behavior of mark not selected valur
                */
                var focusInvalidForm = (function () {
                    function focusInvalidForm() {
                        // Usage:
                        // <input type="text" mark-selected-value>
                        this.restrict = 'A';
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            element.on('submit', function () {
                                var firstInvalid = element[0].querySelector('.ng-invalid');
                                var delay = 0;
                                var offset = window.innerWidth > 500 ? 400 : 220;
                                if (firstInvalid) {
                                    //$(firstInvalid).focus();
                                    $('html, body').animate({ scrollTop: $($(firstInvalid)[0]).offset().top - offset }, delay);
                                }
                            });
                        };
                    }
                    return focusInvalidForm;
                }());
                UniValidationModule.focusInvalidForm = focusInvalidForm;
                var uniIgnoreNonHebrewEnglish = (function () {
                    function uniIgnoreNonHebrewEnglish() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.hebrewEnglishOnly = function (modelValue, viewValue) {
                                element.bind("input", function (event) {
                                    var value = this.value.replace(UniValidationModule.regExp.HEBREWENGLISH, '');
                                    element.val(value);
                                    scope[attrs["ngModel"]] = value;
                                    ctrls[0].$setDirty();
                                });
                                element.bind("blur", function (event) {
                                    scope.$apply();
                                });
                                return !UniValidationModule.regExp.HEBREWENGLISH.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return uniIgnoreNonHebrewEnglish;
                }());
                UniValidationModule.uniIgnoreNonHebrewEnglish = uniIgnoreNonHebrewEnglish;
                /**
                * Directive for validating english  only
                */
                var uniIgnorNonEnglishValidator = (function () {
                    function uniIgnorNonEnglishValidator() {
                        // Usage:
                        // <input type="text" uni-ignor-non-english-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.englishOnly = function (modelValue, viewValue) {
                                element.bind("input", function (event) {
                                    var value = this.value.replace(UniValidationModule.regExp.ENGLISH, '');
                                    element.val(value);
                                    scope[attrs["ngModel"]] = value;
                                    ctrls[0].$setDirty();
                                });
                                element.bind("blur", function (event) {
                                    scope.$apply();
                                });
                                return !UniValidationModule.regExp.ENGLISH.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return uniIgnorNonEnglishValidator;
                }());
                UniValidationModule.uniIgnorNonEnglishValidator = uniIgnorNonEnglishValidator;
                /**
              * Directive for fix unwanted behavior of mark not selected valur
              */
                var uniIgnorNonNumberValidator = (function () {
                    function uniIgnorNonNumberValidator() {
                        // Usage:
                        // <input type="text" uni-number-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.number = function (modelValue, viewValue) {
                                element.bind('input', function (v) {
                                    var value = this.value.replace(/\D/g, '');
                                    element.val(value);
                                    scope[attrs["ngModel"]] = value;
                                    ctrls[0].$setDirty();
                                });
                                element.bind("blur", function (event) {
                                    scope.$apply();
                                });
                                return UniValidationModule.regExp.NUMBER.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return uniIgnorNonNumberValidator;
                }());
                UniValidationModule.uniIgnorNonNumberValidator = uniIgnorNonNumberValidator;
                /**
                 * Directive for validating english and numbers only
                 */
                var uniIgnorNonEnglishNumberValidator = (function () {
                    function uniIgnorNonEnglishNumberValidator() {
                        // Usage:
                        // <input type="text" uni-alpha-numeric-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.alphaNumeric = function (modelValue, viewValue) {
                                element.bind('input', function (v) {
                                    var value = this.value.replace(/[^a-zA-Z0-9 ]/g, '');
                                    element.val(value);
                                    scope[attrs["ngModel"]] = value;
                                    ctrls[0].$setDirty();
                                });
                                element.bind("blur", function (event) {
                                    scope.$apply();
                                });
                                return UniValidationModule.regExp.ALPHANUMERIC.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                                ;
                            };
                        };
                    }
                    return uniIgnorNonEnglishNumberValidator;
                }());
                UniValidationModule.uniIgnorNonEnglishNumberValidator = uniIgnorNonEnglishNumberValidator;
                /**
                 * Directive for validating float only
                 */
                var uniIgnorNonFloatValidator = (function () {
                    function uniIgnorNonFloatValidator($filter) {
                        this.$filter = $filter;
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            element.bind("input", function (event) {
                                var value = this.value.replace(/[^(0-9\.)]/g, '');
                                element.val(value);
                                scope[attrs["ngModel"]] = value;
                                ctrls[0].$setDirty();
                            });
                            element.bind("blur", function (event) {
                                scope.$apply();
                            });
                            ctrls[0].$validators.floatNumber = function (modelValue, viewValue) {
                                return UniValidationModule.regExp.SMART_FLOAT.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return uniIgnorNonFloatValidator;
                }());
                UniValidationModule.uniIgnorNonFloatValidator = uniIgnorNonFloatValidator;
                var uniIgnoreNonHebrew = (function () {
                    function uniIgnoreNonHebrew() {
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.hebrewOnly = function (modelValue, viewValue) {
                                element.bind("input", function (event) {
                                    var value = this.value.replace(/[^א-ת '"-]/g, '');
                                    if (attrs["maxlength"]) {
                                        value = value.toString().substring(0, attrs["maxlength"]);
                                    }
                                    element.val(value);
                                    scope[attrs["ngModel"]] = value;
                                    ctrls[0].$setDirty();
                                });
                                element.bind("blur", function (event) {
                                    scope.$apply();
                                });
                                return UniValidationModule.regExp.HEBREW.test(modelValue) || allowNullOrEmptyOrUndefined(modelValue);
                            };
                        };
                    }
                    return uniIgnoreNonHebrew;
                }());
                UniValidationModule.uniIgnoreNonHebrew = uniIgnoreNonHebrew;
                var uniHebrewOrEmpty = (function () {
                    function uniHebrewOrEmpty() {
                        // Usage:
                        // <input type="text" uni-alpha-numeric-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.hebrewOnly = function (modelValue) {
                                if (modelValue) {
                                    return UniValidationModule.regExp.HEBREW.test(modelValue);
                                }
                                return true;
                            };
                        };
                    }
                    return uniHebrewOrEmpty;
                }());
                UniValidationModule.uniHebrewOrEmpty = uniHebrewOrEmpty;
                var uniNumberEndHebrewValidator = (function () {
                    function uniNumberEndHebrewValidator() {
                        // Usage:
                        // <input type="text" uni-alpha-numeric-validator>
                        this.restrict = 'A';
                        this.require = ['ngModel'];
                        this.replace = false;
                        this.link = function (scope, element, attrs, ctrls) {
                            ctrls[0].$validators.numberEndHebrew = function (modelValue) {
                                if (modelValue) {
                                    var isNumber = UniValidationModule.regExp.NUMBER.test(modelValue);
                                    if (isNumber == false) {
                                        var numberPart = modelValue.substr(0, modelValue.length - 1);
                                        isNumber = UniValidationModule.regExp.NUMBER.test(numberPart);
                                        numberPart = modelValue.substr(modelValue.length - 1, 1);
                                        return isNumber && UniValidationModule.regExp.HEBREW.test(numberPart);
                                    }
                                    return true;
                                }
                                return false;
                            };
                        };
                    }
                    return uniNumberEndHebrewValidator;
                }());
                UniValidationModule.uniNumberEndHebrewValidator = uniNumberEndHebrewValidator;
                //function thousandSeparator(val, filter) {
                //    if (val == 0) {
                //        return "";
                //    }
                //    return filter(attrs["filter"])(val);
                //}
                //ctrls[0].$formatters.unshift(function (viewValue) {
                //    return thousandSeparator(viewValue, filter);
                //});
                //export class convertToNumber implements ng.IDirective {
                //    constructor() { }
                //    public restrict: string = 'A';
                //    public require: string[] = ['ngModel'];
                //    public link: Function = (
                //        scope: ng.IScope,
                //        element: ng.IAugmentedJQuery,
                //        attrs: ng.IAttributes,
                //        ctrls: any
                //        ) => {
                //        element.bind("span", function (event) {
                //            return parseInt(this.value, 10);
                //        });
                //        //ngModel.$formatters.push(function (val) {
                //        //    return '' + val;
                //        //});
                //    }
                //}
                //export class nextFocus implements ng.IDirective {
                //    constructor() { }
                //    public restrict: string = 'A';
                //    public require: string[] = ['ngModel'];
                //    public link: Function = (
                //        scope: ng.IScope,
                //        element: ng.IAugmentedJQuery,
                //        attrs: ng.IAttributes,
                //        ctrls: any
                //        ) => {
                //        element.on("input", function (e) {
                //            if (element.val().length == element.attr("maxlength")) {
                //                console.log('Bye');
                //                var $nextElement = element.next();
                //                if ($nextElement.length) {
                //                    $nextElement[0].focus();
                //                }
                //            }
                //        });
                //    }
                //    //element.bind('keydown', function (e) {
                //    //    var partsId = attrs["id"].match(/date(\d{1}) /);
                //    //    console.log(partsId);
                //    //var currentId = parseInt(partsId[1]);
                //    //console.log(currentId);
                //    //if (element.val().length == element.attr("maxlength")) {
                //    //    var nextElement = element.find('#date' + (currentId + 1)).focus();
                //    //    //var $nextElement = element.next();
                //    //    console.log(nextElement);
                //    //    if (nextElement.length) {
                //    //        nextElement[0].focus();
                //    //    }
                //    //}
                //    //var partsId = attrs["id"].match(/date(\d{1})/);
                //    //if (element.val().length == element.attr("maxlength"))
                //    //var currentId = parseInt(partsId[1]);
                //    //var code = e.keyCode || e.which;
                //    //if (code === 13) {
                //    //    e.preventDefault();
                //    //    element.find('#date' + (currentId + 1)).focus();
                //    //    console.log();
                //    //    return element;
                //    //}
                //    //});
                //}
                // ********End directive definitions **********
                // ******** Start adding to module **********
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniNumberValidator', [function () { return new UniValidationModule.uniNumberValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniApartmentNumberValidator', [function () { return new UniValidationModule.uniApartmentNumberValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniUrlAddress', [function () { return new UniValidationModule.uniUrlAddress(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniIdValidator', [function () { return new UniValidationModule.uniIdValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniPassportValidator', [function () { return new UniValidationModule.uniPassportValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('idValidator', [function () { return new UniValidationModule.idValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniAlphaNumericValidator', [function () { return new UniValidationModule.uniAlphaNumericValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniHebrewValidator', [function () { return new UniValidationModule.uniHebrewValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniEnglishValidator', [function () { return new UniValidationModule.uniEnglishValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('specialCharactersValidator', [function () { return new UniValidationModule.specialCharactersValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniNameValidator', [function () { return new UniValidationModule.uniNameValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('floatNumberValidator', ['$filter', function ($filter) { return new UniValidationModule.floatNumberValidator($filter); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniPasswordValidator', [function () { return new UniValidationModule.uniPasswordValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniEmailValidator', [function () { return new UniValidationModule.emailValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniMustEqualToValidator', [function () { return new UniValidationModule.mustEqualToValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniPhoneBodyValidator', [function () { return new UniValidationModule.phoneBodyValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniPhoneBodyOrEmptyValidator', [function () { return new UniValidationModule.phoneBodyOrEmptyValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniFullPhoneBodyValidator', [function () { return new UniValidationModule.fullPhoneBodyValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniCardNumberValidator', [function () { return new UniValidationModule.uniCardNumberValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniDayValidator', [function () { return new UniValidationModule.uniDayValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniMonthValidator', [function () { return new UniValidationModule.uniMonthValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniYearValidator', [function () { return new UniValidationModule.uniYearValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniYearMinAgeValidator', [function () { return new UniValidationModule.uniYearMinAgeValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('ignoreNonHebrew', [function () { return new UniValidationModule.ignoreNonHebrew(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('hebrewWithSpecialChar', [function () { return new UniValidationModule.hebrewWithSpecialChar(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('hebrewWithSpecialCharAndNumbers', [function () { return new UniValidationModule.hebrewWithSpecialCharAndNumbers(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('ignoreNonHebrewEnglish', [function () { return new UniValidationModule.ignoreNonHebrewEnglish(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('ignoreNonEnglish', [function () { return new UniValidationModule.ignoreNonEnglish(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('ignoreNonEnglishNumbers', [function () { return new UniValidationModule.ignoreNonEnglishNumbers(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('numberMin', [function () { return new UniValidationModule.numberMin(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('numberMax', [function () { return new UniValidationModule.numberMax(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('smartFloat', ['$filter', function ($filter) { return new UniValidationModule.smartFloat($filter); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('format', ['$filter', function ($filter) { return new UniValidationModule.format($filter); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('newFormat', ['$filter', function ($filter) { return new UniValidationModule.newFormat($filter); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('positiveNumber', ['$filter', function ($filter) { return new UniValidationModule.positiveNumber($filter); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('positiveNumberDecimal', ['$filter', function ($filter) { return new UniValidationModule.positiveNumberDecimal($filter); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniCheckIfNotEmptyValidator', [function () { return new UniValidationModule.removeValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('startWithZeroPhoneValidator', [function () { return new UniValidationModule.startWithZeroPhoneValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniLengthValidator', [function () { return new UniValidationModule.uniLengthValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniLengthValidatorIgnoreEmpty', [function () { return new UniValidationModule.uniLengthValidatorIgnoreEmpty(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('phoneBodyValidatorNotRequired', [function () { return new UniValidationModule.phoneBodyValidatorNotRequired(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniSearchValidator', [function () { return new UniValidationModule.uniSearchValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('zipCode', [function () { return new UniValidationModule.zipCode(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('poBox', [function () { return new UniValidationModule.poBox(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('showSelectedValueOfModel', [function () { return new UniValidationModule.showSelectedValueOfModel(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('markSelectedValue', [function () { return new UniValidationModule.markSelectedValue(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('focusInvalidForm', [function () { return new UniValidationModule.focusInvalidForm(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniIgnorNonEnglishValidator', [function () { return new UniValidationModule.uniIgnorNonEnglishValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniIgnorNonNumberValidator', [function () { return new UniValidationModule.uniIgnorNonNumberValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniIgnorNonEnglishNumberValidator', [function () { return new UniValidationModule.uniIgnorNonEnglishNumberValidator(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniIgnorNonFloatValidator', ['$filter', function ($filter) { return new UniValidationModule.uniIgnorNonFloatValidator($filter); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniIgnoreNonHebrewEnglish', [function () { return new UniValidationModule.uniIgnoreNonHebrewEnglish(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniIgnoreNonHebrew', [function () { return new UniValidationModule.uniIgnoreNonHebrew(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('onlyHebrewAndSpecialChar', [function () { return new UniValidationModule.onlyHebrewAndSpecialChar(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniHebrewOrEmpty', [function () { return new UniValidationModule.uniHebrewOrEmpty(); }]);
                angular
                    .module('app.Common.validations.UniValidationModule')
                    .directive('uniNumberEndHebrewValidator', [function () { return new UniValidationModule.uniNumberEndHebrewValidator(); }]);
                //angular
                //    .module('app.Common.validations.UniValidationModule')
                //    .directive('nextFocus', [() => { return new UniValidationModule.nextFocus() }]);
                //angular
                //    .module('app.Common.validations.UniValidationModule')
                //    .directive('convertToNumber', [() => { return new UniValidationModule.convertToNumber() }]);
                // ******** End adding to module **********
            })(UniValidationModule = validations.UniValidationModule || (validations.UniValidationModule = {}));
        })(validations = Common.validations || (Common.validations = {}));
    })(Common = app.Common || (app.Common = {}));
})(app || (app = {}));
//# sourceMappingURL=validation.directives.js.map;
function ObjecttoParams(obj) {
    var p = [];
    var ieLoop = isIEFunc();
    if (ieLoop) {
        for (var key in obj) {
            if (obj[key] != "emptyIgnoreDoNotAddToObjectParams") {
                p.push(key + '=' + encodeURIComponent(obj[key]));
            }
        }
    }
    else {
        for (var key in obj) {
            if (obj[key] != "emptyIgnoreDoNotAddToObjectParams") {
                p.push(key + '=' + obj[key]);
            }
        }
    }
    return p.join('&');
}
;
function ObjectParamsToHtml(obj) {
    var p = [];
    var ieLoop = isIEFunc();
    if (ieLoop) {
        for (var key in obj) {
            if (obj[key] != "emptyIgnoreDoNotAddToObjectParams") {
                if (key.toLowerCase() == 'transactiondate') {
                    var _date = new Date(obj[key]);
                    var curr_day = _date.getDate();
                    var curr_month = ('0' + (_date.getMonth() + 1)).slice(-2);
                    var curr_year = _date.getFullYear();
                    var new_date = curr_year + "/" + curr_month + "/" + curr_day;
                    p.push(" ----- " + key + ' : ' + new_date);
                }
                else
                    p.push(" ----- " + key + ' : ' + encodeURIComponent(obj[key]));
            }
        }
    }
    else {
        for (var key in obj) {
            if (obj[key] != "emptyIgnoreDoNotAddToObjectParams") {
                if (key.toLowerCase() == 'transactiondate') {
                    var _date = new Date(obj[key]);
                    var curr_day = _date.getDate();
                    var curr_month = ('0' + (_date.getMonth() + 1)).slice(-2);
                    var curr_year = _date.getFullYear();
                    var new_date = curr_year + "/" + curr_month + "/" + curr_day;
                    p.push(key + ' : ' + new_date);
                }
                else
                    p.push(key + ' : ' + obj[key]);
            }
        }
    }
    return p.join("<br/>");
}
;
function GetTotal(value) {
    if (value == null)
        return 0;
    else {
        //remove after decimal point from string
        //if (value.indexOf('.') > 0)
        //    return value.split('.')[0].toString();
        //else return value;
        var x = value.toString();
        var pattern = /(-?\d+)(\d{3})/;
        while (pattern.test(x))
            x = x.replace(pattern, "$1,$2");
        return x;
    }
}
;
function groupBy(collection, property) {
    var i = 0, val, index, values = [], result = [];
    for (; i < collection.length; i++) {
        val = collection[i][property];
        index = values.indexOf(val);
        if (index > -1)
            result[index].push(collection[i]);
        else {
            values.push(val);
            result.push([collection[i]]);
        }
    }
    return result;
}
;
function UniqueArraybyId(collection, keyname) {
    var output = [], keys = [];
    angular.forEach(collection, function (item) {
        var key = item[keyname];
        if (keys.indexOf(key) == -1) {
            keys.push(key);
            item.cardHolders.push(item.holderId);
            output.push(item);
        }
        else {
            var index = keys.indexOf(key);
            keys[index].Value += "," + key;
            output[index].cardHolders.push(item.holderId);
        }
    });
    return output;
}
;
function getHebrewMonth(month) {
    var months = new Array();
    months[0] = "";
    months[1] = "ינואר";
    months[2] = "פברואר";
    months[3] = "מרץ";
    months[4] = "אפריל";
    months[5] = "מאי";
    months[6] = "יוני";
    months[7] = "יולי";
    months[8] = "אוגוסט";
    months[9] = "ספטמבר";
    months[10] = "אוקטובר";
    months[11] = "נובמבר";
    months[12] = "דצמבר";
    return months[month];
}
function callExport(exportType, reqName, params, isOpenNew) {
    if (isOpenNew === void 0) {
        isOpenNew = false;
    }
    var url;
    exportUrl = exportUrl || "/Export/";
    if (exportType == "Print") {
        url = "?IsPrint=true" + "&" + ObjecttoParams(params);
    }
    else {
        angular.element(document.getElementById('datePickerTransactions')).scope()["transCtrl"].fetchNewTransData();
        url = exportUrl + exportType + "?reqName=" + reqName + "&" + ObjecttoParams(params) + "&" + app.Common.DigitalServicesModule.Constants.UserGuid;
        ;
    }
    if (isOpenNew == true) {
        setTimeout(function () {
            window.open(url);
        }, 1500);
    }
    else {
        //var xhttp = new XMLHttpRequest();
        //xhttp.open("GET", url, true);
        //xhttp.send();
        setTimeout(function () {
            window.location.href = url;
        }, 1500);
    }
}
//for new dashboard charges trans-list
function dashboradCHargescallExport(exportType, reqName, params, isOpenNew) {
    if (isOpenNew === void 0) {
        isOpenNew = false;
    }
    var url;
    exportUrl = exportUrl || "/Export/";
    if (exportType == "Print") {
        url = "?IsPrint=true" + "&" + ObjecttoParams(params);
    }
    else {
        angular.element("#datePickerTransactions").scope()["dc"].fetchNewTransData();
        url = exportUrl + exportType + "?reqName=" + reqName + "&" + ObjecttoParams(params) + "&" + app.Common.DigitalServicesModule.Constants.UserGuid;
    }
    if (isOpenNew == true) {
        setTimeout(function () {
            window.open(url);
        }, 1500);
    }
    else {
        //var xhttp = new XMLHttpRequest();
        //xhttp.open("GET", url, true);
        //xhttp.send();
        setTimeout(function () {
            window.location.href = url;
        }, 1500);
    }
}
var Time = function (timeString) {
    var t = timeString.split(":");
    this.hour = parseInt(t[0]);
    this.minutes = parseInt(t[1]);
    this.isBiggerThan = function (other) {
        return (this.hour > other.hour) || (this.hour === other.hour) && (this.minutes > other.minutes);
    };
};
function allowAlphaNumericOnlyKeyEvent(event) {
    var ew = event.which;
    if (48 <= ew && ew <= 57)
        return true;
    if (65 <= ew && ew <= 90)
        return true;
    if (97 <= ew && ew <= 122)
        return true;
    return false;
}
var allowHebrewOnly = function (event) {
    return ((event.charCode >= 1488 && event.charCode <= 1514) || allowSpecialCharacters(event));
};
var allowEnglishOnly = function (event) {
    return ((event.charCode >= 65 && event.charCode <= 90) || (event.charCode >= 97 && event.charCode <= 122) || allowSpecialCharacters(event));
};
var allowDigitsOnly = function (event) {
    return ((event.charCode == 0) || (event.charCode == 13) || (event.charCode >= 48 && event.charCode <= 57));
};
var allowSpecialCharacters = function (event) {
    return (event.charCode == 0) || (event.charCode == 32) || (event.charCode == 34) || (event.charCode == 39) || (event.charCode == 45);
};
var isNullOrEmptyOrUndefined = 
/**
* Returns true if value is undefined, or value is null, or value is empty;
*/
function (value) {
    return typeof value === "undefined" || value === null || value === "";
};
var toPromise = 
/**
* Use this function to convert object to promise
* @param $q ng.IQService.
* @param obj Object to convert.
*/
function ($q, obj) {
    var deferred = $q.defer();
    deferred.resolve(obj);
    return deferred.promise;
};
function GetQueryStringByParameter(name, url) {
    if (!url) {
        url = window.location.href;
    }
    name = name.replace(/[\[\]]/g, "\\$&");
    var regex = new RegExp("[?&]" + name.toLowerCase() + "(=([^&#]*)|&|#|$)"), results = regex.exec(url.toLowerCase());
    if (!results)
        return null;
    if (!results[2])
        return '';
    return decodeURIComponent(results[2].replace(/\+/g, " "));
}
function refreshCaptchaImage() {
    setTimeout(function () {
        var refresh = document.getElementById("SampleCaptcha_ReloadLink");
        refresh.click();
        $(window).scrollTop(0);
        $("form").find('input:visible:first').focus();
    }, 200);
}
function preventZero(e, value) {
    if ((e.keyCode == 48 || e.keyCode == 96) && value.length == 0) {
        e.preventDefault();
    }
}
function jumpToInput(e) {
    var inputId = e.srcElement.id;
    var lastChar = inputId.slice(-1);
    var next = lastChar.parseInt() + 1;
    document.getElementById("otp-number-input-" + next);
    console.log(next);
}
function pushEloquaGAParam(event) {
    setTimeout(function () {
        try {
            var eloquaParam = window.location.origin + window.location.pathname + "/GAEvent-" + event;
            window['_elq'].trackEvent(eloquaParam);
        }
        catch (err) {
            console.log("pushEloqua function in commonFunctions.ts the error text: " + err);
        }
    }, 2000);
}
//# sourceMappingURL=commonfunctions.js.map;
var app;
(function (app) {
    var Common;
    (function (Common) {
        var ReturnCodesModule;
        (function (ReturnCodesModule) {
            var ReturnCodeRequest = (function () {
                function ReturnCodeRequest(ServiceName, ReturnCode, EpiMessagePage) {
                    this.serviceName = ServiceName;
                    this.returnCode = ReturnCode;
                    this.epiMessagePage = EpiMessagePage;
                }
                return ReturnCodeRequest;
            }());
            ReturnCodesModule.ReturnCodeRequest = ReturnCodeRequest;
            var ReturnCodesService = (function () {
                function ReturnCodesService($http, $q) {
                    this.$http = $http;
                    this.$q = $q;
                    this.serviceURL = ReturnCodesServiceUrl;
                }
                ReturnCodesService.prototype.getMessage = function (data) {
                    var deferred = this.$q.defer();
                    var myServiceURL = this.serviceURL + '?servicename=' + data.serviceName + '&returncode=' + data.returnCode + '&epimessagepage=' + data.epiMessagePage;
                    this.$http.get(myServiceURL).then(function (response) {
                        deferred.resolve(response.data);
                    });
                    return deferred.promise;
                };
                return ReturnCodesService;
            }());
            ReturnCodesService.$inject = ["$http", "$q"];
            ReturnCodesModule.ReturnCodesService = ReturnCodesService;
        })(ReturnCodesModule = Common.ReturnCodesModule || (Common.ReturnCodesModule = {}));
    })(Common = app.Common || (app.Common = {}));
})(app || (app = {}));
angular.module('app.Common.ReturnCodesModule', []).service('app.Common.ReturnCodesModule.Service', app.Common.ReturnCodesModule.ReturnCodesService);
//# sourceMappingURL=returnCodes.js.map;
/*
 * angular-ui-bootstrap
 * http://angular-ui.github.io/bootstrap/

 * Version: 0.14.2 - 2015-10-13
 * License: MIT
 */
angular.module("ui.bootstrap", ["ui.bootstrap.tpls", "ui.bootstrap.collapse", "ui.bootstrap.accordion", "ui.bootstrap.alert", "ui.bootstrap.buttons", "ui.bootstrap.carousel", "ui.bootstrap.dateparser", "ui.bootstrap.position", "ui.bootstrap.datepicker", "ui.bootstrap.dropdown", "ui.bootstrap.stackedMap", "ui.bootstrap.modal", "ui.bootstrap.pagination", "ui.bootstrap.tooltip", "ui.bootstrap.popover", "ui.bootstrap.progressbar", "ui.bootstrap.rating", "ui.bootstrap.tabs", "ui.bootstrap.timepicker", "ui.bootstrap.typeahead"]), angular.module("ui.bootstrap.tpls", ["template/accordion/accordion-group.html", "template/accordion/accordion.html", "template/alert/alert.html", "template/carousel/carousel.html", "template/carousel/slide.html", "template/datepicker/datepicker.html", "template/datepicker/day.html", "template/datepicker/month.html", "template/datepicker/popup.html", "template/datepicker/year.html", "template/modal/backdrop.html", "template/modal/window.html", "template/pagination/pager.html", "template/pagination/pagination.html", "template/tooltip/tooltip-html-popup.html", "template/tooltip/tooltip-popup.html", "template/tooltip/tooltip-template-popup.html", "template/popover/popover-html.html", "template/popover/popover-template.html", "template/popover/popover.html", "template/progressbar/bar.html", "template/progressbar/progress.html", "template/progressbar/progressbar.html", "template/rating/rating.html", "template/tabs/tab.html", "template/tabs/tabset.html", "template/timepicker/timepicker.html", "template/typeahead/typeahead-match.html", "template/typeahead/typeahead-popup.html"]), angular.module("ui.bootstrap.collapse", []).directive("uibCollapse", ["$animate", "$injector", function (a, b) { var c = b.has("$animateCss") ? b.get("$animateCss") : null; return { link: function (b, d, e) { function f() { d.removeClass("collapse").addClass("collapsing").attr("aria-expanded", !0).attr("aria-hidden", !1), c ? c(d, { addClass: "in", easing: "ease", to: { height: d[0].scrollHeight + "px" } }).start().done(g) : a.addClass(d, "in", { to: { height: d[0].scrollHeight + "px" } }).then(g) } function g() { d.removeClass("collapsing").addClass("collapse").css({ height: "auto" }) } function h() { return d.hasClass("collapse") || d.hasClass("in") ? (d.css({ height: d[0].scrollHeight + "px" }).removeClass("collapse").addClass("collapsing").attr("aria-expanded", !1).attr("aria-hidden", !0), void (c ? c(d, { removeClass: "in", to: { height: "0" } }).start().done(i) : a.removeClass(d, "in", { to: { height: "0" } }).then(i))) : i() } function i() { d.css({ height: "0" }), d.removeClass("collapsing").addClass("collapse") } b.$watch(e.uibCollapse, function (a) { a ? h() : f() }) } } }]), angular.module("ui.bootstrap.collapse").value("$collapseSuppressWarning", !1).directive("collapse", ["$animate", "$injector", "$log", "$collapseSuppressWarning", function (a, b, c, d) { var e = b.has("$animateCss") ? b.get("$animateCss") : null; return { link: function (b, f, g) { function h() { f.removeClass("collapse").addClass("collapsing").attr("aria-expanded", !0).attr("aria-hidden", !1), e ? e(f, { addClass: "in", easing: "ease", to: { height: f[0].scrollHeight + "px" } }).start().done(i) : a.addClass(f, "in", { to: { height: f[0].scrollHeight + "px" } }).then(i) } function i() { f.removeClass("collapsing").addClass("collapse").css({ height: "auto" }) } function j() { return f.hasClass("collapse") || f.hasClass("in") ? (f.css({ height: f[0].scrollHeight + "px" }).removeClass("collapse").addClass("collapsing").attr("aria-expanded", !1).attr("aria-hidden", !0), void (e ? e(f, { removeClass: "in", to: { height: "0" } }).start().done(k) : a.removeClass(f, "in", { to: { height: "0" } }).then(k))) : k() } function k() { f.css({ height: "0" }), f.removeClass("collapsing").addClass("collapse") } d || c.warn("collapse is now deprecated. Use uib-collapse instead."), b.$watch(g.collapse, function (a) { a ? j() : h() }) } } }]), angular.module("ui.bootstrap.accordion", ["ui.bootstrap.collapse"]).constant("uibAccordionConfig", { closeOthers: !0 }).controller("UibAccordionController", ["$scope", "$attrs", "uibAccordionConfig", function (a, b, c) { this.groups = [], this.closeOthers = function (d) { var e = angular.isDefined(b.closeOthers) ? a.$eval(b.closeOthers) : c.closeOthers; e && angular.forEach(this.groups, function (a) { a !== d && (a.isOpen = !1) }) }, this.addGroup = function (a) { var b = this; this.groups.push(a), a.$on("$destroy", function (c) { b.removeGroup(a) }) }, this.removeGroup = function (a) { var b = this.groups.indexOf(a); -1 !== b && this.groups.splice(b, 1) } }]).directive("uibAccordion", function () { return { controller: "UibAccordionController", controllerAs: "accordion", transclude: !0, templateUrl: function (a, b) { return b.templateUrl || "template/accordion/accordion.html" } } }).directive("uibAccordionGroup", function () { return { require: "^uibAccordion", transclude: !0, replace: !0, templateUrl: function (a, b) { return b.templateUrl || "template/accordion/accordion-group.html" }, scope: { heading: "@", isOpen: "=?", isDisabled: "=?" }, controller: function () { this.setHeading = function (a) { this.heading = a } }, link: function (a, b, c, d) { d.addGroup(a), a.openClass = c.openClass || "panel-open", a.panelClass = c.panelClass, a.$watch("isOpen", function (c) { b.toggleClass(a.openClass, !!c), c && d.closeOthers(a) }), a.toggleOpen = function (b) { a.isDisabled || b && 32 !== b.which || (a.isOpen = !a.isOpen) } } } }).directive("uibAccordionHeading", function () { return { transclude: !0, template: "", replace: !0, require: "^uibAccordionGroup", link: function (a, b, c, d, e) { d.setHeading(e(a, angular.noop)) } } }).directive("uibAccordionTransclude", function () { return { require: ["?^uibAccordionGroup", "?^accordionGroup"], link: function (a, b, c, d) { d = d[0] ? d[0] : d[1], a.$watch(function () { return d[c.uibAccordionTransclude] }, function (a) { a && (b.find("span").html(""), b.find("span").append(a)) }) } } }), angular.module("ui.bootstrap.accordion").value("$accordionSuppressWarning", !1).controller("AccordionController", ["$scope", "$attrs", "$controller", "$log", "$accordionSuppressWarning", function (a, b, c, d, e) { e || d.warn("AccordionController is now deprecated. Use UibAccordionController instead."), angular.extend(this, c("UibAccordionController", { $scope: a, $attrs: b })) }]).directive("accordion", ["$log", "$accordionSuppressWarning", function (a, b) { return { restrict: "EA", controller: "AccordionController", controllerAs: "accordion", transclude: !0, replace: !1, templateUrl: function (a, b) { return b.templateUrl || "template/accordion/accordion.html" }, link: function () { b || a.warn("accordion is now deprecated. Use uib-accordion instead.") } } }]).directive("accordionGroup", ["$log", "$accordionSuppressWarning", function (a, b) { return { require: "^accordion", restrict: "EA", transclude: !0, replace: !0, templateUrl: function (a, b) { return b.templateUrl || "template/accordion/accordion-group.html" }, scope: { heading: "@", isOpen: "=?", isDisabled: "=?" }, controller: function () { this.setHeading = function (a) { this.heading = a } }, link: function (c, d, e, f) { b || a.warn("accordion-group is now deprecated. Use uib-accordion-group instead."), f.addGroup(c), c.openClass = e.openClass || "panel-open", c.panelClass = e.panelClass, c.$watch("isOpen", function (a) { d.toggleClass(c.openClass, !!a), a && f.closeOthers(c) }), c.toggleOpen = function (a) { c.isDisabled || a && 32 !== a.which || (c.isOpen = !c.isOpen) } } } }]).directive("accordionHeading", ["$log", "$accordionSuppressWarning", function (a, b) { return { restrict: "EA", transclude: !0, template: "", replace: !0, require: "^accordionGroup", link: function (c, d, e, f, g) { b || a.warn("accordion-heading is now deprecated. Use uib-accordion-heading instead."), f.setHeading(g(c, angular.noop)) } } }]).directive("accordionTransclude", ["$log", "$accordionSuppressWarning", function (a, b) { return { require: "^accordionGroup", link: function (c, d, e, f) { b || a.warn("accordion-transclude is now deprecated. Use uib-accordion-transclude instead."), c.$watch(function () { return f[e.accordionTransclude] }, function (a) { a && (d.find("span").html(""), d.find("span").append(a)) }) } } }]), angular.module("ui.bootstrap.alert", []).controller("UibAlertController", ["$scope", "$attrs", "$timeout", function (a, b, c) { a.closeable = !!b.close, angular.isDefined(b.dismissOnTimeout) && c(function () { a.close() }, parseInt(b.dismissOnTimeout, 10)) }]).directive("uibAlert", function () { return { controller: "UibAlertController", controllerAs: "alert", templateUrl: function (a, b) { return b.templateUrl || "template/alert/alert.html" }, transclude: !0, replace: !0, scope: { type: "@", close: "&" } } }), angular.module("ui.bootstrap.alert").value("$alertSuppressWarning", !1).controller("AlertController", ["$scope", "$attrs", "$controller", "$log", "$alertSuppressWarning", function (a, b, c, d, e) { e || d.warn("AlertController is now deprecated. Use UibAlertController instead."), angular.extend(this, c("UibAlertController", { $scope: a, $attrs: b })) }]).directive("alert", ["$log", "$alertSuppressWarning", function (a, b) { return { controller: "AlertController", controllerAs: "alert", templateUrl: function (a, b) { return b.templateUrl || "template/alert/alert.html" }, transclude: !0, replace: !0, scope: { type: "@", close: "&" }, link: function () { b || a.warn("alert is now deprecated. Use uib-alert instead.") } } }]), angular.module("ui.bootstrap.buttons", []).constant("uibButtonConfig", { activeClass: "active", toggleEvent: "click" }).controller("UibButtonsController", ["uibButtonConfig", function (a) { this.activeClass = a.activeClass || "active", this.toggleEvent = a.toggleEvent || "click" }]).directive("uibBtnRadio", function () { return { require: ["uibBtnRadio", "ngModel"], controller: "UibButtonsController", controllerAs: "buttons", link: function (a, b, c, d) { var e = d[0], f = d[1]; b.find("input").css({ display: "none" }), f.$render = function () { b.toggleClass(e.activeClass, angular.equals(f.$modelValue, a.$eval(c.uibBtnRadio))) }, b.on(e.toggleEvent, function () { if (!c.disabled) { var d = b.hasClass(e.activeClass); (!d || angular.isDefined(c.uncheckable)) && a.$apply(function () { f.$setViewValue(d ? null : a.$eval(c.uibBtnRadio)), f.$render() }) } }) } } }).directive("uibBtnCheckbox", ["$document", function (a) { return { require: ["uibBtnCheckbox", "ngModel"], controller: "UibButtonsController", controllerAs: "button", link: function (b, c, d, e) { function f() { return h(d.btnCheckboxTrue, !0) } function g() { return h(d.btnCheckboxFalse, !1) } function h(a, c) { return angular.isDefined(a) ? b.$eval(a) : c } var i = e[0], j = e[1]; c.find("input").css({ display: "none" }), j.$render = function () { c.toggleClass(i.activeClass, angular.equals(j.$modelValue, f())) }, c.on(i.toggleEvent, function () { d.disabled || b.$apply(function () { j.$setViewValue(c.hasClass(i.activeClass) ? g() : f()), j.$render() }) }), c.on("keypress", function (e) { d.disabled || 32 !== e.which || a[0].activeElement !== c[0] || b.$apply(function () { j.$setViewValue(c.hasClass(i.activeClass) ? g() : f()), j.$render() }) }) } } }]), angular.module("ui.bootstrap.buttons").value("$buttonsSuppressWarning", !1).controller("ButtonsController", ["$controller", "$log", "$buttonsSuppressWarning", function (a, b, c) { c || b.warn("ButtonsController is now deprecated. Use UibButtonsController instead."), angular.extend(this, a("UibButtonsController")) }]).directive("btnRadio", ["$log", "$buttonsSuppressWarning", function (a, b) { return { require: ["btnRadio", "ngModel"], controller: "ButtonsController", controllerAs: "buttons", link: function (c, d, e, f) { b || a.warn("btn-radio is now deprecated. Use uib-btn-radio instead."); var g = f[0], h = f[1]; d.find("input").css({ display: "none" }), h.$render = function () { d.toggleClass(g.activeClass, angular.equals(h.$modelValue, c.$eval(e.btnRadio))) }, d.bind(g.toggleEvent, function () { if (!e.disabled) { var a = d.hasClass(g.activeClass); (!a || angular.isDefined(e.uncheckable)) && c.$apply(function () { h.$setViewValue(a ? null : c.$eval(e.btnRadio)), h.$render() }) } }) } } }]).directive("btnCheckbox", ["$document", "$log", "$buttonsSuppressWarning", function (a, b, c) { return { require: ["btnCheckbox", "ngModel"], controller: "ButtonsController", controllerAs: "button", link: function (d, e, f, g) { function h() { return j(f.btnCheckboxTrue, !0) } function i() { return j(f.btnCheckboxFalse, !1) } function j(a, b) { var c = d.$eval(a); return angular.isDefined(c) ? c : b } c || b.warn("btn-checkbox is now deprecated. Use uib-btn-checkbox instead."); var k = g[0], l = g[1]; e.find("input").css({ display: "none" }), l.$render = function () { e.toggleClass(k.activeClass, angular.equals(l.$modelValue, h())) }, e.bind(k.toggleEvent, function () { f.disabled || d.$apply(function () { l.$setViewValue(e.hasClass(k.activeClass) ? i() : h()), l.$render() }) }), e.on("keypress", function (b) { f.disabled || 32 !== b.which || a[0].activeElement !== e[0] || d.$apply(function () { l.$setViewValue(e.hasClass(k.activeClass) ? i() : h()), l.$render() }) }) } } }]), angular.module("ui.bootstrap.carousel", []).controller("UibCarouselController", ["$scope", "$element", "$interval", "$animate", function (a, b, c, d) { function e(b, c, e) { s || (angular.extend(b, { direction: e, active: !0 }), angular.extend(m.currentSlide || {}, { direction: e, active: !1 }), d.enabled() && !a.noTransition && !a.$currentTransition && b.$element && m.slides.length > 1 && (b.$element.data(q, b.direction), m.currentSlide && m.currentSlide.$element && m.currentSlide.$element.data(q, b.direction), a.$currentTransition = !0, o ? d.on("addClass", b.$element, function (b, c) { "close" === c && (a.$currentTransition = null, d.off("addClass", b)) }) : b.$element.one("$animate:close", function () { a.$currentTransition = null })), m.currentSlide = b, r = c, g()) } function f(a) { if (angular.isUndefined(n[a].index)) return n[a]; var b; n.length; for (b = 0; b < n.length; ++b) if (n[b].index == a) return n[b] } function g() { h(); var b = +a.interval; !isNaN(b) && b > 0 && (k = c(i, b)) } function h() { k && (c.cancel(k), k = null) } function i() { var b = +a.interval; l && !isNaN(b) && b > 0 && n.length ? a.next() : a.pause() } function j(b) { b.length || (a.$currentTransition = null) } var k, l, m = this, n = m.slides = a.slides = [], o = angular.version.minor >= 4, p = "uib-noTransition", q = "uib-slideDirection", r = -1; m.currentSlide = null; var s = !1; m.select = a.select = function (b, c) { var d = a.indexOfSlide(b); void 0 === c && (c = d > m.getCurrentIndex() ? "next" : "prev"), b && b !== m.currentSlide && !a.$currentTransition && e(b, d, c) }, a.$on("$destroy", function () { s = !0 }), m.getCurrentIndex = function () { return m.currentSlide && angular.isDefined(m.currentSlide.index) ? +m.currentSlide.index : r }, a.indexOfSlide = function (a) { return angular.isDefined(a.index) ? +a.index : n.indexOf(a) }, a.next = function () { var b = (m.getCurrentIndex() + 1) % n.length; return 0 === b && a.noWrap() ? void a.pause() : m.select(f(b), "next") }, a.prev = function () { var b = m.getCurrentIndex() - 1 < 0 ? n.length - 1 : m.getCurrentIndex() - 1; return a.noWrap() && b === n.length - 1 ? void a.pause() : m.select(f(b), "prev") }, a.isActive = function (a) { return m.currentSlide === a }, a.$watch("interval", g), a.$watchCollection("slides", j), a.$on("$destroy", h), a.play = function () { l || (l = !0, g()) }, a.pause = function () { a.noPause || (l = !1, h()) }, m.addSlide = function (b, c) { b.$element = c, n.push(b), 1 === n.length || b.active ? (m.select(n[n.length - 1]), 1 === n.length && a.play()) : b.active = !1 }, m.removeSlide = function (a) { angular.isDefined(a.index) && n.sort(function (a, b) { return +a.index > +b.index }); var b = n.indexOf(a); n.splice(b, 1), n.length > 0 && a.active ? b >= n.length ? m.select(n[b - 1]) : m.select(n[b]) : r > b && r--, 0 === n.length && (m.currentSlide = null) }, a.$watch("noTransition", function (a) { b.data(p, a) }) }]).directive("uibCarousel", [function () { return { transclude: !0, replace: !0, controller: "UibCarouselController", controllerAs: "carousel", require: "carousel", templateUrl: function (a, b) { return b.templateUrl || "template/carousel/carousel.html" }, scope: { interval: "=", noTransition: "=", noPause: "=", noWrap: "&" } } }]).directive("uibSlide", function () { return { require: "^uibCarousel", restrict: "EA", transclude: !0, replace: !0, templateUrl: function (a, b) { return b.templateUrl || "template/carousel/slide.html" }, scope: { active: "=?", actual: "=?", index: "=?" }, link: function (a, b, c, d) { d.addSlide(a, b), a.$on("$destroy", function () { d.removeSlide(a) }), a.$watch("active", function (b) { b && d.select(a) }) } } }).animation(".item", ["$injector", "$animate", function (a, b) { function c(a, b, c) { a.removeClass(b), c && c() } var d = "uib-noTransition", e = "uib-slideDirection", f = null; return a.has("$animateCss") && (f = a.get("$animateCss")), { beforeAddClass: function (a, g, h) { if ("active" == g && a.parent() && a.parent().parent() && !a.parent().parent().data(d)) { var i = !1, j = a.data(e), k = "next" == j ? "left" : "right", l = c.bind(this, a, k + " " + j, h); return a.addClass(j), f ? f(a, { addClass: k }).start().done(l) : b.addClass(a, k).then(function () { i || l(), h() }), function () { i = !0 } } h() }, beforeRemoveClass: function (a, g, h) { if ("active" === g && a.parent() && a.parent().parent() && !a.parent().parent().data(d)) { var i = !1, j = a.data(e), k = "next" == j ? "left" : "right", l = c.bind(this, a, k, h); return f ? f(a, { addClass: k }).start().done(l) : b.addClass(a, k).then(function () { i || l(), h() }), function () { i = !0 } } h() } } }]), angular.module("ui.bootstrap.carousel").value("$carouselSuppressWarning", !1).controller("CarouselController", ["$scope", "$element", "$controller", "$log", "$carouselSuppressWarning", function (a, b, c, d, e) { e || d.warn("CarouselController is now deprecated. Use UibCarouselController instead."), angular.extend(this, c("UibCarouselController", { $scope: a, $element: b })) }]).directive("carousel", ["$log", "$carouselSuppressWarning", function (a, b) { return { transclude: !0, replace: !0, controller: "CarouselController", controllerAs: "carousel", require: "carousel", templateUrl: function (a, b) { return b.templateUrl || "template/carousel/carousel.html" }, scope: { interval: "=", noTransition: "=", noPause: "=", noWrap: "&" }, link: function () { b || a.warn("carousel is now deprecated. Use uib-carousel instead.") } } }]).directive("slide", ["$log", "$carouselSuppressWarning", function (a, b) { return { require: "^carousel", transclude: !0, replace: !0, templateUrl: function (a, b) { return b.templateUrl || "template/carousel/slide.html" }, scope: { active: "=?", actual: "=?", index: "=?" }, link: function (c, d, e, f) { b || a.warn("slide is now deprecated. Use uib-slide instead."), f.addSlide(c, d), c.$on("$destroy", function () { f.removeSlide(c) }), c.$watch("active", function (a) { a && f.select(c) }) } } }]), angular.module("ui.bootstrap.dateparser", []).service("uibDateParser", ["$log", "$locale", "orderByFilter", function (a, b, c) { function d(a) { var b = [], d = a.split(""); return angular.forEach(g, function (c, e) { var f = a.indexOf(e); if (f > -1) { a = a.split(""), d[f] = "(" + c.regex + ")", a[f] = "$"; for (var g = f + 1, h = f + e.length; h > g; g++) d[g] = "", a[g] = "$"; a = a.join(""), b.push({ index: f, apply: c.apply }) } }), { regex: new RegExp("^" + d.join("") + "$"), map: c(b, "index") } } function e(a, b, c) { return 1 > c ? !1 : 1 === b && c > 28 ? 29 === c && (a % 4 === 0 && a % 100 !== 0 || a % 400 === 0) : 3 === b || 5 === b || 8 === b || 10 === b ? 31 > c : !0 } var f, g, h = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g; this.init = function () { f = b.id, this.parsers = {}, g = { yyyy: { regex: "\\d{4}", apply: function (a) { this.year = +a } }, yy: { regex: "\\d{2}", apply: function (a) { this.year = +a + 2e3 } }, y: { regex: "\\d{1,4}", apply: function (a) { this.year = +a } }, MMMM: { regex: b.DATETIME_FORMATS.MONTH.join("|"), apply: function (a) { this.month = b.DATETIME_FORMATS.MONTH.indexOf(a) } }, MMM: { regex: b.DATETIME_FORMATS.SHORTMONTH.join("|"), apply: function (a) { this.month = b.DATETIME_FORMATS.SHORTMONTH.indexOf(a) } }, MM: { regex: "0[1-9]|1[0-2]", apply: function (a) { this.month = a - 1 } }, M: { regex: "[1-9]|1[0-2]", apply: function (a) { this.month = a - 1 } }, dd: { regex: "[0-2][0-9]{1}|3[0-1]{1}", apply: function (a) { this.date = +a } }, d: { regex: "[1-2]?[0-9]{1}|3[0-1]{1}", apply: function (a) { this.date = +a } }, EEEE: { regex: b.DATETIME_FORMATS.DAY.join("|") }, EEE: { regex: b.DATETIME_FORMATS.SHORTDAY.join("|") }, HH: { regex: "(?:0|1)[0-9]|2[0-3]", apply: function (a) { this.hours = +a } }, hh: { regex: "0[0-9]|1[0-2]", apply: function (a) { this.hours = +a } }, H: { regex: "1?[0-9]|2[0-3]", apply: function (a) { this.hours = +a } }, h: { regex: "[0-9]|1[0-2]", apply: function (a) { this.hours = +a } }, mm: { regex: "[0-5][0-9]", apply: function (a) { this.minutes = +a } }, m: { regex: "[0-9]|[1-5][0-9]", apply: function (a) { this.minutes = +a } }, sss: { regex: "[0-9][0-9][0-9]", apply: function (a) { this.milliseconds = +a } }, ss: { regex: "[0-5][0-9]", apply: function (a) { this.seconds = +a } }, s: { regex: "[0-9]|[1-5][0-9]", apply: function (a) { this.seconds = +a } }, a: { regex: b.DATETIME_FORMATS.AMPMS.join("|"), apply: function (a) { 12 === this.hours && (this.hours = 0), "PM" === a && (this.hours += 12) } } } }, this.init(), this.parse = function (c, g, i) { if (!angular.isString(c) || !g) return c; g = b.DATETIME_FORMATS[g] || g, g = g.replace(h, "\\$&"), b.id !== f && this.init(), this.parsers[g] || (this.parsers[g] = d(g)); var j = this.parsers[g], k = j.regex, l = j.map, m = c.match(k); if (m && m.length) { var n, o; angular.isDate(i) && !isNaN(i.getTime()) ? n = { year: i.getFullYear(), month: i.getMonth(), date: i.getDate(), hours: i.getHours(), minutes: i.getMinutes(), seconds: i.getSeconds(), milliseconds: i.getMilliseconds() } : (i && a.warn("dateparser:", "baseDate is not a valid date"), n = { year: 1900, month: 0, date: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0 }); for (var p = 1, q = m.length; q > p; p++) { var r = l[p - 1]; r.apply && r.apply.call(n, m[p]) } return e(n.year, n.month, n.date) && (o = new Date(n.year, n.month, n.date, n.hours, n.minutes, n.seconds, n.milliseconds || 0)), o } } }]), angular.module("ui.bootstrap.dateparser").value("$dateParserSuppressWarning", !1).service("dateParser", ["$log", "$dateParserSuppressWarning", "uibDateParser", function (a, b, c) { b || a.warn("dateParser is now deprecated. Use uibDateParser instead."), angular.extend(this, c) }]), angular.module("ui.bootstrap.position", []).factory("$uibPosition", ["$document", "$window", function (a, b) { function c(a, c) { return a.currentStyle ? a.currentStyle[c] : b.getComputedStyle ? b.getComputedStyle(a)[c] : a.style[c] } function d(a) { return "static" === (c(a, "position") || "static") } var e = function (b) { for (var c = a[0], e = b.offsetParent || c; e && e !== c && d(e) ;) e = e.offsetParent; return e || c }; return { position: function (b) { var c = this.offset(b), d = { top: 0, left: 0 }, f = e(b[0]); f != a[0] && (d = this.offset(angular.element(f)), d.top += f.clientTop - f.scrollTop, d.left += f.clientLeft - f.scrollLeft); var g = b[0].getBoundingClientRect(); return { width: g.width || b.prop("offsetWidth"), height: g.height || b.prop("offsetHeight"), top: c.top - d.top, left: c.left - d.left } }, offset: function (c) { var d = c[0].getBoundingClientRect(); return { width: d.width || c.prop("offsetWidth"), height: d.height || c.prop("offsetHeight"), top: d.top + (b.pageYOffset || a[0].documentElement.scrollTop), left: d.left + (b.pageXOffset || a[0].documentElement.scrollLeft) } }, positionElements: function (a, b, c, d) { var e, f, g, h, i = c.split("-"), j = i[0], k = i[1] || "center"; e = d ? this.offset(a) : this.position(a), f = b.prop("offsetWidth"), g = b.prop("offsetHeight"); var l = { center: function () { return e.left + e.width / 2 - f / 2 }, left: function () { return e.left }, right: function () { return e.left + e.width } }, m = { center: function () { return e.top + e.height / 2 - g / 2 }, top: function () { return e.top }, bottom: function () { return e.top + e.height } }; switch (j) { case "right": h = { top: m[k](), left: l[j]() }; break; case "left": h = { top: m[k](), left: e.left - f }; break; case "bottom": h = { top: m[j](), left: l[k]() }; break; default: h = { top: e.top - g, left: l[k]() } } return h } } }]), angular.module("ui.bootstrap.position").value("$positionSuppressWarning", !1).service("$position", ["$log", "$positionSuppressWarning", "$uibPosition", function (a, b, c) { b || a.warn("$position is now deprecated. Use $uibPosition instead."), angular.extend(this, c) }]), angular.module("ui.bootstrap.datepicker", ["ui.bootstrap.dateparser", "ui.bootstrap.position"]).value("$datepickerSuppressError", !1).constant("uibDatepickerConfig", { formatDay: "dd", formatMonth: "MMMM", formatYear: "yyyy", formatDayHeader: "EEE", formatDayTitle: "MMMM yyyy", formatMonthTitle: "yyyy", datepickerMode: "day", minMode: "day", maxMode: "year", showWeeks: !0, startingDay: 0, yearRange: 20, minDate: null, maxDate: null, shortcutPropagation: !1 }).controller("UibDatepickerController", ["$scope", "$attrs", "$parse", "$interpolate", "$log", "dateFilter", "uibDatepickerConfig", "$datepickerSuppressError", function (a, b, c, d, e, f, g, h) { var i = this, j = { $setViewValue: angular.noop }; this.modes = ["day", "month", "year"], angular.forEach(["formatDay", "formatMonth", "formatYear", "formatDayHeader", "formatDayTitle", "formatMonthTitle", "showWeeks", "startingDay", "yearRange", "shortcutPropagation"], function (c, e) { i[c] = angular.isDefined(b[c]) ? 6 > e ? d(b[c])(a.$parent) : a.$parent.$eval(b[c]) : g[c] }), angular.forEach(["minDate", "maxDate"], function (d) { b[d] ? a.$parent.$watch(c(b[d]), function (a) { i[d] = a ? new Date(a) : null, i.refreshView() }) : i[d] = g[d] ? new Date(g[d]) : null }), angular.forEach(["minMode", "maxMode"], function (d) { b[d] ? a.$parent.$watch(c(b[d]), function (c) { i[d] = angular.isDefined(c) ? c : b[d], a[d] = i[d], ("minMode" == d && i.modes.indexOf(a.datepickerMode) < i.modes.indexOf(i[d]) || "maxMode" == d && i.modes.indexOf(a.datepickerMode) > i.modes.indexOf(i[d])) && (a.datepickerMode = i[d]) }) : (i[d] = g[d] || null, a[d] = i[d]) }), a.datepickerMode = a.datepickerMode || g.datepickerMode, a.uniqueId = "datepicker-" + a.$id + "-" + Math.floor(1e4 * Math.random()), angular.isDefined(b.initDate) ? (this.activeDate = a.$parent.$eval(b.initDate) || new Date, a.$parent.$watch(b.initDate, function (a) { a && (j.$isEmpty(j.$modelValue) || j.$invalid) && (i.activeDate = a, i.refreshView()) })) : this.activeDate = new Date, a.isActive = function (b) { return 0 === i.compare(b.date, i.activeDate) ? (a.activeDateId = b.uid, !0) : !1 }, this.init = function (a) { j = a, j.$render = function () { i.render() } }, this.render = function () { if (j.$viewValue) { var a = new Date(j.$viewValue), b = !isNaN(a); b ? this.activeDate = a : h || e.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.') } this.refreshView() }, this.refreshView = function () { if (this.element) { this._refreshView(); var a = j.$viewValue ? new Date(j.$viewValue) : null; j.$setValidity("dateDisabled", !a || this.element && !this.isDisabled(a)) } }, this.createDateObject = function (a, b) { var c = j.$viewValue ? new Date(j.$viewValue) : null; return { date: a, label: f(a, b), selected: c && 0 === this.compare(a, c), disabled: this.isDisabled(a), current: 0 === this.compare(a, new Date), customClass: this.customClass(a) } }, this.isDisabled = function (c) { return this.minDate && this.compare(c, this.minDate) < 0 || this.maxDate && this.compare(c, this.maxDate) > 0 || b.dateDisabled && a.dateDisabled({ date: c, mode: a.datepickerMode }) }, this.customClass = function (b) { return a.customClass({ date: b, mode: a.datepickerMode }) }, this.split = function (a, b) { for (var c = []; a.length > 0;) c.push(a.splice(0, b)); return c }, this.fixTimeZone = function (a) { var b = a.getHours(); a.setHours(23 === b ? b + 2 : 0) }, a.select = function (b) { if (a.datepickerMode === i.minMode) { var c = j.$viewValue ? new Date(j.$viewValue) : new Date(0, 0, 0, 0, 0, 0, 0); c.setFullYear(b.getFullYear(), b.getMonth(), b.getDate()), j.$setViewValue(c), j.$render() } else i.activeDate = b, a.datepickerMode = i.modes[i.modes.indexOf(a.datepickerMode) - 1] }, a.move = function (a) { var b = i.activeDate.getFullYear() + a * (i.step.years || 0), c = i.activeDate.getMonth() + a * (i.step.months || 0); i.activeDate.setFullYear(b, c, 1), i.refreshView() }, a.toggleMode = function (b) { b = b || 1, a.datepickerMode === i.maxMode && 1 === b || a.datepickerMode === i.minMode && -1 === b || (a.datepickerMode = i.modes[i.modes.indexOf(a.datepickerMode) + b]) }, a.keys = { 13: "enter", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", 37: "left", 38: "up", 39: "right", 40: "down" }; var k = function () { i.element[0].focus() }; a.$on("uib:datepicker.focus", k), a.keydown = function (b) { var c = a.keys[b.which]; if (c && !b.shiftKey && !b.altKey) if (b.preventDefault(), i.shortcutPropagation || b.stopPropagation(), "enter" === c || "space" === c) { if (i.isDisabled(i.activeDate)) return; a.select(i.activeDate) } else !b.ctrlKey || "up" !== c && "down" !== c ? (i.handleKeyDown(c, b), i.refreshView()) : a.toggleMode("up" === c ? 1 : -1) } }]).controller("UibDaypickerController", ["$scope", "$element", "dateFilter", function (a, b, c) { function d(a, b) { return 1 !== b || a % 4 !== 0 || a % 100 === 0 && a % 400 !== 0 ? f[b] : 29 } function e(a) { var b = new Date(a); b.setDate(b.getDate() + 4 - (b.getDay() || 7)); var c = b.getTime(); return b.setMonth(0), b.setDate(1), Math.floor(Math.round((c - b) / 864e5) / 7) + 1 } var f = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; this.step = { months: 1 }, this.element = b, this.init = function (b) { angular.extend(b, this), a.showWeeks = b.showWeeks, b.refreshView() }, this.getDates = function (a, b) { for (var c, d = new Array(b), e = new Date(a), f = 0; b > f;) c = new Date(e), this.fixTimeZone(c), d[f++] = c, e.setDate(e.getDate() + 1); return d }, this._refreshView = function () { var b = this.activeDate.getFullYear(), d = this.activeDate.getMonth(), f = new Date(b, d, 1), g = this.startingDay - f.getDay(), h = g > 0 ? 7 - g : -g, i = new Date(f); h > 0 && i.setDate(-h + 1); for (var j = this.getDates(i, 42), k = 0; 42 > k; k++) j[k] = angular.extend(this.createDateObject(j[k], this.formatDay), { secondary: j[k].getMonth() !== d, uid: a.uniqueId + "-" + k }); a.labels = new Array(7); for (var l = 0; 7 > l; l++) a.labels[l] = { abbr: c(j[l].date, this.formatDayHeader), full: c(j[l].date, "EEEE") }; if (a.title = c(this.activeDate, this.formatDayTitle), a.rows = this.split(j, 7), a.showWeeks) { a.weekNumbers = []; for (var m = (11 - this.startingDay) % 7, n = a.rows.length, o = 0; n > o; o++) a.weekNumbers.push(e(a.rows[o][m].date)) } }, this.compare = function (a, b) { return new Date(a.getFullYear(), a.getMonth(), a.getDate()) - new Date(b.getFullYear(), b.getMonth(), b.getDate()) }, this.handleKeyDown = function (a, b) { var c = this.activeDate.getDate(); if ("left" === a) c -= 1; else if ("up" === a) c -= 7; else if ("right" === a) c += 1; else if ("down" === a) c += 7; else if ("pageup" === a || "pagedown" === a) { var e = this.activeDate.getMonth() + ("pageup" === a ? -1 : 1); this.activeDate.setMonth(e, 1), c = Math.min(d(this.activeDate.getFullYear(), this.activeDate.getMonth()), c) } else "home" === a ? c = 1 : "end" === a && (c = d(this.activeDate.getFullYear(), this.activeDate.getMonth())); this.activeDate.setDate(c) } }]).controller("UibMonthpickerController", ["$scope", "$element", "dateFilter", function (a, b, c) { this.step = { years: 1 }, this.element = b, this.init = function (a) { angular.extend(a, this), a.refreshView() }, this._refreshView = function () { for (var b, d = new Array(12), e = this.activeDate.getFullYear(), f = 0; 12 > f; f++) b = new Date(e, f, 1), this.fixTimeZone(b), d[f] = angular.extend(this.createDateObject(b, this.formatMonth), { uid: a.uniqueId + "-" + f }); a.title = c(this.activeDate, this.formatMonthTitle), a.rows = this.split(d, 3) }, this.compare = function (a, b) { return new Date(a.getFullYear(), a.getMonth()) - new Date(b.getFullYear(), b.getMonth()) }, this.handleKeyDown = function (a, b) { var c = this.activeDate.getMonth(); if ("left" === a) c -= 1; else if ("up" === a) c -= 3; else if ("right" === a) c += 1; else if ("down" === a) c += 3; else if ("pageup" === a || "pagedown" === a) { var d = this.activeDate.getFullYear() + ("pageup" === a ? -1 : 1); this.activeDate.setFullYear(d) } else "home" === a ? c = 0 : "end" === a && (c = 11); this.activeDate.setMonth(c) } }]).controller("UibYearpickerController", ["$scope", "$element", "dateFilter", function (a, b, c) { function d(a) { return parseInt((a - 1) / e, 10) * e + 1 } var e; this.element = b, this.yearpickerInit = function () { e = this.yearRange, this.step = { years: e } }, this._refreshView = function () { for (var b, c = new Array(e), f = 0, g = d(this.activeDate.getFullYear()) ; e > f; f++) b = new Date(g + f, 0, 1), this.fixTimeZone(b), c[f] = angular.extend(this.createDateObject(b, this.formatYear), { uid: a.uniqueId + "-" + f }); a.title = [c[0].label, c[e - 1].label].join(" - "), a.rows = this.split(c, 5) }, this.compare = function (a, b) { return a.getFullYear() - b.getFullYear() }, this.handleKeyDown = function (a, b) { var c = this.activeDate.getFullYear(); "left" === a ? c -= 1 : "up" === a ? c -= 5 : "right" === a ? c += 1 : "down" === a ? c += 5 : "pageup" === a || "pagedown" === a ? c += ("pageup" === a ? -1 : 1) * this.step.years : "home" === a ? c = d(this.activeDate.getFullYear()) : "end" === a && (c = d(this.activeDate.getFullYear()) + e - 1), this.activeDate.setFullYear(c) } }]).directive("uibDatepicker", function () { return { replace: !0, templateUrl: function (a, b) { return b.templateUrl || "template/datepicker/datepicker.html" }, scope: { datepickerMode: "=?", dateDisabled: "&", customClass: "&", shortcutPropagation: "&?" }, require: ["uibDatepicker", "^ngModel"], controller: "UibDatepickerController", controllerAs: "datepicker", link: function (a, b, c, d) { var e = d[0], f = d[1]; e.init(f) } } }).directive("uibDaypicker", function () { return { replace: !0, templateUrl: "template/datepicker/day.html", require: ["^?uibDatepicker", "uibDaypicker", "^?datepicker"], controller: "UibDaypickerController", link: function (a, b, c, d) { var e = d[0] || d[2], f = d[1]; f.init(e) } } }).directive("uibMonthpicker", function () { return { replace: !0, templateUrl: "template/datepicker/month.html", require: ["^?uibDatepicker", "uibMonthpicker", "^?datepicker"], controller: "UibMonthpickerController", link: function (a, b, c, d) { var e = d[0] || d[2], f = d[1]; f.init(e) } } }).directive("uibYearpicker", function () { return { replace: !0, templateUrl: "template/datepicker/year.html", require: ["^?uibDatepicker", "uibYearpicker", "^?datepicker"], controller: "UibYearpickerController", link: function (a, b, c, d) { var e = d[0] || d[2]; angular.extend(e, d[1]), e.yearpickerInit(), e.refreshView() } } }).constant("uibDatepickerPopupConfig", { datepickerPopup: "yyyy-MM-dd", datepickerPopupTemplateUrl: "template/datepicker/popup.html", datepickerTemplateUrl: "template/datepicker/datepicker.html", html5Types: { date: "yyyy-MM-dd", "datetime-local": "yyyy-MM-ddTHH:mm:ss.sss", month: "yyyy-MM" }, currentText: "Today", clearText: "Clear", closeText: "Done", closeOnDateSelection: !0, appendToBody: !1, showButtonBar: !0, onOpenFocus: !0 }).controller("UibDatepickerPopupController", ["$scope", "$element", "$attrs", "$compile", "$parse", "$document", "$rootScope", "$uibPosition", "dateFilter", "uibDateParser", "uibDatepickerPopupConfig", "$timeout", function (a, b, c, d, e, f, g, h, i, j, k, l) {
    function m(a) { return a.replace(/([A-Z])/g, function (a) { return "-" + a.toLowerCase() }) } function n(b) { if (angular.isNumber(b) && (b = new Date(b)), b) { if (angular.isDate(b) && !isNaN(b)) return b; if (angular.isString(b)) { var c = j.parse(b, r, a.date); return isNaN(c) ? void 0 : c } return void 0 } return null } function o(a, b) { var d = a || b; if (!c.ngRequired && !d) return !0; if (angular.isNumber(d) && (d = new Date(d)), d) { if (angular.isDate(d) && !isNaN(d)) return !0; if (angular.isString(d)) { var e = j.parse(d, r); return !isNaN(e) } return !1 } return !0 } function p(c) { var d = A[0], e = b[0].contains(c.target), f = void 0 !== d.contains && d.contains(c.target); !a.isOpen || e || f || a.$apply(function () { a.isOpen = !1 }) } function q(c) { 27 === c.which && a.isOpen ? (c.preventDefault(), c.stopPropagation(), a.$apply(function () { a.isOpen = !1 }), b[0].focus()) : 40 !== c.which || a.isOpen || (c.preventDefault(), c.stopPropagation(), a.$apply(function () { a.isOpen = !0 })) } var r, s, t, u, v, w, x, y, z, A, B = {}, C = !1; a.watchData = {}, this.init = function (h) { if (z = h, s = angular.isDefined(c.closeOnDateSelection) ? a.$parent.$eval(c.closeOnDateSelection) : k.closeOnDateSelection, t = angular.isDefined(c.datepickerAppendToBody) ? a.$parent.$eval(c.datepickerAppendToBody) : k.appendToBody, u = angular.isDefined(c.onOpenFocus) ? a.$parent.$eval(c.onOpenFocus) : k.onOpenFocus, v = angular.isDefined(c.datepickerPopupTemplateUrl) ? c.datepickerPopupTemplateUrl : k.datepickerPopupTemplateUrl, w = angular.isDefined(c.datepickerTemplateUrl) ? c.datepickerTemplateUrl : k.datepickerTemplateUrl, a.showButtonBar = angular.isDefined(c.showButtonBar) ? a.$parent.$eval(c.showButtonBar) : k.showButtonBar, k.html5Types[c.type] ? (r = k.html5Types[c.type], C = !0) : (r = c.datepickerPopup || k.datepickerPopup, c.$observe("uibDatepickerPopup", function (a, b) { var c = a || k.datepickerPopup; if (c !== r && (r = c, z.$modelValue = null, !r)) throw new Error("uibDatepickerPopup must have a date format specified.") })), !r) throw new Error("uibDatepickerPopup must have a date format specified."); if (C && c.datepickerPopup) throw new Error("HTML5 date input types do not support custom formats."); if (x = angular.element("<div uib-datepicker-popup-wrap><div uib-datepicker></div></div>"), x.attr({ "ng-model": "date", "ng-change": "dateSelection(date)", "template-url": v }), y = angular.element(x.children()[0]), y.attr("template-url", w), C && "month" === c.type && (y.attr("datepicker-mode", '"month"'), y.attr("min-mode", "month")), c.datepickerOptions) { var l = a.$parent.$eval(c.datepickerOptions); l && l.initDate && (a.initDate = l.initDate, y.attr("init-date", "initDate"), delete l.initDate), angular.forEach(l, function (a, b) { y.attr(m(b), a) }) } angular.forEach(["minMode", "maxMode", "minDate", "maxDate", "datepickerMode", "initDate", "shortcutPropagation"], function (b) { if (c[b]) { var d = e(c[b]); if (a.$parent.$watch(d, function (c) { a.watchData[b] = c, ("minDate" === b || "maxDate" === b) && (B[b] = new Date(c)) }), y.attr(m(b), "watchData." + b), "datepickerMode" === b) { var f = d.assign; a.$watch("watchData." + b, function (b, c) { angular.isFunction(f) && b !== c && f(a.$parent, b) }) } } }), c.dateDisabled && y.attr("date-disabled", "dateDisabled({ date: date, mode: mode })"), c.showWeeks && y.attr("show-weeks", c.showWeeks), c.customClass && y.attr("custom-class", "customClass({ date: date, mode: mode })"), C ? z.$formatters.push(function (b) { return a.date = b, b }) : (z.$$parserName = "date", z.$validators.date = o, z.$parsers.unshift(n), z.$formatters.push(function (b) { return a.date = b, z.$isEmpty(b) ? b : i(b, r) })), z.$viewChangeListeners.push(function () { a.date = j.parse(z.$viewValue, r, a.date) }), b.bind("keydown", q), A = d(x)(a), x.remove(), t ? f.find("body").append(A) : b.after(A), a.$on("$destroy", function () { a.isOpen === !0 && (g.$$phase || a.$apply(function () { a.isOpen = !1 })), A.remove(), b.unbind("keydown", q), f.unbind("click", p) }) }, a.getText = function (b) { return a[b + "Text"] || k[b + "Text"] }, a.isDisabled = function (b) { return "today" === b && (b = new Date), a.watchData.minDate && a.compare(b, B.minDate) < 0 || a.watchData.maxDate && a.compare(b, B.maxDate) > 0 }, a.compare = function (a, b) { return new Date(a.getFullYear(), a.getMonth(), a.getDate()) - new Date(b.getFullYear(), b.getMonth(), b.getDate()) }, a.dateSelection = function (c) { angular.isDefined(c) && (a.date = c); var d = a.date ? i(a.date, r) : null; b.val(d), z.$setViewValue(d), s && (a.isOpen = !1, b[0].focus()) }, a.keydown = function (c) { 27 === c.which && (a.isOpen = !1, b[0].focus()) }, a.select = function (b) { if ("today" === b) { var c = new Date; angular.isDate(a.date) ? (b = new Date(a.date), b.setFullYear(c.getFullYear(), c.getMonth(), c.getDate())) : b = new Date(c.setHours(0, 0, 0, 0)) } a.dateSelection(b) }, a.close = function () { a.isOpen = !1, b[0].focus() }, a.$watch("isOpen", function (c) { c ? (a.position = t ? h.offset(b) : h.position(b), a.position.top = a.position.top + b.prop("offsetHeight"), l(function () { u && a.$broadcast("uib:datepicker.focus"), f.bind("click", p) }, 0, !1)) : f.unbind("click", p) })
}]).directive("uibDatepickerPopup", function () { return { require: ["ngModel", "uibDatepickerPopup"], controller: "UibDatepickerPopupController", scope: { isOpen: "=?", currentText: "@", clearText: "@", closeText: "@", dateDisabled: "&", customClass: "&" }, link: function (a, b, c, d) { var e = d[0], f = d[1]; f.init(e) } } }).directive("uibDatepickerPopupWrap", function () { return { replace: !0, transclude: !0, templateUrl: function (a, b) { return b.templateUrl || "template/datepicker/popup.html" } } }), angular.module("ui.bootstrap.datepicker").value("$datepickerSuppressWarning", !1).controller("DatepickerController", ["$scope", "$attrs", "$parse", "$interpolate", "$log", "dateFilter", "uibDatepickerConfig", "$datepickerSuppressError", "$datepickerSuppressWarning", function (a, b, c, d, e, f, g, h, i) { i || e.warn("DatepickerController is now deprecated. Use UibDatepickerController instead."); var j = this, k = { $setViewValue: angular.noop }; this.modes = ["day", "month", "year"], angular.forEach(["formatDay", "formatMonth", "formatYear", "formatDayHeader", "formatDayTitle", "formatMonthTitle", "showWeeks", "startingDay", "yearRange", "shortcutPropagation"], function (c, e) { j[c] = angular.isDefined(b[c]) ? 6 > e ? d(b[c])(a.$parent) : a.$parent.$eval(b[c]) : g[c] }), angular.forEach(["minDate", "maxDate"], function (d) { b[d] ? a.$parent.$watch(c(b[d]), function (a) { j[d] = a ? new Date(a) : null, j.refreshView() }) : j[d] = g[d] ? new Date(g[d]) : null }), angular.forEach(["minMode", "maxMode"], function (d) { b[d] ? a.$parent.$watch(c(b[d]), function (c) { j[d] = angular.isDefined(c) ? c : b[d], a[d] = j[d], ("minMode" == d && j.modes.indexOf(a.datepickerMode) < j.modes.indexOf(j[d]) || "maxMode" == d && j.modes.indexOf(a.datepickerMode) > j.modes.indexOf(j[d])) && (a.datepickerMode = j[d]) }) : (j[d] = g[d] || null, a[d] = j[d]) }), a.datepickerMode = a.datepickerMode || g.datepickerMode, a.uniqueId = "datepicker-" + a.$id + "-" + Math.floor(1e4 * Math.random()), angular.isDefined(b.initDate) ? (this.activeDate = a.$parent.$eval(b.initDate) || new Date, a.$parent.$watch(b.initDate, function (a) { a && (k.$isEmpty(k.$modelValue) || k.$invalid) && (j.activeDate = a, j.refreshView()) })) : this.activeDate = new Date, a.isActive = function (b) { return 0 === j.compare(b.date, j.activeDate) ? (a.activeDateId = b.uid, !0) : !1 }, this.init = function (a) { k = a, k.$render = function () { j.render() } }, this.render = function () { if (k.$viewValue) { var a = new Date(k.$viewValue), b = !isNaN(a); b ? this.activeDate = a : h || e.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.') } this.refreshView() }, this.refreshView = function () { if (this.element) { this._refreshView(); var a = k.$viewValue ? new Date(k.$viewValue) : null; k.$setValidity("dateDisabled", !a || this.element && !this.isDisabled(a)) } }, this.createDateObject = function (a, b) { var c = k.$viewValue ? new Date(k.$viewValue) : null; return { date: a, label: f(a, b), selected: c && 0 === this.compare(a, c), disabled: this.isDisabled(a), current: 0 === this.compare(a, new Date), customClass: this.customClass(a) } }, this.isDisabled = function (c) { return this.minDate && this.compare(c, this.minDate) < 0 || this.maxDate && this.compare(c, this.maxDate) > 0 || b.dateDisabled && a.dateDisabled({ date: c, mode: a.datepickerMode }) }, this.customClass = function (b) { return a.customClass({ date: b, mode: a.datepickerMode }) }, this.split = function (a, b) { for (var c = []; a.length > 0;) c.push(a.splice(0, b)); return c }, this.fixTimeZone = function (a) { var b = a.getHours(); a.setHours(23 === b ? b + 2 : 0) }, a.select = function (b) { if (a.datepickerMode === j.minMode) { var c = k.$viewValue ? new Date(k.$viewValue) : new Date(0, 0, 0, 0, 0, 0, 0); c.setFullYear(b.getFullYear(), b.getMonth(), b.getDate()), k.$setViewValue(c), k.$render() } else j.activeDate = b, a.datepickerMode = j.modes[j.modes.indexOf(a.datepickerMode) - 1] }, a.move = function (a) { var b = j.activeDate.getFullYear() + a * (j.step.years || 0), c = j.activeDate.getMonth() + a * (j.step.months || 0); j.activeDate.setFullYear(b, c, 1), j.refreshView() }, a.toggleMode = function (b) { b = b || 1, a.datepickerMode === j.maxMode && 1 === b || a.datepickerMode === j.minMode && -1 === b || (a.datepickerMode = j.modes[j.modes.indexOf(a.datepickerMode) + b]) }, a.keys = { 13: "enter", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", 37: "left", 38: "up", 39: "right", 40: "down" }; var l = function () { j.element[0].focus() }; a.$on("uib:datepicker.focus", l), a.keydown = function (b) { var c = a.keys[b.which]; if (c && !b.shiftKey && !b.altKey) if (b.preventDefault(), j.shortcutPropagation || b.stopPropagation(), "enter" === c || "space" === c) { if (j.isDisabled(j.activeDate)) return; a.select(j.activeDate) } else !b.ctrlKey || "up" !== c && "down" !== c ? (j.handleKeyDown(c, b), j.refreshView()) : a.toggleMode("up" === c ? 1 : -1) } }]).directive("datepicker", ["$log", "$datepickerSuppressWarning", function (a, b) { return { replace: !0, templateUrl: function (a, b) { return b.templateUrl || "template/datepicker/datepicker.html" }, scope: { datepickerMode: "=?", dateDisabled: "&", customClass: "&", shortcutPropagation: "&?" }, require: ["datepicker", "^ngModel"], controller: "DatepickerController", controllerAs: "datepicker", link: function (c, d, e, f) { b || a.warn("datepicker is now deprecated. Use uib-datepicker instead."); var g = f[0], h = f[1]; g.init(h) } } }]).directive("daypicker", ["$log", "$datepickerSuppressWarning", function (a, b) { return { replace: !0, templateUrl: "template/datepicker/day.html", require: ["^datepicker", "daypicker"], controller: "UibDaypickerController", link: function (c, d, e, f) { b || a.warn("daypicker is now deprecated. Use uib-daypicker instead."); var g = f[0], h = f[1]; h.init(g) } } }]).directive("monthpicker", ["$log", "$datepickerSuppressWarning", function (a, b) { return { replace: !0, templateUrl: "template/datepicker/month.html", require: ["^datepicker", "monthpicker"], controller: "UibMonthpickerController", link: function (c, d, e, f) { b || a.warn("monthpicker is now deprecated. Use uib-monthpicker instead."); var g = f[0], h = f[1]; h.init(g) } } }]).directive("yearpicker", ["$log", "$datepickerSuppressWarning", function (a, b) { return { replace: !0, templateUrl: "template/datepicker/year.html", require: ["^datepicker", "yearpicker"], controller: "UibYearpickerController", link: function (c, d, e, f) { b || a.warn("yearpicker is now deprecated. Use uib-yearpicker instead."); var g = f[0]; angular.extend(g, f[1]), g.yearpickerInit(), g.refreshView() } } }]).directive("datepickerPopup", ["$log", "$datepickerSuppressWarning", function (a, b) { return { require: ["ngModel", "datepickerPopup"], controller: "UibDatepickerPopupController", scope: { isOpen: "=?", currentText: "@", clearText: "@", closeText: "@", dateDisabled: "&", customClass: "&" }, link: function (c, d, e, f) { b || a.warn("datepicker-popup is now deprecated. Use uib-datepicker-popup instead."); var g = f[0], h = f[1]; h.init(g) } } }]).directive("datepickerPopupWrap", ["$log", "$datepickerSuppressWarning", function (a, b) { return { replace: !0, transclude: !0, templateUrl: function (a, b) { return b.templateUrl || "template/datepicker/popup.html" }, link: function () { b || a.warn("datepicker-popup-wrap is now deprecated. Use uib-datepicker-popup-wrap instead.") } } }]), angular.module("ui.bootstrap.dropdown", ["ui.bootstrap.position"]).constant("uibDropdownConfig", { openClass: "open" }).service("uibDropdownService", ["$document", "$rootScope", function (a, b) { var c = null; this.open = function (b) { c || (a.bind("click", d), a.bind("keydown", e)), c && c !== b && (c.isOpen = !1), c = b }, this.close = function (b) { c === b && (c = null, a.unbind("click", d), a.unbind("keydown", e)) }; var d = function (a) { if (c && (!a || "disabled" !== c.getAutoClose())) { var d = c.getToggleElement(); if (!(a && d && d[0].contains(a.target))) { var e = c.getDropdownElement(); a && "outsideClick" === c.getAutoClose() && e && e[0].contains(a.target) || (c.isOpen = !1, b.$$phase || c.$apply()) } } }, e = function (a) { 27 === a.which ? (c.focusToggleElement(), d()) : c.isKeynavEnabled() && /(38|40)/.test(a.which) && c.isOpen && (a.preventDefault(), a.stopPropagation(), c.focusDropdownEntry(a.which)) } }]).controller("UibDropdownController", ["$scope", "$element", "$attrs", "$parse", "uibDropdownConfig", "uibDropdownService", "$animate", "$uibPosition", "$document", "$compile", "$templateRequest", function (a, b, c, d, e, f, g, h, i, j, k) { var l, m, n = this, o = a.$new(), p = e.openClass, q = angular.noop, r = c.onToggle ? d(c.onToggle) : angular.noop, s = !1, t = !1; b.addClass("dropdown"), this.init = function () { c.isOpen && (m = d(c.isOpen), q = m.assign, a.$watch(m, function (a) { o.isOpen = !!a })), s = angular.isDefined(c.dropdownAppendToBody), t = angular.isDefined(c.uibKeyboardNav), s && n.dropdownMenu && (i.find("body").append(n.dropdownMenu), b.on("$destroy", function () { n.dropdownMenu.remove() })) }, this.toggle = function (a) { return o.isOpen = arguments.length ? !!a : !o.isOpen }, this.isOpen = function () { return o.isOpen }, o.getToggleElement = function () { return n.toggleElement }, o.getAutoClose = function () { return c.autoClose || "always" }, o.getElement = function () { return b }, o.isKeynavEnabled = function () { return t }, o.focusDropdownEntry = function (a) { var c = n.dropdownMenu ? angular.element(n.dropdownMenu).find("a") : angular.element(b).find("ul").eq(0).find("a"); switch (a) { case 40: angular.isNumber(n.selectedOption) ? n.selectedOption = n.selectedOption === c.length - 1 ? n.selectedOption : n.selectedOption + 1 : n.selectedOption = 0; break; case 38: angular.isNumber(n.selectedOption) ? n.selectedOption = 0 === n.selectedOption ? 0 : n.selectedOption - 1 : n.selectedOption = c.length - 1 } c[n.selectedOption].focus() }, o.getDropdownElement = function () { return n.dropdownMenu }, o.focusToggleElement = function () { n.toggleElement && n.toggleElement[0].focus() }, o.$watch("isOpen", function (c, d) { if (s && n.dropdownMenu) { var e = h.positionElements(b, n.dropdownMenu, "bottom-left", !0), i = { top: e.top + "px", display: c ? "block" : "none" }, m = n.dropdownMenu.hasClass("dropdown-menu-right"); m ? (i.left = "auto", i.right = window.innerWidth - (e.left + b.prop("offsetWidth")) + "px") : (i.left = e.left + "px", i.right = "auto"), n.dropdownMenu.css(i) } if (g[c ? "addClass" : "removeClass"](b, p).then(function () { angular.isDefined(c) && c !== d && r(a, { open: !!c }) }), c) n.dropdownMenuTemplateUrl && k(n.dropdownMenuTemplateUrl).then(function (a) { l = o.$new(), j(a.trim())(l, function (a) { var b = a; n.dropdownMenu.replaceWith(b), n.dropdownMenu = b }) }), o.focusToggleElement(), f.open(o); else { if (n.dropdownMenuTemplateUrl) { l && l.$destroy(); var t = angular.element('<ul class="dropdown-menu"></ul>'); n.dropdownMenu.replaceWith(t), n.dropdownMenu = t } f.close(o), n.selectedOption = null } angular.isFunction(q) && q(a, c) }), a.$on("$locationChangeSuccess", function () { "disabled" !== o.getAutoClose() && (o.isOpen = !1) }); var u = a.$on("$destroy", function () { o.$destroy() }); o.$on("$destroy", u) }]).directive("uibDropdown", function () { return { controller: "UibDropdownController", link: function (a, b, c, d) { d.init() } } }).directive("uibDropdownMenu", function () { return { restrict: "AC", require: "?^uibDropdown", link: function (a, b, c, d) { if (d && !angular.isDefined(c.dropdownNested)) { b.addClass("dropdown-menu"); var e = c.templateUrl; e && (d.dropdownMenuTemplateUrl = e), d.dropdownMenu || (d.dropdownMenu = b) } } } }).directive("uibKeyboardNav", function () { return { restrict: "A", require: "?^uibDropdown", link: function (a, b, c, d) { b.bind("keydown", function (a) { if (-1 !== [38, 40].indexOf(a.which)) { a.preventDefault(), a.stopPropagation(); var b = d.dropdownMenu.find("a"); switch (a.which) { case 40: angular.isNumber(d.selectedOption) ? d.selectedOption = d.selectedOption === b.length - 1 ? d.selectedOption : d.selectedOption + 1 : d.selectedOption = 0; break; case 38: angular.isNumber(d.selectedOption) ? d.selectedOption = 0 === d.selectedOption ? 0 : d.selectedOption - 1 : d.selectedOption = b.length - 1 } b[d.selectedOption].focus() } }) } } }).directive("uibDropdownToggle", function () { return { require: "?^uibDropdown", link: function (a, b, c, d) { if (d) { b.addClass("dropdown-toggle"), d.toggleElement = b; var e = function (e) { e.preventDefault(), b.hasClass("disabled") || c.disabled || a.$apply(function () { d.toggle() }) }; b.bind("click", e), b.attr({ "aria-haspopup": !0, "aria-expanded": !1 }), a.$watch(d.isOpen, function (a) { b.attr("aria-expanded", !!a) }), a.$on("$destroy", function () { b.unbind("click", e) }) } } } }), angular.module("ui.bootstrap.dropdown").value("$dropdownSuppressWarning", !1).service("dropdownService", ["$log", "$dropdownSuppressWarning", "uibDropdownService", function (a, b, c) { b || a.warn("dropdownService is now deprecated. Use uibDropdownService instead."), angular.extend(this, c) }]).controller("DropdownController", ["$scope", "$element", "$attrs", "$parse", "uibDropdownConfig", "uibDropdownService", "$animate", "$uibPosition", "$document", "$compile", "$templateRequest", "$log", "$dropdownSuppressWarning", function (a, b, c, d, e, f, g, h, i, j, k, l, m) { m || l.warn("DropdownController is now deprecated. Use UibDropdownController instead."); var n, o, p = this, q = a.$new(), r = e.openClass, s = angular.noop, t = c.onToggle ? d(c.onToggle) : angular.noop, u = !1, v = !1; b.addClass("dropdown"), this.init = function () { c.isOpen && (o = d(c.isOpen), s = o.assign, a.$watch(o, function (a) { q.isOpen = !!a })), u = angular.isDefined(c.dropdownAppendToBody), v = angular.isDefined(c.uibKeyboardNav), u && p.dropdownMenu && (i.find("body").append(p.dropdownMenu), b.on("$destroy", function () { p.dropdownMenu.remove() })) }, this.toggle = function (a) { return q.isOpen = arguments.length ? !!a : !q.isOpen }, this.isOpen = function () { return q.isOpen }, q.getToggleElement = function () { return p.toggleElement }, q.getAutoClose = function () { return c.autoClose || "always" }, q.getElement = function () { return b }, q.isKeynavEnabled = function () { return v }, q.focusDropdownEntry = function (a) { var c = p.dropdownMenu ? angular.element(p.dropdownMenu).find("a") : angular.element(b).find("ul").eq(0).find("a"); switch (a) { case 40: angular.isNumber(p.selectedOption) ? p.selectedOption = p.selectedOption === c.length - 1 ? p.selectedOption : p.selectedOption + 1 : p.selectedOption = 0; break; case 38: angular.isNumber(p.selectedOption) ? p.selectedOption = 0 === p.selectedOption ? 0 : p.selectedOption - 1 : p.selectedOption = c.length - 1 } c[p.selectedOption].focus() }, q.getDropdownElement = function () { return p.dropdownMenu }, q.focusToggleElement = function () { p.toggleElement && p.toggleElement[0].focus() }, q.$watch("isOpen", function (c, d) { if (u && p.dropdownMenu) { var e = h.positionElements(b, p.dropdownMenu, "bottom-left", !0), i = { top: e.top + "px", display: c ? "block" : "none" }, l = p.dropdownMenu.hasClass("dropdown-menu-right"); l ? (i.left = "auto", i.right = window.innerWidth - (e.left + b.prop("offsetWidth")) + "px") : (i.left = e.left + "px", i.right = "auto"), p.dropdownMenu.css(i) } if (g[c ? "addClass" : "removeClass"](b, r).then(function () { angular.isDefined(c) && c !== d && t(a, { open: !!c }) }), c) p.dropdownMenuTemplateUrl && k(p.dropdownMenuTemplateUrl).then(function (a) { n = q.$new(), j(a.trim())(n, function (a) { var b = a; p.dropdownMenu.replaceWith(b), p.dropdownMenu = b }) }), q.focusToggleElement(), f.open(q); else { if (p.dropdownMenuTemplateUrl) { n && n.$destroy(); var m = angular.element('<ul class="dropdown-menu"></ul>'); p.dropdownMenu.replaceWith(m), p.dropdownMenu = m } f.close(q), p.selectedOption = null } angular.isFunction(s) && s(a, c) }), a.$on("$locationChangeSuccess", function () { "disabled" !== q.getAutoClose() && (q.isOpen = !1) }); var w = a.$on("$destroy", function () { q.$destroy() }); q.$on("$destroy", w) }]).directive("dropdown", ["$log", "$dropdownSuppressWarning", function (a, b) { return { controller: "DropdownController", link: function (c, d, e, f) { b || a.warn("dropdown is now deprecated. Use uib-dropdown instead."), f.init() } } }]).directive("dropdownMenu", ["$log", "$dropdownSuppressWarning", function (a, b) { return { restrict: "AC", require: "?^dropdown", link: function (c, d, e, f) { if (f) { b || a.warn("dropdown-menu is now deprecated. Use uib-dropdown-menu instead."), d.addClass("dropdown-menu"); var g = e.templateUrl; g && (f.dropdownMenuTemplateUrl = g), f.dropdownMenu || (f.dropdownMenu = d) } } } }]).directive("keyboardNav", ["$log", "$dropdownSuppressWarning", function (a, b) { return { restrict: "A", require: "?^dropdown", link: function (c, d, e, f) { b || a.warn("keyboard-nav is now deprecated. Use uib-keyboard-nav instead."), d.bind("keydown", function (a) { if (-1 !== [38, 40].indexOf(a.which)) { a.preventDefault(), a.stopPropagation(); var b = f.dropdownMenu.find("a"); switch (a.which) { case 40: angular.isNumber(f.selectedOption) ? f.selectedOption = f.selectedOption === b.length - 1 ? f.selectedOption : f.selectedOption + 1 : f.selectedOption = 0; break; case 38: angular.isNumber(f.selectedOption) ? f.selectedOption = 0 === f.selectedOption ? 0 : f.selectedOption - 1 : f.selectedOption = b.length - 1 } b[f.selectedOption].focus() } }) } } }]).directive("dropdownToggle", ["$log", "$dropdownSuppressWarning", function (a, b) { return { require: "?^dropdown", link: function (c, d, e, f) { if (b || a.warn("dropdown-toggle is now deprecated. Use uib-dropdown-toggle instead."), f) { d.addClass("dropdown-toggle"), f.toggleElement = d; var g = function (a) { a.preventDefault(), d.hasClass("disabled") || e.disabled || c.$apply(function () { f.toggle() }) }; d.bind("click", g), d.attr({ "aria-haspopup": !0, "aria-expanded": !1 }), c.$watch(f.isOpen, function (a) { d.attr("aria-expanded", !!a) }), c.$on("$destroy", function () { d.unbind("click", g) }) } } } }]), angular.module("ui.bootstrap.stackedMap", []).factory("$$stackedMap", function () { return { createNew: function () { var a = []; return { add: function (b, c) { a.push({ key: b, value: c }) }, get: function (b) { for (var c = 0; c < a.length; c++) if (b == a[c].key) return a[c] }, keys: function () { for (var b = [], c = 0; c < a.length; c++) b.push(a[c].key); return b }, top: function () { return a[a.length - 1] }, remove: function (b) { for (var c = -1, d = 0; d < a.length; d++) if (b == a[d].key) { c = d; break } return a.splice(c, 1)[0] }, removeTop: function () { return a.splice(a.length - 1, 1)[0] }, length: function () { return a.length } } } } }), angular.module("ui.bootstrap.modal", ["ui.bootstrap.stackedMap"]).factory("$$multiMap", function () { return { createNew: function () { var a = {}; return { entries: function () { return Object.keys(a).map(function (b) { return { key: b, value: a[b] } }) }, get: function (b) { return a[b] }, hasKey: function (b) { return !!a[b] }, keys: function () { return Object.keys(a) }, put: function (b, c) { a[b] || (a[b] = []), a[b].push(c) }, remove: function (b, c) { var d = a[b]; if (d) { var e = d.indexOf(c); -1 !== e && d.splice(e, 1), d.length || delete a[b] } } } } } }).directive("uibModalBackdrop", ["$animate", "$injector", "$uibModalStack", function (a, b, c) { function d(b, d, f) { d.addClass("modal-backdrop"), f.modalInClass && (e ? e(d, { addClass: f.modalInClass }).start() : a.addClass(d, f.modalInClass), b.$on(c.NOW_CLOSING_EVENT, function (b, c) { var g = c(); e ? e(d, { removeClass: f.modalInClass }).start().then(g) : a.removeClass(d, f.modalInClass).then(g) })) } var e = null; return b.has("$animateCss") && (e = b.get("$animateCss")), { replace: !0, templateUrl: "template/modal/backdrop.html", compile: function (a, b) { return a.addClass(b.backdropClass), d } } }]).directive("uibModalWindow", ["$uibModalStack", "$q", "$animate", "$injector", function (a, b, c, d) { var e = null; return d.has("$animateCss") && (e = d.get("$animateCss")), { scope: { index: "@" }, replace: !0, transclude: !0, templateUrl: function (a, b) { return b.templateUrl || "template/modal/window.html" }, link: function (d, f, g) { f.addClass(g.windowClass || ""), f.addClass(g.windowTopClass || ""), d.size = g.size, d.close = function (b) { var c = a.getTop(); c && c.value.backdrop && "static" !== c.value.backdrop && b.target === b.currentTarget && (b.preventDefault(), b.stopPropagation(), a.dismiss(c.key, "backdrop click")) }, f.on("click", d.close), d.$isRendered = !0; var h = b.defer(); g.$observe("modalRender", function (a) { "true" == a && h.resolve() }), h.promise.then(function () { var h = null; g.modalInClass && (h = e ? e(f, { addClass: g.modalInClass }).start() : c.addClass(f, g.modalInClass), d.$on(a.NOW_CLOSING_EVENT, function (a, b) { var d = b(); e ? e(f, { removeClass: g.modalInClass }).start().then(d) : c.removeClass(f, g.modalInClass).then(d) })), b.when(h).then(function () { var a = f[0].querySelectorAll("[autofocus]"); a.length ? a[0].focus() : f[0].focus() }); var i = a.getTop(); i && a.modalRendered(i.key) }) } } }]).directive("uibModalAnimationClass", function () { return { compile: function (a, b) { b.modalAnimation && a.addClass(b.uibModalAnimationClass) } } }).directive("uibModalTransclude", function () { return { link: function (a, b, c, d, e) { e(a.$parent, function (a) { b.empty(), b.append(a) }) } } }).factory("$uibModalStack", ["$animate", "$timeout", "$document", "$compile", "$rootScope", "$q", "$injector", "$$multiMap", "$$stackedMap", function (a, b, c, d, e, f, g, h, i) { function j() { for (var a = -1, b = u.keys(), c = 0; c < b.length; c++) u.get(b[c]).value.backdrop && (a = c); return a } function k(a, b) { var d = c.find("body").eq(0), e = u.get(a).value; u.remove(a), n(e.modalDomEl, e.modalScope, function () { var b = e.openedClass || t; v.remove(b, a), d.toggleClass(b, v.hasKey(b)), l(!0) }), m(), b && b.focus ? b.focus() : d.focus() } function l(a) { var b; u.length() > 0 && (b = u.top().value, b.modalDomEl.toggleClass(b.windowTopClass || "", a)) } function m() { if (q && -1 == j()) { var a = r; n(q, r, function () { a = null }), q = void 0, r = void 0 } } function n(b, c, d) { function e() { e.done || (e.done = !0, p ? p(b, { event: "leave" }).start().then(function () { b.remove() }) : a.leave(b), c.$destroy(), d && d()) } var g, h = null, i = function () { return g || (g = f.defer(), h = g.promise), function () { g.resolve() } }; return c.$broadcast(w.NOW_CLOSING_EVENT, i), f.when(h).then(e) } function o(a, b, c) { return !a.value.modalScope.$broadcast("modal.closing", b, c).defaultPrevented } var p = null; g.has("$animateCss") && (p = g.get("$animateCss")); var q, r, s, t = "modal-open", u = i.createNew(), v = h.createNew(), w = { NOW_CLOSING_EVENT: "modal.stack.now-closing" }, x = 0, y = "a[href], area[href], input:not([disabled]), button:not([disabled]),select:not([disabled]), textarea:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable=true]"; return e.$watch(j, function (a) { r && (r.index = a) }), c.bind("keydown", function (a) { if (a.isDefaultPrevented()) return a; var b = u.top(); if (b && b.value.keyboard) switch (a.which) { case 27: a.preventDefault(), e.$apply(function () { w.dismiss(b.key, "escape key press") }); break; case 9: w.loadFocusElementList(b); var c = !1; a.shiftKey ? w.isFocusInFirstItem(a) && (c = w.focusLastFocusableElement()) : w.isFocusInLastItem(a) && (c = w.focusFirstFocusableElement()), c && (a.preventDefault(), a.stopPropagation()) } }), w.open = function (a, b) { var f = c[0].activeElement, g = b.openedClass || t; l(!1), u.add(a, { deferred: b.deferred, renderDeferred: b.renderDeferred, modalScope: b.scope, backdrop: b.backdrop, keyboard: b.keyboard, openedClass: b.openedClass, windowTopClass: b.windowTopClass }), v.put(g, a); var h = c.find("body").eq(0), i = j(); if (i >= 0 && !q) { r = e.$new(!0), r.index = i; var k = angular.element('<div uib-modal-backdrop="modal-backdrop"></div>'); k.attr("backdrop-class", b.backdropClass), b.animation && k.attr("modal-animation", "true"), q = d(k)(r), h.append(q) } var m = angular.element('<div uib-modal-window="modal-window"></div>'); m.attr({ "template-url": b.windowTemplateUrl, "window-class": b.windowClass, "window-top-class": b.windowTopClass, size: b.size, index: u.length() - 1, animate: "animate" }).html(b.content), b.animation && m.attr("modal-animation", "true"); var n = d(m)(b.scope); u.top().value.modalDomEl = n, u.top().value.modalOpener = f, h.append(n), h.addClass(g), w.clearFocusListCache() }, w.close = function (a, b) { var c = u.get(a); return c && o(c, b, !0) ? (c.value.modalScope.$$uibDestructionScheduled = !0, c.value.deferred.resolve(b), k(a, c.value.modalOpener), !0) : !c }, w.dismiss = function (a, b) { var c = u.get(a); return c && o(c, b, !1) ? (c.value.modalScope.$$uibDestructionScheduled = !0, c.value.deferred.reject(b), k(a, c.value.modalOpener), !0) : !c }, w.dismissAll = function (a) { for (var b = this.getTop() ; b && this.dismiss(b.key, a) ;) b = this.getTop() }, w.getTop = function () { return u.top() }, w.modalRendered = function (a) { var b = u.get(a); b && b.value.renderDeferred.resolve() }, w.focusFirstFocusableElement = function () { return s.length > 0 ? (s[0].focus(), !0) : !1 }, w.focusLastFocusableElement = function () { return s.length > 0 ? (s[s.length - 1].focus(), !0) : !1 }, w.isFocusInFirstItem = function (a) { return s.length > 0 ? (a.target || a.srcElement) == s[0] : !1 }, w.isFocusInLastItem = function (a) { return s.length > 0 ? (a.target || a.srcElement) == s[s.length - 1] : !1 }, w.clearFocusListCache = function () { s = [], x = 0 }, w.loadFocusElementList = function (a) { if ((void 0 === s || !s.length) && a) { var b = a.value.modalDomEl; b && b.length && (s = b[0].querySelectorAll(y)) } }, w }]).provider("$uibModal", function () { var a = { options: { animation: !0, backdrop: !0, keyboard: !0 }, $get: ["$injector", "$rootScope", "$q", "$templateRequest", "$controller", "$uibModalStack", function (b, c, d, e, f, g) { function h(a) { return a.template ? d.when(a.template) : e(angular.isFunction(a.templateUrl) ? a.templateUrl() : a.templateUrl) } function i(a) { var c = []; return angular.forEach(a, function (a) { angular.isFunction(a) || angular.isArray(a) ? c.push(d.when(b.invoke(a))) : angular.isString(a) ? c.push(d.when(b.get(a))) : c.push(d.when(a)) }), c } var j = {}, k = null; return j.getPromiseChain = function () { return k }, j.open = function (b) { function e() { return p } var j = d.defer(), l = d.defer(), m = d.defer(), n = { result: j.promise, opened: l.promise, rendered: m.promise, close: function (a) { return g.close(n, a) }, dismiss: function (a) { return g.dismiss(n, a) } }; if (b = angular.extend({}, a.options, b), b.resolve = b.resolve || {}, !b.template && !b.templateUrl) throw new Error("One of template or templateUrl options is required."); var o, p = d.all([h(b)].concat(i(b.resolve))); return o = k = d.all([k]).then(e, e).then(function (a) { var d = (b.scope || c).$new(); d.$close = n.close, d.$dismiss = n.dismiss, d.$on("$destroy", function () { d.$$uibDestructionScheduled || d.$dismiss("$uibUnscheduledDestruction") }); var e, h = {}, i = 1; b.controller && (h.$scope = d, h.$modalInstance = n, angular.forEach(b.resolve, function (b, c) { h[c] = a[i++] }), e = f(b.controller, h), b.controllerAs && (b.bindToController && angular.extend(e, d), d[b.controllerAs] = e)), g.open(n, { scope: d, deferred: j, renderDeferred: m, content: a[0], animation: b.animation, backdrop: b.backdrop, keyboard: b.keyboard, backdropClass: b.backdropClass, windowTopClass: b.windowTopClass, windowClass: b.windowClass, windowTemplateUrl: b.windowTemplateUrl, size: b.size, openedClass: b.openedClass }), l.resolve(!0) }, function (a) { l.reject(a), j.reject(a) })["finally"](function () { k === o && (k = null) }), n }, j }] }; return a }), angular.module("ui.bootstrap.modal").value("$modalSuppressWarning", !1).directive("modalBackdrop", ["$animate", "$injector", "$modalStack", "$log", "$modalSuppressWarning", function (a, b, c, d, e) { function f(b, f, h) { e || d.warn("modal-backdrop is now deprecated. Use uib-modal-backdrop instead."), f.addClass("modal-backdrop"), h.modalInClass && (g ? g(f, { addClass: h.modalInClass }).start() : a.addClass(f, h.modalInClass), b.$on(c.NOW_CLOSING_EVENT, function (b, c) { var d = c(); g ? g(f, { removeClass: h.modalInClass }).start().then(d) : a.removeClass(f, h.modalInClass).then(d) })) } var g = null; return b.has("$animateCss") && (g = b.get("$animateCss")), { replace: !0, templateUrl: "template/modal/backdrop.html", compile: function (a, b) { return a.addClass(b.backdropClass), f } } }]).directive("modalWindow", ["$modalStack", "$q", "$animate", "$injector", "$log", "$modalSuppressWarning", function (a, b, c, d, e, f) { var g = null; return d.has("$animateCss") && (g = d.get("$animateCss")), { scope: { index: "@" }, replace: !0, transclude: !0, templateUrl: function (a, b) { return b.templateUrl || "template/modal/window.html" }, link: function (d, h, i) { f || e.warn("modal-window is now deprecated. Use uib-modal-window instead."), h.addClass(i.windowClass || ""), h.addClass(i.windowTopClass || ""), d.size = i.size, d.close = function (b) { var c = a.getTop(); c && c.value.backdrop && "static" !== c.value.backdrop && b.target === b.currentTarget && (b.preventDefault(), b.stopPropagation(), a.dismiss(c.key, "backdrop click")) }, h.on("click", d.close), d.$isRendered = !0; var j = b.defer(); i.$observe("modalRender", function (a) { "true" == a && j.resolve() }), j.promise.then(function () { var e = null; i.modalInClass && (e = g ? g(h, { addClass: i.modalInClass }).start() : c.addClass(h, i.modalInClass), d.$on(a.NOW_CLOSING_EVENT, function (a, b) { var d = b(); g ? g(h, { removeClass: i.modalInClass }).start().then(d) : c.removeClass(h, i.modalInClass).then(d) })), b.when(e).then(function () { var a = h[0].querySelectorAll("[autofocus]"); a.length ? a[0].focus() : h[0].focus() }); var f = a.getTop(); f && a.modalRendered(f.key) }) } } }]).directive("modalAnimationClass", ["$log", "$modalSuppressWarning", function (a, b) { return { compile: function (c, d) { b || a.warn("modal-animation-class is now deprecated. Use uib-modal-animation-class instead."), d.modalAnimation && c.addClass(d.modalAnimationClass) } } }]).directive("modalTransclude", ["$log", "$modalSuppressWarning", function (a, b) { return { link: function (c, d, e, f, g) { b || a.warn("modal-transclude is now deprecated. Use uib-modal-transclude instead."), g(c.$parent, function (a) { d.empty(), d.append(a) }) } } }]).service("$modalStack", ["$animate", "$timeout", "$document", "$compile", "$rootScope", "$q", "$injector", "$$multiMap", "$$stackedMap", "$uibModalStack", "$log", "$modalSuppressWarning", function (a, b, c, d, e, f, g, h, i, j, k, l) {
    l || k.warn("$modalStack is now deprecated. Use $uibModalStack instead."), angular.extend(this, j)
}]).provider("$modal", ["$uibModalProvider", function (a) { angular.extend(this, a), this.$get = ["$injector", "$log", "$modalSuppressWarning", function (b, c, d) { return d || c.warn("$modal is now deprecated. Use $uibModal instead."), b.invoke(a.$get) }] }]), angular.module("ui.bootstrap.pagination", []).controller("UibPaginationController", ["$scope", "$attrs", "$parse", function (a, b, c) { var d = this, e = { $setViewValue: angular.noop }, f = b.numPages ? c(b.numPages).assign : angular.noop; this.init = function (g, h) { e = g, this.config = h, e.$render = function () { d.render() }, b.itemsPerPage ? a.$parent.$watch(c(b.itemsPerPage), function (b) { d.itemsPerPage = parseInt(b, 10), a.totalPages = d.calculateTotalPages() }) : this.itemsPerPage = h.itemsPerPage, a.$watch("totalItems", function () { a.totalPages = d.calculateTotalPages() }), a.$watch("totalPages", function (b) { f(a.$parent, b), a.page > b ? a.selectPage(b) : e.$render() }) }, this.calculateTotalPages = function () { var b = this.itemsPerPage < 1 ? 1 : Math.ceil(a.totalItems / this.itemsPerPage); return Math.max(b || 0, 1) }, this.render = function () { a.page = parseInt(e.$viewValue, 10) || 1 }, a.selectPage = function (b, c) { c && c.preventDefault(); var d = !a.ngDisabled || !c; d && a.page !== b && b > 0 && b <= a.totalPages && (c && c.target && c.target.blur(), e.$setViewValue(b), e.$render()) }, a.getText = function (b) { return a[b + "Text"] || d.config[b + "Text"] }, a.noPrevious = function () { return 1 === a.page }, a.noNext = function () { return a.page === a.totalPages } }]).constant("uibPaginationConfig", { itemsPerPage: 10, boundaryLinks: !1, directionLinks: !0, firstText: "First", previousText: "Previous", nextText: "Next", lastText: "Last", rotate: !0 }).directive("uibPagination", ["$parse", "uibPaginationConfig", function (a, b) { return { restrict: "EA", scope: { totalItems: "=", firstText: "@", previousText: "@", nextText: "@", lastText: "@", ngDisabled: "=" }, require: ["uibPagination", "?ngModel"], controller: "UibPaginationController", controllerAs: "pagination", templateUrl: function (a, b) { return b.templateUrl || "template/pagination/pagination.html" }, replace: !0, link: function (c, d, e, f) { function g(a, b, c) { return { number: a, text: b, active: c } } function h(a, b) { var c = [], d = 1, e = b, f = angular.isDefined(k) && b > k; f && (l ? (d = Math.max(a - Math.floor(k / 2), 1), e = d + k - 1, e > b && (e = b, d = e - k + 1)) : (d = (Math.ceil(a / k) - 1) * k + 1, e = Math.min(d + k - 1, b))); for (var h = d; e >= h; h++) { var i = g(h, h, h === a); c.push(i) } if (f && !l) { if (d > 1) { var j = g(d - 1, "...", !1); c.unshift(j) } if (b > e) { var m = g(e + 1, "...", !1); c.push(m) } } return c } var i = f[0], j = f[1]; if (j) { var k = angular.isDefined(e.maxSize) ? c.$parent.$eval(e.maxSize) : b.maxSize, l = angular.isDefined(e.rotate) ? c.$parent.$eval(e.rotate) : b.rotate; c.boundaryLinks = angular.isDefined(e.boundaryLinks) ? c.$parent.$eval(e.boundaryLinks) : b.boundaryLinks, c.directionLinks = angular.isDefined(e.directionLinks) ? c.$parent.$eval(e.directionLinks) : b.directionLinks, i.init(j, b), e.maxSize && c.$parent.$watch(a(e.maxSize), function (a) { k = parseInt(a, 10), i.render() }); var m = i.render; i.render = function () { m(), c.page > 0 && c.page <= c.totalPages && (c.pages = h(c.page, c.totalPages)) } } } } }]).constant("uibPagerConfig", { itemsPerPage: 10, previousText: "« Previous", nextText: "Next »", align: !0 }).directive("uibPager", ["uibPagerConfig", function (a) { return { restrict: "EA", scope: { totalItems: "=", previousText: "@", nextText: "@", ngDisabled: "=" }, require: ["uibPager", "?ngModel"], controller: "UibPaginationController", controllerAs: "pagination", templateUrl: function (a, b) { return b.templateUrl || "template/pagination/pager.html" }, replace: !0, link: function (b, c, d, e) { var f = e[0], g = e[1]; g && (b.align = angular.isDefined(d.align) ? b.$parent.$eval(d.align) : a.align, f.init(g, a)) } } }]), angular.module("ui.bootstrap.pagination").value("$paginationSuppressWarning", !1).controller("PaginationController", ["$scope", "$attrs", "$parse", "$log", "$paginationSuppressWarning", function (a, b, c, d, e) { e || d.warn("PaginationController is now deprecated. Use UibPaginationController instead."); var f = this, g = { $setViewValue: angular.noop }, h = b.numPages ? c(b.numPages).assign : angular.noop; this.init = function (d, e) { g = d, this.config = e, g.$render = function () { f.render() }, b.itemsPerPage ? a.$parent.$watch(c(b.itemsPerPage), function (b) { f.itemsPerPage = parseInt(b, 10), a.totalPages = f.calculateTotalPages() }) : this.itemsPerPage = e.itemsPerPage, a.$watch("totalItems", function () { a.totalPages = f.calculateTotalPages() }), a.$watch("totalPages", function (b) { h(a.$parent, b), a.page > b ? a.selectPage(b) : g.$render() }) }, this.calculateTotalPages = function () { var b = this.itemsPerPage < 1 ? 1 : Math.ceil(a.totalItems / this.itemsPerPage); return Math.max(b || 0, 1) }, this.render = function () { a.page = parseInt(g.$viewValue, 10) || 1 }, a.selectPage = function (b, c) { c && c.preventDefault(); var d = !a.ngDisabled || !c; d && a.page !== b && b > 0 && b <= a.totalPages && (c && c.target && c.target.blur(), g.$setViewValue(b), g.$render()) }, a.getText = function (b) { return a[b + "Text"] || f.config[b + "Text"] }, a.noPrevious = function () { return 1 === a.page }, a.noNext = function () { return a.page === a.totalPages } }]).directive("pagination", ["$parse", "uibPaginationConfig", "$log", "$paginationSuppressWarning", function (a, b, c, d) { return { restrict: "EA", scope: { totalItems: "=", firstText: "@", previousText: "@", nextText: "@", lastText: "@", ngDisabled: "=" }, require: ["pagination", "?ngModel"], controller: "PaginationController", controllerAs: "pagination", templateUrl: function (a, b) { return b.templateUrl || "template/pagination/pagination.html" }, replace: !0, link: function (e, f, g, h) { function i(a, b, c) { return { number: a, text: b, active: c } } function j(a, b) { var c = [], d = 1, e = b, f = angular.isDefined(m) && b > m; f && (n ? (d = Math.max(a - Math.floor(m / 2), 1), e = d + m - 1, e > b && (e = b, d = e - m + 1)) : (d = (Math.ceil(a / m) - 1) * m + 1, e = Math.min(d + m - 1, b))); for (var g = d; e >= g; g++) { var h = i(g, g, g === a); c.push(h) } if (f && !n) { if (d > 1) { var j = i(d - 1, "...", !1); c.unshift(j) } if (b > e) { var k = i(e + 1, "...", !1); c.push(k) } } return c } d || c.warn("pagination is now deprecated. Use uib-pagination instead."); var k = h[0], l = h[1]; if (l) { var m = angular.isDefined(g.maxSize) ? e.$parent.$eval(g.maxSize) : b.maxSize, n = angular.isDefined(g.rotate) ? e.$parent.$eval(g.rotate) : b.rotate; e.boundaryLinks = angular.isDefined(g.boundaryLinks) ? e.$parent.$eval(g.boundaryLinks) : b.boundaryLinks, e.directionLinks = angular.isDefined(g.directionLinks) ? e.$parent.$eval(g.directionLinks) : b.directionLinks, k.init(l, b), g.maxSize && e.$parent.$watch(a(g.maxSize), function (a) { m = parseInt(a, 10), k.render() }); var o = k.render; k.render = function () { o(), e.page > 0 && e.page <= e.totalPages && (e.pages = j(e.page, e.totalPages)) } } } } }]).directive("pager", ["uibPagerConfig", "$log", "$paginationSuppressWarning", function (a, b, c) { return { restrict: "EA", scope: { totalItems: "=", previousText: "@", nextText: "@", ngDisabled: "=" }, require: ["pager", "?ngModel"], controller: "PaginationController", controllerAs: "pagination", templateUrl: function (a, b) { return b.templateUrl || "template/pagination/pager.html" }, replace: !0, link: function (d, e, f, g) { c || b.warn("pager is now deprecated. Use uib-pager instead."); var h = g[0], i = g[1]; i && (d.align = angular.isDefined(f.align) ? d.$parent.$eval(f.align) : a.align, h.init(i, a)) } } }]), angular.module("ui.bootstrap.tooltip", ["ui.bootstrap.position", "ui.bootstrap.stackedMap"]).provider("$uibTooltip", function () { function a(a) { var b = /[A-Z]/g, c = "-"; return a.replace(b, function (a, b) { return (b ? c : "") + a.toLowerCase() }) } var b = { placement: "top", animation: !0, popupDelay: 0, popupCloseDelay: 0, useContentExp: !1 }, c = { mouseenter: "mouseleave", click: "click", focus: "blur", none: "" }, d = {}; this.options = function (a) { angular.extend(d, a) }, this.setTriggers = function (a) { angular.extend(c, a) }, this.$get = ["$window", "$compile", "$timeout", "$document", "$uibPosition", "$interpolate", "$rootScope", "$parse", "$$stackedMap", function (e, f, g, h, i, j, k, l, m) { var n = m.createNew(); return h.on("keypress", function (a) { if (27 === a.which) { var b = n.top(); b && (b.value.close(), n.removeTop(), b = null) } }), function (e, k, m, o) { function p(a) { var b = (a || o.trigger || m).split(" "), d = b.map(function (a) { return c[a] || a }); return { show: b, hide: d } } o = angular.extend({}, b, d, o); var q = a(e), r = j.startSymbol(), s = j.endSymbol(), t = "<div " + q + '-popup title="' + r + "title" + s + '" ' + (o.useContentExp ? 'content-exp="contentExp()" ' : 'content="' + r + "content" + s + '" ') + 'placement="' + r + "placement" + s + '" popup-class="' + r + "popupClass" + s + '" animation="animation" is-open="isOpen"origin-scope="origScope" style="visibility: hidden; display: block;"></div>'; return { compile: function (a, b) { var c = f(t); return function (a, b, d, f) { function j() { J.isOpen ? q() : m() } function m() { (!I || a.$eval(d[k + "Enable"])) && (v(), J.popupDelay ? D || (D = g(r, J.popupDelay, !1)) : r()) } function q() { J.popupCloseDelay ? E = g(s, J.popupCloseDelay, !1) : s() } function r() { return D && (g.cancel(D), D = null), E && (g.cancel(E), E = null), C && (g.cancel(C), C = null), J.content ? (t(), void J.$evalAsync(function () { J.isOpen = !0, w(!0), O() })) : angular.noop } function s() { J && (D && (g.cancel(D), D = null), F && (g.cancel(F), F = null), J.$evalAsync(function () { J.isOpen = !1, w(!1), J.animation ? C || (C = g(u, 150, !1)) : u() })) } function t() { A || (B = J.$new(), A = c(B, function (a) { G ? h.find("body").append(a) : b.after(a) }), x()) } function u() { y(), C = null, A && (A.remove(), A = null), B && (B.$destroy(), B = null) } function v() { J.title = d[k + "Title"], M ? J.content = M(a) : J.content = d[e], J.popupClass = d[k + "Class"], J.placement = angular.isDefined(d[k + "Placement"]) ? d[k + "Placement"] : o.placement; var b = parseInt(d[k + "PopupDelay"], 10), c = parseInt(d[k + "PopupCloseDelay"], 10); J.popupDelay = isNaN(b) ? o.popupDelay : b, J.popupCloseDelay = isNaN(c) ? o.popupCloseDelay : c } function w(b) { L && angular.isFunction(L.assign) && L.assign(a, b) } function x() { N.length = 0, M ? (N.push(a.$watch(M, function (a) { J.content = a, !a && J.isOpen && s() })), N.push(B.$watch(function () { K || (K = !0, B.$$postDigest(function () { K = !1, J && J.isOpen && O() })) }))) : N.push(d.$observe(e, function (a) { J.content = a, !a && J.isOpen ? s() : O() })), N.push(d.$observe(k + "Title", function (a) { J.title = a, J.isOpen && O() })), N.push(d.$observe(k + "Placement", function (a) { J.placement = a ? a : o.placement, J.isOpen && O() })) } function y() { N.length && (angular.forEach(N, function (a) { a() }), N.length = 0) } function z() { var a = d[k + "Trigger"]; P(), H = p(a), "none" !== H.show && H.show.forEach(function (a, c) { a === H.hide[c] ? b[0].addEventListener(a, j) : a && (b[0].addEventListener(a, m), H.hide[c].split(" ").forEach(function (a) { b[0].addEventListener(a, q) })), b.on("keypress", function (a) { 27 === a.which && q() }) }) } var A, B, C, D, E, F, G = angular.isDefined(o.appendToBody) ? o.appendToBody : !1, H = p(void 0), I = angular.isDefined(d[k + "Enable"]), J = a.$new(!0), K = !1, L = angular.isDefined(d[k + "IsOpen"]) ? l(d[k + "IsOpen"]) : !1, M = o.useContentExp ? l(d[e]) : !1, N = [], O = function () { A && A.html() && (F || (F = g(function () { A.css({ top: 0, left: 0 }); var a = i.positionElements(b, A, J.placement, G); a.top += "px", a.left += "px", a.visibility = "visible", A.css(a), F = null }, 0, !1))) }; J.origScope = a, J.isOpen = !1, n.add(J, { close: s }), J.contentExp = function () { return J.content }, d.$observe("disabled", function (a) { D && a && (g.cancel(D), D = null), a && J.isOpen && s() }), L && a.$watch(L, function (a) { !a === J.isOpen && j() }); var P = function () { H.show.forEach(function (a) { b.unbind(a, m) }), H.hide.forEach(function (a) { a.split(" ").forEach(function (a) { b[0].removeEventListener(a, q) }) }) }; z(); var Q = a.$eval(d[k + "Animation"]); J.animation = angular.isDefined(Q) ? !!Q : o.animation; var R = a.$eval(d[k + "AppendToBody"]); G = angular.isDefined(R) ? R : G, G && a.$on("$locationChangeSuccess", function () { J.isOpen && s() }), a.$on("$destroy", function () { g.cancel(C), g.cancel(D), g.cancel(E), g.cancel(F), P(), u(), n.remove(J), J = null }) } } } } }] }).directive("uibTooltipTemplateTransclude", ["$animate", "$sce", "$compile", "$templateRequest", function (a, b, c, d) { return { link: function (e, f, g) { var h, i, j, k = e.$eval(g.tooltipTemplateTranscludeScope), l = 0, m = function () { i && (i.remove(), i = null), h && (h.$destroy(), h = null), j && (a.leave(j).then(function () { i = null }), i = j, j = null) }; e.$watch(b.parseAsResourceUrl(g.uibTooltipTemplateTransclude), function (b) { var g = ++l; b ? (d(b, !0).then(function (d) { if (g === l) { var e = k.$new(), i = d, n = c(i)(e, function (b) { m(), a.enter(b, f) }); h = e, j = n, h.$emit("$includeContentLoaded", b) } }, function () { g === l && (m(), e.$emit("$includeContentError", b)) }), e.$emit("$includeContentRequested", b)) : m() }), e.$on("$destroy", m) } } }]).directive("uibTooltipClasses", function () { return { restrict: "A", link: function (a, b, c) { a.placement && b.addClass(a.placement), a.popupClass && b.addClass(a.popupClass), a.animation() && b.addClass(c.tooltipAnimationClass) } } }).directive("uibTooltipPopup", function () { return { replace: !0, scope: { content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&" }, templateUrl: "template/tooltip/tooltip-popup.html", link: function (a, b) { b.addClass("tooltip") } } }).directive("uibTooltip", ["$uibTooltip", function (a) { return a("uibTooltip", "tooltip", "mouseenter") }]).directive("uibTooltipTemplatePopup", function () { return { replace: !0, scope: { contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&", originScope: "&" }, templateUrl: "template/tooltip/tooltip-template-popup.html", link: function (a, b) { b.addClass("tooltip") } } }).directive("uibTooltipTemplate", ["$uibTooltip", function (a) { return a("uibTooltipTemplate", "tooltip", "mouseenter", { useContentExp: !0 }) }]).directive("uibTooltipHtmlPopup", function () { return { replace: !0, scope: { contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&" }, templateUrl: "template/tooltip/tooltip-html-popup.html", link: function (a, b) { b.addClass("tooltip") } } }).directive("uibTooltipHtml", ["$uibTooltip", function (a) { return a("uibTooltipHtml", "tooltip", "mouseenter", { useContentExp: !0 }) }]), angular.module("ui.bootstrap.tooltip").value("$tooltipSuppressWarning", !1).provider("$tooltip", ["$uibTooltipProvider", function (a) { angular.extend(this, a), this.$get = ["$log", "$tooltipSuppressWarning", "$injector", function (b, c, d) { return c || b.warn("$tooltip is now deprecated. Use $uibTooltip instead."), d.invoke(a.$get) }] }]).directive("tooltipTemplateTransclude", ["$animate", "$sce", "$compile", "$templateRequest", "$log", "$tooltipSuppressWarning", function (a, b, c, d, e, f) { return { link: function (g, h, i) { f || e.warn("tooltip-template-transclude is now deprecated. Use uib-tooltip-template-transclude instead."); var j, k, l, m = g.$eval(i.tooltipTemplateTranscludeScope), n = 0, o = function () { k && (k.remove(), k = null), j && (j.$destroy(), j = null), l && (a.leave(l).then(function () { k = null }), k = l, l = null) }; g.$watch(b.parseAsResourceUrl(i.tooltipTemplateTransclude), function (b) { var e = ++n; b ? (d(b, !0).then(function (d) { if (e === n) { var f = m.$new(), g = d, i = c(g)(f, function (b) { o(), a.enter(b, h) }); j = f, l = i, j.$emit("$includeContentLoaded", b) } }, function () { e === n && (o(), g.$emit("$includeContentError", b)) }), g.$emit("$includeContentRequested", b)) : o() }), g.$on("$destroy", o) } } }]).directive("tooltipClasses", ["$log", "$tooltipSuppressWarning", function (a, b) { return { restrict: "A", link: function (c, d, e) { b || a.warn("tooltip-classes is now deprecated. Use uib-tooltip-classes instead."), c.placement && d.addClass(c.placement), c.popupClass && d.addClass(c.popupClass), c.animation() && d.addClass(e.tooltipAnimationClass) } } }]).directive("tooltipPopup", ["$log", "$tooltipSuppressWarning", function (a, b) { return { replace: !0, scope: { content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&" }, templateUrl: "template/tooltip/tooltip-popup.html", link: function (c, d) { b || a.warn("tooltip-popup is now deprecated. Use uib-tooltip-popup instead."), d.addClass("tooltip") } } }]).directive("tooltip", ["$tooltip", function (a) { return a("tooltip", "tooltip", "mouseenter") }]).directive("tooltipTemplatePopup", ["$log", "$tooltipSuppressWarning", function (a, b) { return { replace: !0, scope: { contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&", originScope: "&" }, templateUrl: "template/tooltip/tooltip-template-popup.html", link: function (c, d) { b || a.warn("tooltip-template-popup is now deprecated. Use uib-tooltip-template-popup instead."), d.addClass("tooltip") } } }]).directive("tooltipTemplate", ["$tooltip", function (a) { return a("tooltipTemplate", "tooltip", "mouseenter", { useContentExp: !0 }) }]).directive("tooltipHtmlPopup", ["$log", "$tooltipSuppressWarning", function (a, b) { return { replace: !0, scope: { contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&" }, templateUrl: "template/tooltip/tooltip-html-popup.html", link: function (c, d) { b || a.warn("tooltip-html-popup is now deprecated. Use uib-tooltip-html-popup instead."), d.addClass("tooltip") } } }]).directive("tooltipHtml", ["$tooltip", function (a) { return a("tooltipHtml", "tooltip", "mouseenter", { useContentExp: !0 }) }]), angular.module("ui.bootstrap.popover", ["ui.bootstrap.tooltip"]).directive("uibPopoverTemplatePopup", function () { return { replace: !0, scope: { title: "@", contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&", originScope: "&" }, templateUrl: "template/popover/popover-template.html", link: function (a, b) { b.addClass("popover") } } }).directive("uibPopoverTemplate", ["$uibTooltip", function (a) { return a("uibPopoverTemplate", "popover", "click", { useContentExp: !0 }) }]).directive("uibPopoverHtmlPopup", function () { return { replace: !0, scope: { contentExp: "&", title: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&" }, templateUrl: "template/popover/popover-html.html", link: function (a, b) { b.addClass("popover") } } }).directive("uibPopoverHtml", ["$uibTooltip", function (a) { return a("uibPopoverHtml", "popover", "click", { useContentExp: !0 }) }]).directive("uibPopoverPopup", function () { return { replace: !0, scope: { title: "@", content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&" }, templateUrl: "template/popover/popover.html", link: function (a, b) { b.addClass("popover") } } }).directive("uibPopover", ["$uibTooltip", function (a) { return a("uibPopover", "popover", "click") }]), angular.module("ui.bootstrap.popover").value("$popoverSuppressWarning", !1).directive("popoverTemplatePopup", ["$log", "$popoverSuppressWarning", function (a, b) { return { replace: !0, scope: { title: "@", contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&", originScope: "&" }, templateUrl: "template/popover/popover-template.html", link: function (c, d) { b || a.warn("popover-template-popup is now deprecated. Use uib-popover-template-popup instead."), d.addClass("popover") } } }]).directive("popoverTemplate", ["$tooltip", function (a) { return a("popoverTemplate", "popover", "click", { useContentExp: !0 }) }]).directive("popoverHtmlPopup", ["$log", "$popoverSuppressWarning", function (a, b) { return { replace: !0, scope: { contentExp: "&", title: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&" }, templateUrl: "template/popover/popover-html.html", link: function (c, d) { b || a.warn("popover-html-popup is now deprecated. Use uib-popover-html-popup instead."), d.addClass("popover") } } }]).directive("popoverHtml", ["$tooltip", function (a) { return a("popoverHtml", "popover", "click", { useContentExp: !0 }) }]).directive("popoverPopup", ["$log", "$popoverSuppressWarning", function (a, b) { return { replace: !0, scope: { title: "@", content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&" }, templateUrl: "template/popover/popover.html", link: function (c, d) { b || a.warn("popover-popup is now deprecated. Use uib-popover-popup instead."), d.addClass("popover") } } }]).directive("popover", ["$tooltip", function (a) { return a("popover", "popover", "click") }]), angular.module("ui.bootstrap.progressbar", []).constant("uibProgressConfig", { animate: !0, max: 100 }).controller("UibProgressController", ["$scope", "$attrs", "uibProgressConfig", function (a, b, c) { var d = this, e = angular.isDefined(b.animate) ? a.$parent.$eval(b.animate) : c.animate; this.bars = [], a.max = angular.isDefined(a.max) ? a.max : c.max, this.addBar = function (b, c, f) { e || c.css({ transition: "none" }), this.bars.push(b), b.max = a.max, b.title = f && angular.isDefined(f.title) ? f.title : "progressbar", b.$watch("value", function (a) { b.recalculatePercentage() }), b.recalculatePercentage = function () { var a = d.bars.reduce(function (a, b) { return b.percent = +(100 * b.value / b.max).toFixed(2), a + b.percent }, 0); a > 100 && (b.percent -= a - 100) }, b.$on("$destroy", function () { c = null, d.removeBar(b) }) }, this.removeBar = function (a) { this.bars.splice(this.bars.indexOf(a), 1), this.bars.forEach(function (a) { a.recalculatePercentage() }) }, a.$watch("max", function (b) { d.bars.forEach(function (b) { b.max = a.max, b.recalculatePercentage() }) }) }]).directive("uibProgress", function () { return { replace: !0, transclude: !0, controller: "UibProgressController", require: "uibProgress", scope: { max: "=?" }, templateUrl: "template/progressbar/progress.html" } }).directive("uibBar", function () { return { replace: !0, transclude: !0, require: "^uibProgress", scope: { value: "=", type: "@" }, templateUrl: "template/progressbar/bar.html", link: function (a, b, c, d) { d.addBar(a, b, c) } } }).directive("uibProgressbar", function () { return { replace: !0, transclude: !0, controller: "UibProgressController", scope: { value: "=", max: "=?", type: "@" }, templateUrl: "template/progressbar/progressbar.html", link: function (a, b, c, d) { d.addBar(a, angular.element(b.children()[0]), { title: c.title }) } } }), angular.module("ui.bootstrap.progressbar").value("$progressSuppressWarning", !1).controller("ProgressController", ["$scope", "$attrs", "uibProgressConfig", "$log", "$progressSuppressWarning", function (a, b, c, d, e) { e || d.warn("ProgressController is now deprecated. Use UibProgressController instead."); var f = this, g = angular.isDefined(b.animate) ? a.$parent.$eval(b.animate) : c.animate; this.bars = [], a.max = angular.isDefined(a.max) ? a.max : c.max, this.addBar = function (b, c, d) { g || c.css({ transition: "none" }), this.bars.push(b), b.max = a.max, b.title = d && angular.isDefined(d.title) ? d.title : "progressbar", b.$watch("value", function (a) { b.recalculatePercentage() }), b.recalculatePercentage = function () { b.percent = +(100 * b.value / b.max).toFixed(2); var a = f.bars.reduce(function (a, b) { return a + b.percent }, 0); a > 100 && (b.percent -= a - 100) }, b.$on("$destroy", function () { c = null, f.removeBar(b) }) }, this.removeBar = function (a) { this.bars.splice(this.bars.indexOf(a), 1) }, a.$watch("max", function (b) { f.bars.forEach(function (b) { b.max = a.max, b.recalculatePercentage() }) }) }]).directive("progress", ["$log", "$progressSuppressWarning", function (a, b) { return { replace: !0, transclude: !0, controller: "ProgressController", require: "progress", scope: { max: "=?", title: "@?" }, templateUrl: "template/progressbar/progress.html", link: function () { b || a.warn("progress is now deprecated. Use uib-progress instead.") } } }]).directive("bar", ["$log", "$progressSuppressWarning", function (a, b) { return { replace: !0, transclude: !0, require: "^progress", scope: { value: "=", type: "@" }, templateUrl: "template/progressbar/bar.html", link: function (c, d, e, f) { b || a.warn("bar is now deprecated. Use uib-bar instead."), f.addBar(c, d) } } }]).directive("progressbar", ["$log", "$progressSuppressWarning", function (a, b) { return { replace: !0, transclude: !0, controller: "ProgressController", scope: { value: "=", max: "=?", type: "@" }, templateUrl: "template/progressbar/progressbar.html", link: function (c, d, e, f) { b || a.warn("progressbar is now deprecated. Use uib-progressbar instead."), f.addBar(c, angular.element(d.children()[0]), { title: e.title }) } } }]), angular.module("ui.bootstrap.rating", []).constant("uibRatingConfig", { max: 5, stateOn: null, stateOff: null, titles: ["one", "two", "three", "four", "five"] }).controller("UibRatingController", ["$scope", "$attrs", "uibRatingConfig", function (a, b, c) { var d = { $setViewValue: angular.noop }; this.init = function (e) { d = e, d.$render = this.render, d.$formatters.push(function (a) { return angular.isNumber(a) && a << 0 !== a && (a = Math.round(a)), a }), this.stateOn = angular.isDefined(b.stateOn) ? a.$parent.$eval(b.stateOn) : c.stateOn, this.stateOff = angular.isDefined(b.stateOff) ? a.$parent.$eval(b.stateOff) : c.stateOff; var f = angular.isDefined(b.titles) ? a.$parent.$eval(b.titles) : c.titles; this.titles = angular.isArray(f) && f.length > 0 ? f : c.titles; var g = angular.isDefined(b.ratingStates) ? a.$parent.$eval(b.ratingStates) : new Array(angular.isDefined(b.max) ? a.$parent.$eval(b.max) : c.max); a.range = this.buildTemplateObjects(g) }, this.buildTemplateObjects = function (a) { for (var b = 0, c = a.length; c > b; b++) a[b] = angular.extend({ index: b }, { stateOn: this.stateOn, stateOff: this.stateOff, title: this.getTitle(b) }, a[b]); return a }, this.getTitle = function (a) { return a >= this.titles.length ? a + 1 : this.titles[a] }, a.rate = function (b) { !a.readonly && b >= 0 && b <= a.range.length && (d.$setViewValue(d.$viewValue === b ? 0 : b), d.$render()) }, a.enter = function (b) { a.readonly || (a.value = b), a.onHover({ value: b }) }, a.reset = function () { a.value = d.$viewValue, a.onLeave() }, a.onKeydown = function (b) { /(37|38|39|40)/.test(b.which) && (b.preventDefault(), b.stopPropagation(), a.rate(a.value + (38 === b.which || 39 === b.which ? 1 : -1))) }, this.render = function () { a.value = d.$viewValue } }]).directive("uibRating", function () { return { require: ["uibRating", "ngModel"], scope: { readonly: "=?", onHover: "&", onLeave: "&" }, controller: "UibRatingController", templateUrl: "template/rating/rating.html", replace: !0, link: function (a, b, c, d) { var e = d[0], f = d[1]; e.init(f) } } }), angular.module("ui.bootstrap.rating").value("$ratingSuppressWarning", !1).controller("RatingController", ["$scope", "$attrs", "$controller", "$log", "$ratingSuppressWarning", function (a, b, c, d, e) { e || d.warn("RatingController is now deprecated. Use UibRatingController instead."), angular.extend(this, c("UibRatingController", { $scope: a, $attrs: b })) }]).directive("rating", ["$log", "$ratingSuppressWarning", function (a, b) { return { require: ["rating", "ngModel"], scope: { readonly: "=?", onHover: "&", onLeave: "&" }, controller: "RatingController", templateUrl: "template/rating/rating.html", replace: !0, link: function (c, d, e, f) { b || a.warn("rating is now deprecated. Use uib-rating instead."); var g = f[0], h = f[1]; g.init(h) } } }]), angular.module("ui.bootstrap.tabs", []).controller("UibTabsetController", ["$scope", function (a) { var b = this, c = b.tabs = a.tabs = []; b.select = function (a) { angular.forEach(c, function (b) { b.active && b !== a && (b.active = !1, b.onDeselect(), a.selectCalled = !1) }), a.active = !0, a.selectCalled || (a.onSelect(), a.selectCalled = !0) }, b.addTab = function (a) { c.push(a), 1 === c.length && a.active !== !1 ? a.active = !0 : a.active ? b.select(a) : a.active = !1 }, b.removeTab = function (a) { var e = c.indexOf(a); if (a.active && c.length > 1 && !d) { var f = e == c.length - 1 ? e - 1 : e + 1; b.select(c[f]) } c.splice(e, 1) }; var d; a.$on("$destroy", function () { d = !0 }) }]).directive("uibTabset", function () { return { restrict: "EA", transclude: !0, replace: !0, scope: { type: "@" }, controller: "UibTabsetController", templateUrl: "template/tabs/tabset.html", link: function (a, b, c) { a.vertical = angular.isDefined(c.vertical) ? a.$parent.$eval(c.vertical) : !1, a.justified = angular.isDefined(c.justified) ? a.$parent.$eval(c.justified) : !1 } } }).directive("uibTab", ["$parse", function (a) { return { require: "^uibTabset", restrict: "EA", replace: !0, templateUrl: "template/tabs/tab.html", transclude: !0, scope: { active: "=?", heading: "@", onSelect: "&select", onDeselect: "&deselect" }, controller: function () { }, link: function (b, c, d, e, f) { b.$watch("active", function (a) { a && e.select(b) }), b.disabled = !1, d.disable && b.$parent.$watch(a(d.disable), function (a) { b.disabled = !!a }), b.select = function () { b.disabled || (b.active = !0) }, e.addTab(b), b.$on("$destroy", function () { e.removeTab(b) }), b.$transcludeFn = f } } }]).directive("uibTabHeadingTransclude", function () { return { restrict: "A", require: ["?^uibTab", "?^tab"], link: function (a, b) { a.$watch("headingElement", function (a) { a && (b.html(""), b.append(a)) }) } } }).directive("uibTabContentTransclude", function () { function a(a) { return a.tagName && (a.hasAttribute("tab-heading") || a.hasAttribute("data-tab-heading") || a.hasAttribute("x-tab-heading") || a.hasAttribute("uib-tab-heading") || a.hasAttribute("data-uib-tab-heading") || a.hasAttribute("x-uib-tab-heading") || "tab-heading" === a.tagName.toLowerCase() || "data-tab-heading" === a.tagName.toLowerCase() || "x-tab-heading" === a.tagName.toLowerCase() || "uib-tab-heading" === a.tagName.toLowerCase() || "data-uib-tab-heading" === a.tagName.toLowerCase() || "x-uib-tab-heading" === a.tagName.toLowerCase()) } return { restrict: "A", require: ["?^uibTabset", "?^tabset"], link: function (b, c, d) { var e = b.$eval(d.uibTabContentTransclude); e.$transcludeFn(e.$parent, function (b) { angular.forEach(b, function (b) { a(b) ? e.headingElement = b : c.append(b) }) }) } } }), angular.module("ui.bootstrap.tabs").value("$tabsSuppressWarning", !1).controller("TabsetController", ["$scope", "$controller", "$log", "$tabsSuppressWarning", function (a, b, c, d) { d || c.warn("TabsetController is now deprecated. Use UibTabsetController instead."), angular.extend(this, b("UibTabsetController", { $scope: a })) }]).directive("tabset", ["$log", "$tabsSuppressWarning", function (a, b) { return { restrict: "EA", transclude: !0, replace: !0, scope: { type: "@" }, controller: "TabsetController", templateUrl: "template/tabs/tabset.html", link: function (c, d, e) { b || a.warn("tabset is now deprecated. Use uib-tabset instead."), c.vertical = angular.isDefined(e.vertical) ? c.$parent.$eval(e.vertical) : !1, c.justified = angular.isDefined(e.justified) ? c.$parent.$eval(e.justified) : !1 } } }]).directive("tab", ["$parse", "$log", "$tabsSuppressWarning", function (a, b, c) { return { require: "^tabset", restrict: "EA", replace: !0, templateUrl: "template/tabs/tab.html", transclude: !0, scope: { active: "=?", heading: "@", onSelect: "&select", onDeselect: "&deselect" }, controller: function () { }, link: function (d, e, f, g, h) { c || b.warn("tab is now deprecated. Use uib-tab instead."), d.$watch("active", function (a) { a && g.select(d) }), d.disabled = !1, f.disable && d.$parent.$watch(a(f.disable), function (a) { d.disabled = !!a }), d.select = function () { d.disabled || (d.active = !0) }, g.addTab(d), d.$on("$destroy", function () { g.removeTab(d) }), d.$transcludeFn = h } } }]).directive("tabHeadingTransclude", ["$log", "$tabsSuppressWarning", function (a, b) { return { restrict: "A", require: "^tab", link: function (c, d) { b || a.warn("tab-heading-transclude is now deprecated. Use uib-tab-heading-transclude instead."), c.$watch("headingElement", function (a) { a && (d.html(""), d.append(a)) }) } } }]).directive("tabContentTransclude", ["$log", "$tabsSuppressWarning", function (a, b) { function c(a) { return a.tagName && (a.hasAttribute("tab-heading") || a.hasAttribute("data-tab-heading") || a.hasAttribute("x-tab-heading") || "tab-heading" === a.tagName.toLowerCase() || "data-tab-heading" === a.tagName.toLowerCase() || "x-tab-heading" === a.tagName.toLowerCase()) } return { restrict: "A", require: "^tabset", link: function (d, e, f) { b || a.warn("tab-content-transclude is now deprecated. Use uib-tab-content-transclude instead."); var g = d.$eval(f.tabContentTransclude); g.$transcludeFn(g.$parent, function (a) { angular.forEach(a, function (a) { c(a) ? g.headingElement = a : e.append(a) }) }) } } }]), angular.module("ui.bootstrap.timepicker", []).constant("uibTimepickerConfig", { hourStep: 1, minuteStep: 1, showMeridian: !0, meridians: null, readonlyInput: !1, mousewheel: !0, arrowkeys: !0, showSpinners: !0 }).controller("UibTimepickerController", ["$scope", "$element", "$attrs", "$parse", "$log", "$locale", "uibTimepickerConfig", function (a, b, c, d, e, f, g) {
    function h() { var b = parseInt(a.hours, 10), c = a.showMeridian ? b > 0 && 13 > b : b >= 0 && 24 > b; return c ? (a.showMeridian && (12 === b && (b = 0), a.meridian === r[1] && (b += 12)), b) : void 0 } function i() { var b = parseInt(a.minutes, 10); return b >= 0 && 60 > b ? b : void 0 } function j(a) { return angular.isDefined(a) && a.toString().length < 2 ? "0" + a : a.toString() } function k(a) { l(), q.$setViewValue(new Date(p)), m(a) } function l() { q.$setValidity("time", !0), a.invalidHours = !1, a.invalidMinutes = !1 } function m(b) { var c = p.getHours(), d = p.getMinutes(); a.showMeridian && (c = 0 === c || 12 === c ? 12 : c % 12), a.hours = "h" === b ? c : j(c), "m" !== b && (a.minutes = j(d)), a.meridian = p.getHours() < 12 ? r[0] : r[1] } function n(a, b) { var c = new Date(a.getTime() + 6e4 * b), d = new Date(a); return d.setHours(c.getHours(), c.getMinutes()), d } function o(a) { p = n(p, a), k() } var p = new Date, q = { $setViewValue: angular.noop }, r = angular.isDefined(c.meridians) ? a.$parent.$eval(c.meridians) : g.meridians || f.DATETIME_FORMATS.AMPMS; a.tabindex = angular.isDefined(c.tabindex) ? c.tabindex : 0, b.removeAttr("tabindex"), this.init = function (b, d) { q = b, q.$render = this.render, q.$formatters.unshift(function (a) { return a ? new Date(a) : null }); var e = d.eq(0), f = d.eq(1), h = angular.isDefined(c.mousewheel) ? a.$parent.$eval(c.mousewheel) : g.mousewheel; h && this.setupMousewheelEvents(e, f); var i = angular.isDefined(c.arrowkeys) ? a.$parent.$eval(c.arrowkeys) : g.arrowkeys; i && this.setupArrowkeyEvents(e, f), a.readonlyInput = angular.isDefined(c.readonlyInput) ? a.$parent.$eval(c.readonlyInput) : g.readonlyInput, this.setupInputEvents(e, f) }; var s = g.hourStep; c.hourStep && a.$parent.$watch(d(c.hourStep), function (a) { s = parseInt(a, 10) }); var t = g.minuteStep; c.minuteStep && a.$parent.$watch(d(c.minuteStep), function (a) { t = parseInt(a, 10) }); var u; a.$parent.$watch(d(c.min), function (a) { var b = new Date(a); u = isNaN(b) ? void 0 : b }); var v; a.$parent.$watch(d(c.max), function (a) { var b = new Date(a); v = isNaN(b) ? void 0 : b }), a.noIncrementHours = function () { var a = n(p, 60 * s); return a > v || p > a && u > a }, a.noDecrementHours = function () { var a = n(p, 60 * -s); return u > a || a > p && a > v }, a.noIncrementMinutes = function () { var a = n(p, t); return a > v || p > a && u > a }, a.noDecrementMinutes = function () { var a = n(p, -t); return u > a || a > p && a > v }, a.noToggleMeridian = function () { return p.getHours() < 13 ? n(p, 720) > v : n(p, -720) < u }, a.showMeridian = g.showMeridian,
    c.showMeridian && a.$parent.$watch(d(c.showMeridian), function (b) { if (a.showMeridian = !!b, q.$error.time) { var c = h(), d = i(); angular.isDefined(c) && angular.isDefined(d) && (p.setHours(c), k()) } else m() }), this.setupMousewheelEvents = function (b, c) { var d = function (a) { a.originalEvent && (a = a.originalEvent); var b = a.wheelDelta ? a.wheelDelta : -a.deltaY; return a.detail || b > 0 }; b.bind("mousewheel wheel", function (b) { a.$apply(d(b) ? a.incrementHours() : a.decrementHours()), b.preventDefault() }), c.bind("mousewheel wheel", function (b) { a.$apply(d(b) ? a.incrementMinutes() : a.decrementMinutes()), b.preventDefault() }) }, this.setupArrowkeyEvents = function (b, c) { b.bind("keydown", function (b) { 38 === b.which ? (b.preventDefault(), a.incrementHours(), a.$apply()) : 40 === b.which && (b.preventDefault(), a.decrementHours(), a.$apply()) }), c.bind("keydown", function (b) { 38 === b.which ? (b.preventDefault(), a.incrementMinutes(), a.$apply()) : 40 === b.which && (b.preventDefault(), a.decrementMinutes(), a.$apply()) }) }, this.setupInputEvents = function (b, c) { if (a.readonlyInput) return a.updateHours = angular.noop, void (a.updateMinutes = angular.noop); var d = function (b, c) { q.$setViewValue(null), q.$setValidity("time", !1), angular.isDefined(b) && (a.invalidHours = b), angular.isDefined(c) && (a.invalidMinutes = c) }; a.updateHours = function () { var a = h(), b = i(); angular.isDefined(a) && angular.isDefined(b) ? (p.setHours(a), u > p || p > v ? d(!0) : k("h")) : d(!0) }, b.bind("blur", function (b) { !a.invalidHours && a.hours < 10 && a.$apply(function () { a.hours = j(a.hours) }) }), a.updateMinutes = function () { var a = i(), b = h(); angular.isDefined(a) && angular.isDefined(b) ? (p.setMinutes(a), u > p || p > v ? d(void 0, !0) : k("m")) : d(void 0, !0) }, c.bind("blur", function (b) { !a.invalidMinutes && a.minutes < 10 && a.$apply(function () { a.minutes = j(a.minutes) }) }) }, this.render = function () { var b = q.$viewValue; isNaN(b) ? (q.$setValidity("time", !1), e.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')) : (b && (p = b), u > p || p > v ? (q.$setValidity("time", !1), a.invalidHours = !0, a.invalidMinutes = !0) : l(), m()) }, a.showSpinners = angular.isDefined(c.showSpinners) ? a.$parent.$eval(c.showSpinners) : g.showSpinners, a.incrementHours = function () { a.noIncrementHours() || o(60 * s) }, a.decrementHours = function () { a.noDecrementHours() || o(60 * -s) }, a.incrementMinutes = function () { a.noIncrementMinutes() || o(t) }, a.decrementMinutes = function () { a.noDecrementMinutes() || o(-t) }, a.toggleMeridian = function () { a.noToggleMeridian() || o(720 * (p.getHours() < 12 ? 1 : -1)) }
}]).directive("uibTimepicker", function () { return { restrict: "EA", require: ["uibTimepicker", "?^ngModel"], controller: "UibTimepickerController", controllerAs: "timepicker", replace: !0, scope: {}, templateUrl: function (a, b) { return b.templateUrl || "template/timepicker/timepicker.html" }, link: function (a, b, c, d) { var e = d[0], f = d[1]; f && e.init(f, b.find("input")) } } }), angular.module("ui.bootstrap.timepicker").value("$timepickerSuppressWarning", !1).controller("TimepickerController", ["$scope", "$element", "$attrs", "$controller", "$log", "$timepickerSuppressWarning", function (a, b, c, d, e, f) { f || e.warn("TimepickerController is now deprecated. Use UibTimepickerController instead."), angular.extend(this, d("UibTimepickerController", { $scope: a, $element: b, $attrs: c })) }]).directive("timepicker", ["$log", "$timepickerSuppressWarning", function (a, b) { return { restrict: "EA", require: ["timepicker", "?^ngModel"], controller: "TimepickerController", controllerAs: "timepicker", replace: !0, scope: {}, templateUrl: function (a, b) { return b.templateUrl || "template/timepicker/timepicker.html" }, link: function (c, d, e, f) { b || a.warn("timepicker is now deprecated. Use uib-timepicker instead."); var g = f[0], h = f[1]; h && g.init(h, d.find("input")) } } }]), angular.module("ui.bootstrap.typeahead", ["ui.bootstrap.position"]).factory("uibTypeaheadParser", ["$parse", function (a) { var b = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/; return { parse: function (c) { var d = c.match(b); if (!d) throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "' + c + '".'); return { itemName: d[3], source: a(d[4]), viewMapper: a(d[2] || d[1]), modelMapper: a(d[1]) } } } }]).controller("UibTypeaheadController", ["$scope", "$element", "$attrs", "$compile", "$parse", "$q", "$timeout", "$document", "$window", "$rootScope", "$uibPosition", "uibTypeaheadParser", function (a, b, c, d, e, f, g, h, i, j, k, l) { function m() { K.moveInProgress || (K.moveInProgress = !0, K.$digest()), S && g.cancel(S), S = g(function () { K.matches.length && n(), K.moveInProgress = !1 }, r) } function n() { K.position = C ? k.offset(b) : k.position(b), K.position.top += b.prop("offsetHeight") } var o, p, q = [9, 13, 27, 38, 40], r = 200, s = a.$eval(c.typeaheadMinLength); s || 0 === s || (s = 1); var t, u, v = a.$eval(c.typeaheadWaitMs) || 0, w = a.$eval(c.typeaheadEditable) !== !1, x = e(c.typeaheadLoading).assign || angular.noop, y = e(c.typeaheadOnSelect), z = angular.isDefined(c.typeaheadSelectOnBlur) ? a.$eval(c.typeaheadSelectOnBlur) : !1, A = e(c.typeaheadNoResults).assign || angular.noop, B = c.typeaheadInputFormatter ? e(c.typeaheadInputFormatter) : void 0, C = c.typeaheadAppendToBody ? a.$eval(c.typeaheadAppendToBody) : !1, D = c.typeaheadAppendToElementId || !1, E = a.$eval(c.typeaheadFocusFirst) !== !1, F = c.typeaheadSelectOnExact ? a.$eval(c.typeaheadSelectOnExact) : !1, G = e(c.ngModel), H = e(c.ngModel + "($$$p)"), I = function (b, c) { return angular.isFunction(G(a)) && p && p.$options && p.$options.getterSetter ? H(b, { $$$p: c }) : G.assign(b, c) }, J = l.parse(c.uibTypeahead), K = a.$new(), L = a.$on("$destroy", function () { K.$destroy() }); K.$on("$destroy", L); var M = "typeahead-" + K.$id + "-" + Math.floor(1e4 * Math.random()); b.attr({ "aria-autocomplete": "list", "aria-expanded": !1, "aria-owns": M }); var N = angular.element("<div uib-typeahead-popup></div>"); N.attr({ id: M, matches: "matches", active: "activeIdx", select: "select(activeIdx)", "move-in-progress": "moveInProgress", query: "query", position: "position" }), angular.isDefined(c.typeaheadTemplateUrl) && N.attr("template-url", c.typeaheadTemplateUrl), angular.isDefined(c.typeaheadPopupTemplateUrl) && N.attr("popup-template-url", c.typeaheadPopupTemplateUrl); var O = function () { K.matches = [], K.activeIdx = -1, b.attr("aria-expanded", !1) }, P = function (a) { return M + "-option-" + a }; K.$watch("activeIdx", function (a) { 0 > a ? b.removeAttr("aria-activedescendant") : b.attr("aria-activedescendant", P(a)) }); var Q = function (a, b) { return K.matches.length > b && a ? a.toUpperCase() === K.matches[b].label.toUpperCase() : !1 }, R = function (c) { var d = { $viewValue: c }; x(a, !0), A(a, !1), f.when(J.source(a, d)).then(function (e) { var f = c === o.$viewValue; if (f && t) if (e && e.length > 0) { K.activeIdx = E ? 0 : -1, A(a, !1), K.matches.length = 0; for (var g = 0; g < e.length; g++) d[J.itemName] = e[g], K.matches.push({ id: P(g), label: J.viewMapper(K, d), model: e[g] }); K.query = c, n(), b.attr("aria-expanded", !0), F && 1 === K.matches.length && Q(c, 0) && K.select(0) } else O(), A(a, !0); f && x(a, !1) }, function () { O(), x(a, !1), A(a, !0) }) }; C && (angular.element(i).bind("resize", m), h.find("body").bind("scroll", m)); var S; K.moveInProgress = !1, K.query = void 0; var T, U = function (a) { T = g(function () { R(a) }, v) }, V = function () { T && g.cancel(T) }; O(), K.select = function (d) { var e, f, h = {}; u = !0, h[J.itemName] = f = K.matches[d].model, e = J.modelMapper(a, h), I(a, e), o.$setValidity("editable", !0), o.$setValidity("parse", !0), y(a, { $item: f, $model: e, $label: J.viewMapper(a, h) }), O(), K.$eval(c.typeaheadFocusOnSelect) !== !1 && g(function () { b[0].focus() }, 0, !1) }, b.bind("keydown", function (a) { if (0 !== K.matches.length && -1 !== q.indexOf(a.which)) { if (-1 === K.activeIdx && (9 === a.which || 13 === a.which)) return O(), void K.$digest(); a.preventDefault(), 40 === a.which ? (K.activeIdx = (K.activeIdx + 1) % K.matches.length, K.$digest()) : 38 === a.which ? (K.activeIdx = (K.activeIdx > 0 ? K.activeIdx : K.matches.length) - 1, K.$digest()) : 13 === a.which || 9 === a.which ? K.$apply(function () { K.select(K.activeIdx) }) : 27 === a.which && (a.stopPropagation(), O(), K.$digest()) } }), b.bind("blur", function () { z && K.matches.length && -1 !== K.activeIdx && !u && (u = !0, K.$apply(function () { K.select(K.activeIdx) })), t = !1, u = !1 }); var W = function (a) { b[0] !== a.target && 3 !== a.which && 0 !== K.matches.length && (O(), j.$$phase || K.$digest()) }; h.bind("click", W), a.$on("$destroy", function () { h.unbind("click", W), (C || D) && X.remove(), N.remove() }); var X = d(N)(K); C ? h.find("body").append(X) : D !== !1 ? angular.element(h[0].getElementById(D)).append(X) : b.after(X), this.init = function (b, c) { o = b, p = c, o.$parsers.unshift(function (b) { return t = !0, 0 === s || b && b.length >= s ? v > 0 ? (V(), U(b)) : R(b) : (x(a, !1), V(), O()), w ? b : b ? void o.$setValidity("editable", !1) : (o.$setValidity("editable", !0), null) }), o.$formatters.push(function (b) { var c, d, e = {}; return w || o.$setValidity("editable", !0), B ? (e.$model = b, B(a, e)) : (e[J.itemName] = b, c = J.viewMapper(a, e), e[J.itemName] = void 0, d = J.viewMapper(a, e), c !== d ? c : b) }) } }]).directive("uibTypeahead", function () { return { controller: "UibTypeaheadController", require: ["ngModel", "^?ngModelOptions", "uibTypeahead"], link: function (a, b, c, d) { d[2].init(d[0], d[1]) } } }).directive("uibTypeaheadPopup", function () { return { scope: { matches: "=", query: "=", active: "=", position: "&", moveInProgress: "=", select: "&" }, replace: !0, templateUrl: function (a, b) { return b.popupTemplateUrl || "template/typeahead/typeahead-popup.html" }, link: function (a, b, c) { a.templateUrl = c.templateUrl, a.isOpen = function () { return a.matches.length > 0 }, a.isActive = function (b) { return a.active == b }, a.selectActive = function (b) { a.active = b }, a.selectMatch = function (b) { a.select({ activeIdx: b }) } } } }).directive("uibTypeaheadMatch", ["$templateRequest", "$compile", "$parse", function (a, b, c) { return { scope: { index: "=", match: "=", query: "=" }, link: function (d, e, f) { var g = c(f.templateUrl)(d.$parent) || "template/typeahead/typeahead-match.html"; a(g).then(function (a) { b(a.trim())(d, function (a) { e.replaceWith(a) }) }) } } }]).filter("uibTypeaheadHighlight", ["$sce", "$injector", "$log", function (a, b, c) { function d(a) { return a.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1") } function e(a) { return /<.*>/g.test(a) } var f; return f = b.has("$sanitize"), function (b, g) { return !f && e(b) && c.warn("Unsafe use of typeahead please use ngSanitize"), b = g ? ("" + b).replace(new RegExp(d(g), "gi"), "<strong>$&</strong>") : b, f || (b = a.trustAsHtml(b)), b } }]), angular.module("ui.bootstrap.typeahead").value("$typeaheadSuppressWarning", !1).service("typeaheadParser", ["$parse", "uibTypeaheadParser", "$log", "$typeaheadSuppressWarning", function (a, b, c, d) { return d || c.warn("typeaheadParser is now deprecated. Use uibTypeaheadParser instead."), b }]).directive("typeahead", ["$compile", "$parse", "$q", "$timeout", "$document", "$window", "$rootScope", "$uibPosition", "typeaheadParser", "$log", "$typeaheadSuppressWarning", function (a, b, c, d, e, f, g, h, i, j, k) { var l = [9, 13, 27, 38, 40], m = 200; return { require: ["ngModel", "^?ngModelOptions"], link: function (n, o, p, q) { function r() { N.moveInProgress || (N.moveInProgress = !0, N.$digest()), V && d.cancel(V), V = d(function () { N.matches.length && s(), N.moveInProgress = !1 }, m) } function s() { N.position = F ? h.offset(o) : h.position(o), N.position.top += o.prop("offsetHeight") } k || j.warn("typeahead is now deprecated. Use uib-typeahead instead."); var t = q[0], u = q[1], v = n.$eval(p.typeaheadMinLength); v || 0 === v || (v = 1); var w, x, y = n.$eval(p.typeaheadWaitMs) || 0, z = n.$eval(p.typeaheadEditable) !== !1, A = b(p.typeaheadLoading).assign || angular.noop, B = b(p.typeaheadOnSelect), C = angular.isDefined(p.typeaheadSelectOnBlur) ? n.$eval(p.typeaheadSelectOnBlur) : !1, D = b(p.typeaheadNoResults).assign || angular.noop, E = p.typeaheadInputFormatter ? b(p.typeaheadInputFormatter) : void 0, F = p.typeaheadAppendToBody ? n.$eval(p.typeaheadAppendToBody) : !1, G = p.typeaheadAppendToElementId || !1, H = n.$eval(p.typeaheadFocusFirst) !== !1, I = p.typeaheadSelectOnExact ? n.$eval(p.typeaheadSelectOnExact) : !1, J = b(p.ngModel), K = b(p.ngModel + "($$$p)"), L = function (a, b) { return angular.isFunction(J(n)) && u && u.$options && u.$options.getterSetter ? K(a, { $$$p: b }) : J.assign(a, b) }, M = i.parse(p.typeahead), N = n.$new(), O = n.$on("$destroy", function () { N.$destroy() }); N.$on("$destroy", O); var P = "typeahead-" + N.$id + "-" + Math.floor(1e4 * Math.random()); o.attr({ "aria-autocomplete": "list", "aria-expanded": !1, "aria-owns": P }); var Q = angular.element("<div typeahead-popup></div>"); Q.attr({ id: P, matches: "matches", active: "activeIdx", select: "select(activeIdx)", "move-in-progress": "moveInProgress", query: "query", position: "position" }), angular.isDefined(p.typeaheadTemplateUrl) && Q.attr("template-url", p.typeaheadTemplateUrl), angular.isDefined(p.typeaheadPopupTemplateUrl) && Q.attr("popup-template-url", p.typeaheadPopupTemplateUrl); var R = function () { N.matches = [], N.activeIdx = -1, o.attr("aria-expanded", !1) }, S = function (a) { return P + "-option-" + a }; N.$watch("activeIdx", function (a) { 0 > a ? o.removeAttr("aria-activedescendant") : o.attr("aria-activedescendant", S(a)) }); var T = function (a, b) { return N.matches.length > b && a ? a.toUpperCase() === N.matches[b].label.toUpperCase() : !1 }, U = function (a) { var b = { $viewValue: a }; A(n, !0), D(n, !1), c.when(M.source(n, b)).then(function (c) { var d = a === t.$viewValue; if (d && w) if (c && c.length > 0) { N.activeIdx = H ? 0 : -1, D(n, !1), N.matches.length = 0; for (var e = 0; e < c.length; e++) b[M.itemName] = c[e], N.matches.push({ id: S(e), label: M.viewMapper(N, b), model: c[e] }); N.query = a, s(), o.attr("aria-expanded", !0), I && 1 === N.matches.length && T(a, 0) && N.select(0) } else R(), D(n, !0); d && A(n, !1) }, function () { R(), A(n, !1), D(n, !0) }) }; F && (angular.element(f).bind("resize", r), e.find("body").bind("scroll", r)); var V; N.moveInProgress = !1, R(), N.query = void 0; var W, X = function (a) { W = d(function () { U(a) }, y) }, Y = function () { W && d.cancel(W) }; t.$parsers.unshift(function (a) { return w = !0, 0 === v || a && a.length >= v ? y > 0 ? (Y(), X(a)) : U(a) : (A(n, !1), Y(), R()), z ? a : a ? void t.$setValidity("editable", !1) : (t.$setValidity("editable", !0), null) }), t.$formatters.push(function (a) { var b, c, d = {}; return z || t.$setValidity("editable", !0), E ? (d.$model = a, E(n, d)) : (d[M.itemName] = a, b = M.viewMapper(n, d), d[M.itemName] = void 0, c = M.viewMapper(n, d), b !== c ? b : a) }), N.select = function (a) { var b, c, e = {}; x = !0, e[M.itemName] = c = N.matches[a].model, b = M.modelMapper(n, e), L(n, b), t.$setValidity("editable", !0), t.$setValidity("parse", !0), B(n, { $item: c, $model: b, $label: M.viewMapper(n, e) }), R(), N.$eval(p.typeaheadFocusOnSelect) !== !1 && d(function () { o[0].focus() }, 0, !1) }, o.bind("keydown", function (a) { if (0 !== N.matches.length && -1 !== l.indexOf(a.which)) { if (-1 === N.activeIdx && (9 === a.which || 13 === a.which)) return R(), void N.$digest(); a.preventDefault(), 40 === a.which ? (N.activeIdx = (N.activeIdx + 1) % N.matches.length, N.$digest()) : 38 === a.which ? (N.activeIdx = (N.activeIdx > 0 ? N.activeIdx : N.matches.length) - 1, N.$digest()) : 13 === a.which || 9 === a.which ? N.$apply(function () { N.select(N.activeIdx) }) : 27 === a.which && (a.stopPropagation(), R(), N.$digest()) } }), o.bind("blur", function () { C && N.matches.length && -1 !== N.activeIdx && !x && (x = !0, N.$apply(function () { N.select(N.activeIdx) })), w = !1, x = !1 }); var Z = function (a) { o[0] !== a.target && 3 !== a.which && 0 !== N.matches.length && (R(), g.$$phase || N.$digest()) }; e.bind("click", Z), n.$on("$destroy", function () { e.unbind("click", Z), (F || G) && $.remove(), Q.remove() }); var $ = a(Q)(N); F ? e.find("body").append($) : G !== !1 ? angular.element(e[0].getElementById(G)).append($) : o.after($) } } }]).directive("typeaheadPopup", ["$typeaheadSuppressWarning", "$log", function (a, b) { return { scope: { matches: "=", query: "=", active: "=", position: "&", moveInProgress: "=", select: "&" }, replace: !0, templateUrl: function (a, b) { return b.popupTemplateUrl || "template/typeahead/typeahead-popup.html" }, link: function (c, d, e) { a || b.warn("typeahead-popup is now deprecated. Use uib-typeahead-popup instead."), c.templateUrl = e.templateUrl, c.isOpen = function () { return c.matches.length > 0 }, c.isActive = function (a) { return c.active == a }, c.selectActive = function (a) { c.active = a }, c.selectMatch = function (a) { c.select({ activeIdx: a }) } } } }]).directive("typeaheadMatch", ["$templateRequest", "$compile", "$parse", "$typeaheadSuppressWarning", "$log", function (a, b, c, d, e) { return { restrict: "EA", scope: { index: "=", match: "=", query: "=" }, link: function (f, g, h) { d || e.warn("typeahead-match is now deprecated. Use uib-typeahead-match instead."); var i = c(h.templateUrl)(f.$parent) || "template/typeahead/typeahead-match.html"; a(i).then(function (a) { b(a.trim())(f, function (a) { g.replaceWith(a) }) }) } } }]).filter("typeaheadHighlight", ["$sce", "$injector", "$log", "$typeaheadSuppressWarning", function (a, b, c, d) { function e(a) { return a.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1") } function f(a) { return /<.*>/g.test(a) } var g; return g = b.has("$sanitize"), function (b, h) { return d || c.warn("typeaheadHighlight is now deprecated. Use uibTypeaheadHighlight instead."), !g && f(b) && c.warn("Unsafe use of typeahead please use ngSanitize"), b = h ? ("" + b).replace(new RegExp(e(h), "gi"), "<strong>$&</strong>") : b, g || (b = a.trustAsHtml(b)), b } }]), angular.module("template/accordion/accordion-group.html", []).run(["$templateCache", function (a) { a.put("template/accordion/accordion-group.html", '<div class="panel {{panelClass || \'panel-default\'}}">\n  <div class="panel-heading" ng-keypress="toggleOpen($event)">\n    <h4 class="panel-title">\n      <a href tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" uib-accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n    </h4>\n  </div>\n  <div class="panel-collapse collapse" uib-collapse="!isOpen">\n	  <div class="panel-body" ng-transclude></div>\n  </div>\n</div>\n') }]), angular.module("template/accordion/accordion.html", []).run(["$templateCache", function (a) { a.put("template/accordion/accordion.html", '<div class="panel-group" ng-transclude></div>') }]), angular.module("template/alert/alert.html", []).run(["$templateCache", function (a) { a.put("template/alert/alert.html", '<div class="alert" ng-class="[\'alert-\' + (type || \'warning\'), closeable ? \'alert-dismissible\' : null]" role="alert">\n    <button ng-show="closeable" type="button" class="close" ng-click="close({$event: $event})">\n        <span aria-hidden="true">&times;</span>\n        <span class="sr-only">Close</span>\n    </button>\n    <div ng-transclude></div>\n</div>\n') }]), angular.module("template/carousel/carousel.html", []).run(["$templateCache", function (a) { a.put("template/carousel/carousel.html", '<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n  <div class="carousel-inner" ng-transclude></div>\n  <a role="button" href class="left carousel-control" ng-click="prev()" ng-show="slides.length > 1">\n    <span aria-hidden="true" class="glyphicon glyphicon-chevron-left"></span>\n    <span class="sr-only">previous</span>\n  </a>\n  <a role="button" href class="right carousel-control" ng-click="next()" ng-show="slides.length > 1">\n    <span aria-hidden="true" class="glyphicon glyphicon-chevron-right"></span>\n    <span class="sr-only">next</span>\n  </a>\n  <ol class="carousel-indicators" ng-show="slides.length > 1">\n    <li ng-repeat="slide in slides | orderBy:indexOfSlide track by $index" ng-class="{ active: isActive(slide) }" ng-click="select(slide)">\n      <span class="sr-only">slide {{ $index + 1 }} of {{ slides.length }}<span ng-if="isActive(slide)">, currently active</span></span>\n    </li>\n  </ol>\n</div>') }]), angular.module("template/carousel/slide.html", []).run(["$templateCache", function (a) { a.put("template/carousel/slide.html", '<div ng-class="{\n    \'active\': active\n  }" class="item text-center" ng-transclude></div>\n') }]), angular.module("template/datepicker/datepicker.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/datepicker.html", '<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n  <uib-daypicker ng-switch-when="day" tabindex="0"></uib-daypicker>\n  <uib-monthpicker ng-switch-when="month" tabindex="0"></uib-monthpicker>\n  <uib-yearpicker ng-switch-when="year" tabindex="0"></uib-yearpicker>\n</div>') }]), angular.module("template/datepicker/day.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/day.html", '<table role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n  <thead>\n    <tr>\n         <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n       <th colspan="{{::5 + showWeeks}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n   <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n   </tr>\n    <tr>\n      <th ng-if="showWeeks" class="text-center"></th>\n      <th ng-repeat="label in ::labels track by $index" class="text-center"><small aria-label="{{::label.full}}">{{::label.abbr}}</small></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr ng-repeat="row in rows track by $index">\n      <td ng-if="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n      <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{::dt.uid}}" ng-class="::dt.customClass">\n        <button type="button" style="min-width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="::{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{::dt.label}}</span></button>\n      </td>\n    </tr>\n  </tbody>\n</table>\n') }]), angular.module("template/datepicker/month.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/month.html", '<table role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n  <thead>\n    <tr>\n       <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n      <th><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>   \n    </tr>\n  </thead>\n  <tbody>\n    <tr ng-repeat="row in rows track by $index">\n      <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{::dt.uid}}" ng-class="::dt.customClass">\n        <button type="button" style="min-width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="::{\'text-info\': dt.current}">{{::dt.label}}</span></button>\n      </td>\n    </tr>\n  </tbody>\n</table>\n') }]), angular.module("template/datepicker/popup.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/popup.html", '<ul class="dropdown-menu" dropdown-nested ng-if="isOpen" style="display: block" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)" ng-click="$event.stopPropagation()">\n	<li ng-transclude></li>\n	<li ng-if="showButtonBar" style="padding:0">\n		<span class="btn-group pull-left">\n			<button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')" ng-disabled="isDisabled(\'today\')">{{ getText(\'current\') }}</button>\n			<button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n		</span>\n		<button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n	</li>\n</ul>\n') }]), angular.module("template/datepicker/year.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/year.html", '<table role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n  <thead>\n    <tr>\n      <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n      <th colspan="3"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n      <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr ng-repeat="row in rows track by $index">\n      <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{::dt.uid}}" ng-class="::dt.customClass">\n        <button type="button" style="min-width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="::{\'text-info\': dt.current}">{{::dt.label}}</span></button>\n      </td>\n    </tr>\n  </tbody>\n</table>\n') }]), angular.module("template/modal/backdrop.html", []).run(["$templateCache", function (a) { a.put("template/modal/backdrop.html", '<div uib-modal-animation-class="fade"\n     modal-in-class="in"\n     ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n') }]), angular.module("template/modal/window.html", []).run(["$templateCache", function (a) { a.put("template/modal/window.html", '<div modal-render="{{$isRendered}}" tabindex="-1" role="dialog" class="modal"\n    uib-modal-animation-class="fade"\n    modal-in-class="in"\n    ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}">\n    <div class="modal-dialog" ng-class="size ? \'modal-\' + size : \'\'"><div class="modal-content" uib-modal-transclude></div></div>\n</div>\n') }]), angular.module("template/pagination/pager.html", []).run(["$templateCache", function (a) { a.put("template/pagination/pager.html", '<ul class="pager">\n  <li ng-class="{disabled: noPrevious()||ngDisabled, previous: align}"><a href ng-click="selectPage(page - 1, $event)">{{::getText(\'previous\')}}</a></li>\n  <li ng-class="{disabled: noNext()||ngDisabled, next: align}"><a href ng-click="selectPage(page + 1, $event)">{{::getText(\'next\')}}</a></li>\n</ul>\n') }]), angular.module("template/pagination/pagination.html", []).run(["$templateCache", function (a) { a.put("template/pagination/pagination.html", '<ul class="pagination">\n  <li ng-if="::boundaryLinks" ng-class="{disabled: noPrevious()||ngDisabled}" class="pagination-first"><a href ng-click="selectPage(1, $event)">{{::getText(\'first\')}}</a></li>\n  <li ng-if="::directionLinks" ng-class="{disabled: noPrevious()||ngDisabled}" class="pagination-prev"><a href ng-click="selectPage(page - 1, $event)">{{::getText(\'previous\')}}</a></li>\n  <li ng-repeat="page in pages track by $index" ng-class="{active: page.active,disabled: ngDisabled&&!page.active}" class="pagination-page"><a href ng-click="selectPage(page.number, $event)">{{page.text}}</a></li>\n  <li ng-if="::directionLinks" ng-class="{disabled: noNext()||ngDisabled}" class="pagination-next"><a href ng-click="selectPage(page + 1, $event)">{{::getText(\'next\')}}</a></li>\n  <li ng-if="::boundaryLinks" ng-class="{disabled: noNext()||ngDisabled}" class="pagination-last"><a href ng-click="selectPage(totalPages, $event)">{{::getText(\'last\')}}</a></li>\n</ul>\n') }]), angular.module("template/tooltip/tooltip-html-popup.html", []).run(["$templateCache", function (a) { a.put("template/tooltip/tooltip-html-popup.html", '<div\n  tooltip-animation-class="fade"\n  uib-tooltip-classes\n  ng-class="{ in: isOpen() }">\n  <div class="tooltip-arrow"></div>\n  <div class="tooltip-inner" ng-bind-html="contentExp()"></div>\n</div>\n') }]), angular.module("template/tooltip/tooltip-popup.html", []).run(["$templateCache", function (a) { a.put("template/tooltip/tooltip-popup.html", '<div\n  tooltip-animation-class="fade"\n  uib-tooltip-classes\n  ng-class="{ in: isOpen() }">\n  <div class="tooltip-arrow"></div>\n  <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n') }]), angular.module("template/tooltip/tooltip-template-popup.html", []).run(["$templateCache", function (a) { a.put("template/tooltip/tooltip-template-popup.html", '<div\n  tooltip-animation-class="fade"\n  uib-tooltip-classes\n  ng-class="{ in: isOpen() }">\n  <div class="tooltip-arrow"></div>\n  <div class="tooltip-inner"\n    uib-tooltip-template-transclude="contentExp()"\n    tooltip-template-transclude-scope="originScope()"></div>\n</div>\n') }]), angular.module("template/popover/popover-html.html", []).run(["$templateCache", function (a) { a.put("template/popover/popover-html.html", '<div tooltip-animation-class="fade"\n  uib-tooltip-classes\n  ng-class="{ in: isOpen() }">\n  <div class="arrow"></div>\n\n  <div class="popover-inner">\n      <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n      <div class="popover-content" ng-bind-html="contentExp()"></div>\n  </div>\n</div>\n') }]), angular.module("template/popover/popover-template.html", []).run(["$templateCache", function (a) { a.put("template/popover/popover-template.html", '<div tooltip-animation-class="fade"\n  uib-tooltip-classes\n  ng-class="{ in: isOpen() }">\n  <div class="arrow"></div>\n\n  <div class="popover-inner">\n      <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n      <div class="popover-content"\n        uib-tooltip-template-transclude="contentExp()"\n        tooltip-template-transclude-scope="originScope()"></div>\n  </div>\n</div>\n') }]), angular.module("template/popover/popover.html", []).run(["$templateCache", function (a) { a.put("template/popover/popover.html", '<div tooltip-animation-class="fade"\n  uib-tooltip-classes\n  ng-class="{ in: isOpen() }">\n  <div class="arrow"></div>\n\n  <div class="popover-inner">\n      <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n      <div class="popover-content" ng-bind="content"></div>\n  </div>\n</div>\n') }]), angular.module("template/progressbar/bar.html", []).run(["$templateCache", function (a) { a.put("template/progressbar/bar.html", '<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" aria-labelledby="{{::title}}" style="min-width: 0;" ng-transclude></div>\n') }]), angular.module("template/progressbar/progress.html", []).run(["$templateCache", function (a) { a.put("template/progressbar/progress.html", '<div class="progress" ng-transclude aria-labelledby="{{::title}}"></div>') }]), angular.module("template/progressbar/progressbar.html", []).run(["$templateCache", function (a) { a.put("template/progressbar/progressbar.html", '<div class="progress">\n  <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" aria-labelledby="{{::title}}" style="min-width: 0;" ng-transclude></div>\n</div>\n') }]), angular.module("template/rating/rating.html", []).run(["$templateCache", function (a) { a.put("template/rating/rating.html", '<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n    <span ng-repeat-start="r in range track by $index" class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n    <i ng-repeat-end ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')" ng-attr-title="{{r.title}}" aria-valuetext="{{r.title}}"></i>\n</span>\n') }]), angular.module("template/tabs/tab.html", []).run(["$templateCache", function (a) { a.put("template/tabs/tab.html", '<li ng-class="{active: active, disabled: disabled}">\n  <a href ng-click="select()" uib-tab-heading-transclude>{{heading}}</a>\n</li>\n') }]), angular.module("template/tabs/tabset.html", []).run(["$templateCache", function (a) {
    a.put("template/tabs/tabset.html", '<div>\n  <ul class="nav nav-{{type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n  <div class="tab-content">\n    <div class="tab-pane" \n         ng-repeat="tab in tabs" \n         ng-class="{active: tab.active}"\n         uib-tab-content-transclude="tab">\n    </div>\n  </div>\n</div>\n');
}]), angular.module("template/timepicker/timepicker.html", []).run(["$templateCache", function (a) { a.put("template/timepicker/timepicker.html", '<table>\n  <tbody>\n    <tr class="text-center" ng-show="::showSpinners">\n      <td><a ng-click="incrementHours()" ng-class="{disabled: noIncrementHours()}" class="btn btn-link" ng-disabled="noIncrementHours()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n      <td>&nbsp;</td>\n      <td><a ng-click="incrementMinutes()" ng-class="{disabled: noIncrementMinutes()}" class="btn btn-link" ng-disabled="noIncrementMinutes()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n      <td ng-show="showMeridian"></td>\n    </tr>\n    <tr>\n      <td class="form-group" ng-class="{\'has-error\': invalidHours}">\n        <input style="width:50px;" type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-readonly="::readonlyInput" maxlength="2" tabindex="{{::tabindex}}">\n      </td>\n      <td>:</td>\n      <td class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n        <input style="width:50px;" type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="::readonlyInput" maxlength="2" tabindex="{{::tabindex}}">\n      </td>\n      <td ng-show="showMeridian"><button type="button" ng-class="{disabled: noToggleMeridian()}" class="btn btn-default text-center" ng-click="toggleMeridian()" ng-disabled="noToggleMeridian()" tabindex="{{::tabindex}}">{{meridian}}</button></td>\n    </tr>\n    <tr class="text-center" ng-show="::showSpinners">\n      <td><a ng-click="decrementHours()" ng-class="{disabled: noDecrementHours()}" class="btn btn-link" ng-disabled="noDecrementHours()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n      <td>&nbsp;</td>\n      <td><a ng-click="decrementMinutes()" ng-class="{disabled: noDecrementMinutes()}" class="btn btn-link" ng-disabled="noDecrementMinutes()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n      <td ng-show="showMeridian"></td>\n    </tr>\n  </tbody>\n</table>\n') }]), angular.module("template/typeahead/typeahead-match.html", []).run(["$templateCache", function (a) { a.put("template/typeahead/typeahead-match.html", '<a href tabindex="-1" ng-bind-html="match.label | uibTypeaheadHighlight:query"></a>\n') }]), angular.module("template/typeahead/typeahead-popup.html", []).run(["$templateCache", function (a) { a.put("template/typeahead/typeahead-popup.html", '<ul class="dropdown-menu" ng-show="isOpen() && !moveInProgress" ng-style="{top: position().top+\'px\', left: position().left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n    <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{::match.id}}">\n        <div uib-typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n    </li>\n</ul>\n') }]), !angular.$$csp() && angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>');;
angular.module("ngLocale", [], ["$provide", function ($provide) {
    var PLURAL_CATEGORY = { ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other" };
    $provide.value("$locale", {
        "DATETIME_FORMATS": {
            "AMPMS": [
              "\u05dc\u05e4\u05e0\u05d4\u05f4\u05e6",
              "\u05d0\u05d7\u05d4\u05f4\u05e6"
            ],
            "DAY": [
              "\u05d9\u05d5\u05dd \u05e8\u05d0\u05e9\u05d5\u05df",
              "\u05d9\u05d5\u05dd \u05e9\u05e0\u05d9",
              "\u05d9\u05d5\u05dd \u05e9\u05dc\u05d9\u05e9\u05d9",
              "\u05d9\u05d5\u05dd \u05e8\u05d1\u05d9\u05e2\u05d9",
              "\u05d9\u05d5\u05dd \u05d7\u05de\u05d9\u05e9\u05d9",
              "\u05d9\u05d5\u05dd \u05e9\u05d9\u05e9\u05d9",
              "\u05d9\u05d5\u05dd \u05e9\u05d1\u05ea"
            ],
            "MONTH": [
              "\u05d9\u05e0\u05d5\u05d0\u05e8",
              "\u05e4\u05d1\u05e8\u05d5\u05d0\u05e8",
              "\u05de\u05e8\u05e5",
              "\u05d0\u05e4\u05e8\u05d9\u05dc",
              "\u05de\u05d0\u05d9",
              "\u05d9\u05d5\u05e0\u05d9",
              "\u05d9\u05d5\u05dc\u05d9",
              "\u05d0\u05d5\u05d2\u05d5\u05e1\u05d8",
              "\u05e1\u05e4\u05d8\u05de\u05d1\u05e8",
              "\u05d0\u05d5\u05e7\u05d8\u05d5\u05d1\u05e8",
              "\u05e0\u05d5\u05d1\u05de\u05d1\u05e8",
              "\u05d3\u05e6\u05de\u05d1\u05e8"
            ],
            "SHORTDAY": [
              "\u05d9\u05d5\u05dd \u05d0\u05f3",
              "\u05d9\u05d5\u05dd \u05d1\u05f3",
              "\u05d9\u05d5\u05dd \u05d2\u05f3",
              "\u05d9\u05d5\u05dd \u05d3\u05f3",
              "\u05d9\u05d5\u05dd \u05d4\u05f3",
              "\u05d9\u05d5\u05dd \u05d5\u05f3",
              "\u05e9\u05d1\u05ea"
            ],
            "SHORTMONTH": [
              "\u05d9\u05e0\u05d5",
              "\u05e4\u05d1\u05e8",
              "\u05de\u05e8\u05e5",
              "\u05d0\u05e4\u05e8",
              "\u05de\u05d0\u05d9",
              "\u05d9\u05d5\u05e0",
              "\u05d9\u05d5\u05dc",
              "\u05d0\u05d5\u05d2",
              "\u05e1\u05e4\u05d8",
              "\u05d0\u05d5\u05e7",
              "\u05e0\u05d5\u05d1",
              "\u05d3\u05e6\u05de"
            ],
            "fullDate": "EEEE, d \u05d1MMMM y",
            "longDate": "d \u05d1MMMM y",
            "medium": "d \u05d1MMM yyyy HH:mm:ss",
            "mediumDate": "d \u05d1MMM yyyy",
            "mediumTime": "HH:mm:ss",
            "short": "dd/MM/yy HH:mm",
            "shortDate": "dd/MM/yy",
            "shortTime": "HH:mm"
        },
        "NUMBER_FORMATS": {
            "CURRENCY_SYM": "\u20aa",
            "DECIMAL_SEP": ".",
            "GROUP_SEP": ",",
            "PATTERNS": [
              {
                  "gSize": 3,
                  "lgSize": 3,
                  "macFrac": 0,
                  "maxFrac": 3,
                  "minFrac": 0,
                  "minInt": 1,
                  "negPre": "-",
                  "negSuf": "",
                  "posPre": "",
                  "posSuf": ""
              },
              {
                  "gSize": 3,
                  "lgSize": 3,
                  "macFrac": 0,
                  "maxFrac": 2,
                  "minFrac": 2,
                  "minInt": 1,
                  "negPre": "-",
                  "negSuf": "\u00a0\u00a4",
                  "posPre": "",
                  "posSuf": "\u00a0\u00a4"
              }
            ]
        },
        "id": "he-il",
        "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER; }
    });
}]);;
String.prototype.toBean = function () {
    return this + "Bean";
};
var app;
(function (app) {
    var Common;
    (function (Common) {
        var DigitalServicesModule;
        (function (DigitalServicesModule) {
            var Constants;
            (function (Constants) {
                //*************  General services *************
                Constants.ReturnCodesServiceUrl = '/ErrorMessages/ReturnCodeMessage';
                //export var SearchResultsUrl = '/SearchResult/Search';
                Constants.SearchResultsUrl = '/SearchResult/Search';
                Constants.SearchResultsCounterUrl = '/SearchResult/GetCounters';
                Constants.PopupSessionUpdateUrl = '/PersonalArea/UpdatePopup';
                Constants.ValidateCaptchaUrl = '/CaptchaBlock/CaptchaPost';
                Constants.ValidateGoogleRecaptchaUrl = '/Recaptcha/ValidateRecaptcha';
                Constants.ValidateCaptchaUrlFor109 = '/DigitalLoans/CaptchaPost';
                Constants.LogOff = Constants.DigitalServicesBase + 'performExit';
                Constants.UserGuid = 'userGuid=' + (userGuid || '');
                Constants.ChangePassword = "TXChangePasswordCustomer_503";
                Constants.stProxyBibi_GetCode = "/bbproxy/rest/getcode/";
                Constants.ValidateRecaptcha = "/Recaptcha/Validate";
                //*************  Java services *************
                Constants.DigitalServicesBase = staticURL + '?reqName=';
                Constants.RefreshCardList = 'RefreshCardList';
                Constants.TransactionsDetails = 'TransactionsDetails';
                Constants.RikuzNetuneyCreditDigi = 'RikuzNetuneyCreditDigi';
                Constants.ClientCreditCardsServiceUrl = 'ClientCreditCardsServiceUrl';
                Constants.ActivateCard_114 = 'ActivateCard_114';
                Constants.RestoreCardCode_115 = 'RestoreCardCode_115';
                Constants.CardsList_102Digital = 'CardsList_102Digital';
                Constants.CardInfoEnrichment = 'CardInfoEnrichment';
                Constants.MfCreditPoolReq = 'MfCreditPoolReq';
                Constants.GetInsuranceConsentReq = 'GetCustomerConsents';
                Constants.CardsList_102 = 'CardsList_102';
                Constants.StatusBerur_212 = 'StatusBerur_212';
                Constants.CustDebitCancelAuthorization_215 = 'CustDebitCancelAuthorization_215';
                Constants.ShowCustomerData_101 = 'ShowCustomerData_101';
                Constants.UpdateCustomerData = 'UpdateCustomerData';
                Constants.DashboardCharges = 'DashboardCharges';
                Constants.DashboardGraphOds = 'DashboardGraphOds';
                Constants.DashboardMonth = 'DashboardMonth';
                Constants.DashboardNotBillingDate = 'DashboardNotBillingDate';
                Constants.StatusIssuanceService = 'CustomerLatestEvents';
                Constants.ReportStolen = 'ReportStolen';
                Constants.BlockCard = 'BlockCard';
                //*************  חו"ל  *************
                Constants.AbroadDebitsSpreading = 'AbroadDebitsSpreading';
                Constants.ATMGetCountriesAction = 'GetCountries';
                Constants.ATMGetByLatLong = 'ATMByLatLong';
                Constants.ATMGetByAddress = 'ATMByAddress';
                Constants.ATMGetByCity = 'ATMByCity';
                //*************  אזור הלוואות  *************
                Constants.AshraiMahir_308 = 'AshraiMahir_308';
                Constants.MonthlyRefundDigi = 'CheckConstantMonthlyRefundDigi'; //'JoinConstantMonthlyRefund_800';
                Constants.CallBackAddRequest = 'CallBackAddRequest';
                Constants.FastCredit = 'FastCredit';
                //*************  קודי שגיאות  *************
                Constants.NON_BANK_CARD_MAX_LIMIT_ERR = '085';
                Constants.NON_BANK_CARD_MIN_LIMIT_ERR = '064';
                Constants.BANK_CARD_CREDIT_AMOUNT_ERR = '501';
                Constants.BANK_CARD_MAX_PAYMENTS = '502';
                //*************  עסקאות  *************
                Constants.TransactionsForDate = 'DealsListForDate_203';
                Constants.PirteyIska = 'PirteyIska_204';
                Constants.CardsTransactionsList = 'CardsTransactionsList';
                //*************  Customer Recruiting Services  *************
                Constants.KeepSessionAlive = 'KeepSessionAlive';
                Constants.IdentifySalesAttendant = 'IdentifySalesAttendant';
                Constants.IdentifySalesCustomer = 'IdentifySalesCustomer';
                Constants.CheckAccountValidity = 'CheckAccountValidity';
                Constants.CardTypeClubList = 'CardTypeClubList';
                Constants.CardIssuance = 'CardIssuance';
                Constants.GetAdjustedMaximumInterestDisclosureData = 'GetAdjustedMaximumInterestDiscloserData';
                Constants.CityStreetZip = 'CityStreetZip';
                Constants.CommChannels = 'CommChannels';
                Constants.ArutzimEmailService = 'ArutzimEmailService_15046';
                Constants.CheckCardMembership = 'CheckCardMembership';
                Constants.MfProperDisclosure = 'MfProperDisclosure';
                Constants.ArutzimEmail_15046 = 'ArutzimEmail_15046';
                Constants.ChatzavTransferDirectDebit = 'ChatzavTransferDirectDebit';
                Constants.GetDocFromTemplateDayal = 'GetDocFromTemplateDayal';
                Constants.ChannelsServicesForIssuance = 'ChannelsServicesForIssuance';
                Constants.LoanProperDisclosure = 'LoanProperDisclosure';
                Constants.AshraiProposal = 'AshraiProposal';
                Constants.GetShiuchName = 'GetShiuchName';
                Constants.VerifyKartisChever = 'VerifyKartisChever';
                Constants.SendMailForGetDocFromTemplate = "SendMailForGetDocFromTemplate";
                Constants.sendPrintbossToArchive = "sendPrintbossToArchive";
                Constants.CustomerInfoChannelStatus = "CustomerInfoChannelStatus";
                //***************Customer Recruiting Selected Card *******//
                //for catch card from More type
                //If there are more numbers of KodSherut that belongs to More type
                //enter in format "-#-"  for example:to prevent catch 4# in 44#
                Constants.MoreCardKodSherut = '-12-24-124-';
                Constants.IsraelStateCode = '212';
                Constants.InternationalKodShimush = '2';
                Constants.cardIssuanceSuccessResponse = '-0-2-505-';
                //use in CardIssuance Chever process
                Constants.temporaryKodShiuch = '';
                //*************  Attendant Recruiting Services Errors - Attendant  *************
                Constants.GeneralErrMsgAttendant = 'GeneralErrMsgAttendant';
                Constants.GetShiuchNameAttendant = 'GetShiuchNameAttendant';
                Constants.VerifyKartisCheverAttendant = 'VerifyKartisCheverAttendant';
                Constants.CheckCardMembershipAttendant = 'CheckCardMembershipAttendant';
                Constants.CheckAccountValidityAttendant = 'CheckAccountValidityAttendant';
                Constants.CardTypeClubListAttendant = 'CardTypeClubListAttendant';
                Constants.MfProperDisclosureAttendant = 'MfProperDisclosureAttendant';
                Constants.CommonChannelsAttendant = 'CommonChannelsAttendant';
                Constants.CardIssuanceRequestAttendant = 'CardIssuanceRequestAttendant';
                Constants.SendMailAttendant = 'SendMailAttendant';
                Constants.ChatzavTransferDirectDebitAttendant = 'ChatzavTransferDirectDebitAttendant';
                Constants.PrintBossAttendant = 'PrintBossAttendant';
                Constants.SendMailAndArchiveForGetDocFromTemplate = "SendMailAndArchiveForGetDocFromTemplate";
                Constants.SuccessScreenIfnAttendant = 'SuccessScreenIfnAttendant';
                Constants.SuccessScreenEmailAttendant = 'SuccessScreenEmailAttendant';
                Constants.ChatzavGenericMembershipAttendant = 'ChatzavGenericMembershipAttendant';
                Constants.DeliveryArrangeErrorMsgAttendant = 'DeliveryArrangeErrorMsgAttendant';
                //*************  Customer Recruiting Services Errors - Customer  *************
                Constants.GeneralErrMsgCustomer = 'GeneralErrMsgCustomer';
                Constants.GetShiuchNameCustomer = 'GetShiuchNameCustomer';
                Constants.VerifyKartisCheverCustomer = 'VerifyKartisCheverCustomer';
                Constants.CheckCardMembershipCustomer = 'CheckCardMembershipCustomer';
                Constants.CheckAccountValidityCustomer = 'CheckAccountValidityCustomer';
                Constants.CardTypeClubListCustomer = 'CardTypeClubListCustomer';
                Constants.MfProperDisclosureCustomer = 'MfProperDisclosureCustomer';
                Constants.CommonChannelsCustomer = 'CommonChannelsCustomer';
                Constants.CardIssuanceRequestCustomer = 'CardIssuanceRequestCustomer';
                Constants.SendMailCustomer = 'SendMailCustomer';
                Constants.ChatzavTransferDirectDebitCustomer = 'ChatzavTransferDirectDebitCustomer';
                Constants.PrintBossCustomer = 'PrintBossCustomer';
                Constants.SuccessScreenIfnCustomer = 'SuccessScreenIfnCustomer';
                Constants.SuccessScreenEmailCustomer = 'SuccessScreenEmailCustomer';
                Constants.ChatzavGenericMembershipCustomer = 'ChatzavGenericMembershipCustomer';
                Constants.DeliveryArrangeErrorMsgCustomer = 'DeliveryArrangeErrorMsgCustomer';
                //************* OTP LOGIN Services  *************
                Constants.ValidateIdData = 'ValidateIdData';
                Constants.ValidateIdDataForLogin = 'ValidateIdDataForLogin';
                Constants.SendOTP = 'SendOTP';
                Constants.ValidateOTP = 'ValidateOTP';
                Constants.ValidateLoginOtp = 'ValidateLoginOtp';
                Constants.PerformLogonOtp = 'performLogonOtp';
                //************* OTP GUID LOGIN Services  *************
                Constants.SendOtpGuidLogin = 'SendOtpGuidLogin';
                Constants.ValidateOtpGuidLogin = 'ValidateOtpGuidLogin';
                Constants.PerformGuidLoginOtp = 'performLogonOtpGuidLogin';
                Constants.ValidateIdQuestion = 'ValidateIdQuestion';
                Constants.GetQuestions = 'ReshimatSheelot';
                Constants.GetCountries = "KodeyEretz";
                Constants.NewCustomerRegistration = "NewCustomerRegistration";
                Constants.NewCustomerChangePassword = "NewCustomerChangePassword";
                //********************* Abroad ***********************
                Constants.ExchangeRates = "ExchangeRates";
                Constants.AbroadCurrencyList = "GetCurrencyList";
                Constants.AbroadCurrencyRates = "GetCurrencyRates";
                Constants.CurrencyCalculatorExchangeRates = "Shearim_210";
                Constants.UpdateTravelDetailsSubmitForm = "/UpdateTravelDetails/SubmitForm";
                //********************* Transaction Inquiry **********************
                Constants.PtichatBerur_214 = "PtichatBerur_214";
                //********************* Report Stolen **********************
                Constants.ReportStolen = "ReportStolen";
                //********************* Customer Support ***********************
                Constants.CustomerSupportBusinessSendEmail = "/CustomerSupportBusiness/SubmitForm";
                //********************* Business Recruitment ***********************
                Constants.JoinBussinessCustomer = "JoinBussinessCustomer";
                //********************* Send Email ***********************
                Constants.sendSmtpMail = "SendSmtpMail";
                Constants.serviceSendSmtpMail = "ServiceSendSmtpMail";
                Constants.SendSmtpCareers = "SendSmtpCareers";
                Constants.SendSmtpBusinessRecruitment = "SendSmtpBusinessRecruitment";
                Constants.SendSmtpAgentSupport = "SendSmtpAgentSupport";
                Constants.SendSmtpAbroadTransactionsInquiry = "SendSmtpAbroadTransactionsInquiry";
                Constants.SendSmtpFloatingLead = "SendSmtpFloatingLead";
                Constants.SendSmtpSmartContactUs = "SendSmtpSmartContactUs";
                Constants.SendSmtpBusinessLeadAmex = "SendSmtpBusinessLeadAmex";
                //********************* CallBackAddRequest ***********************
                Constants.CallBackAddRequest = "CallBackAddRequest";
                Constants.CallBackAddRequestGuidLogin = "CallBackAddRequestGuidLogin";
                Constants.CallBackAddRequestForLoanArea = "CallBackAddRequestForLoanArea";
                //********************* ServiceSessionData ***********************
                Constants.ServiceSessionCRWizard = "ServiceSessionCRWizard";
                Constants.ServiceSessionCRWizardPrepaidCard = "ServiceSessionCRWzardPrepaidCard";
                Constants.ServiceSessionDigitalLoans = "ServiceSessionDigitalLoans";
                Constants.ServiceSessionFlex = "ServiceSessionFlex";
                //********************* Company Codes ***********************
                Constants.Company_Code_Isracard = "11";
                Constants.Company_Code_Amex = "77";
                //********************* Digital Customer***********************
                Constants.GetAccountBirthDetails = "GetAccountBirthDetails";
                Constants.ContanctDetails = "ContactDetails";
                Constants.MaskedContactDetails = "MaskedContactDetails";
                Constants.DigitalClientMaskedContactDetails = "DigitalClientMaskedContactDetails";
                Constants.ClientOnlineBanking = "ClientOnlineBanking";
                Constants.DigitalCustomerData = "/DigitalCustomerLogin/GetData";
                Constants.ApprovalGatheringFormData = "/ApprovalGathering/GetFormData";
                Constants.ApprovalGatheringStatusData = "/ApprovalGathering/GetStatusData";
                Constants.GetCustomerIsurentsConsent = "InsuranceConsentGet";
                Constants.DigitalCustomerPageData = "/DigitalCustomerLogin/GetPageData";
                Constants.GetPrefixes = "/DigitalCustomerLogin/GetPrefixes";
                Constants.GetTranslations = "/DigitalCustomerLogin/GetTranslations";
                //********************* Points Balance***********************
                Constants.BenefitPointsBalance = "BenefitPointsBalance";
                //*********************Opswat Scan File***********************
                Constants.OpswatFileUpload = "OpswatFileUpload";
                //*********************Status Issuance***********************
                Constants.StatusIssuanceGetPopUpPageDataByKey = "/MainPageStatusIssuance/GetPopUpPageData";
                Constants.StatusIssuanceFileUpload = "/MainPageStatusIssuance/UploadSingleFile";
                Constants.StatusIssuanceFileStatus = "/MainPageStatusIssuance/GetStatusByScannedDataId";
                Constants.StatusIssuancePostFiles = "/MainPageStatusIssuance/PostFilesBySMTP";
                //*********************Smart Contact Us***********************
                Constants.CRMIncidentOperationsXML = "CRM.INCIDENT.OPERATIONS.XML";
                Constants.ClientOnlineBanking = "ClientOnlineBanking";
                Constants.ContactDetails = "ContactDetails";
                Constants.CrmIndicationOpreration = "/SmartContactUsForm/Submit";
                Constants.IsIsracardCustomer = "/SmartContactUsForm/IsIsracardCustomer";
                //********************* Flex ***********************************
                Constants.FlexIdentifyMarchant = "FlexIdentifyMarchant";
                Constants.LoanProperDisclosure = "LoanProperDisclosure";
                Constants.CheckAccountValidity = "CheckAccountValidity";
                Constants.PriceListData = "PriceListData";
                Constants.FlexFileStatus = "/FlexWizard/GetAttachmentStatus";
                Constants.FlexFileUpload = "/FlexWizard/UploadAttachment";
                Constants.FlexPostFiles = "/FlexWizard/SubmitAttachments";
                Constants.FlexGetFileCodesData = "/FlexWizard/GetFileCodesData";
                Constants.CarUpdateDetails = "CarUpdateDetails";
                Constants.IsCustomerIdentified = "/FlexWizard/IsCustomerIdentified";
                Constants.FlexLoanList = "FlexLoanList";
                Constants.LoanDetails = "LoanDetails";
                Constants.GetDocFromTemplateDayal = "GetDocFromTemplateDayal";
                Constants.SendLinkSms = "SendLinkSms";
                Constants.FlexCheckPhoneNumber = "FlexCheckPhoneNumber";
                //********************* Digital Issuing ***********************************
                Constants.DigitalIssuingServices = "DigitalIssuingServices";
                Constants.DICustomerCardIssuance11 = "DICustomerCardIssuance11";
                Constants.PutDocIntoIFNArchive = "/DigitalIssuing/PutDocIntoIFNArchive";
                Constants.UploadSingleFileDI = "/DigitalIssuing/UploadSingle";
                Constants.ChatzavGenericMembership = "ChatzavGenericMembership";
                Constants.DeliveryArrange = "DeliveryArrange";
                Constants.GetAdjustedMaximumInterest = "GetAdjustedMaximumInterest";
                Constants.GetCustomerInformation = "GetCustomerInfo";
                Constants.PopulationRegistryCheck = "ValidateRegistration";
                //*************  DigitalIssuing Services Errors - Attendant  *************  //taken from  Customer Recruiting Services Errors - Attendant
                Constants.putDocIntoIFNArchiveAttendant = "putDocIntoIFNArchiveAttendant";
                Constants.UploadIdServiceAttendant = "UploadIdServiceAttendant";
                //*************  DigitalIssuing Services Errors - Customer  *************    //taken from  Customer Recruiting Services Errors - Customer
                //*************  CustomerIdentification                      *************
                Constants.CustomerIdentification = "CustomerIdentification";
                Constants.GetIdentifyAndValidate = "GetIdentifyAndValidate";
                Constants.GetIdentify = "GetIdentify";
                //*******************  CustomerInfoServices  
                Constants.IdentifyCustomer = "IdentifyCustomerService";
                Constants.CustomerInformation = "CustomerInfoService";
                //******************** Opswat ********************************************
                Constants.OpswatFileUpload = "/FileUploads/UploadSingle";
                Constants.OpswatFileStatus = "/FileUploads/GetUploadStatus";
                Constants.OpswatPostFiles = "/FileUploads/SubmitAttachment";
                Constants.OpswatFileConvertBase64 = "/FileUploads/GetScannedFileConverted";
                //******************** Full Disclouser Text ********************************************
                Constants.GetAdjustedMaximumInterestDisclosureData = 'GetAdjustedMaximumInterestDiscloserData';
            })(Constants = DigitalServicesModule.Constants || (DigitalServicesModule.Constants = {}));
        })(DigitalServicesModule = Common.DigitalServicesModule || (Common.DigitalServicesModule = {}));
    })(Common = app.Common || (app.Common = {}));
})(app || (app = {}));
//# sourceMappingURL=DigitalServiceRequests.js.map;
(function () {
    var app = angular.module('app.Common.DigitalServicesModule', []);
})();
/// <reference path="DigitalServiceRequests.ts" />
var app;
(function (app) {
    var Common;
    (function (Common) {
        var DigitalServicesModule;
        (function (DigitalServicesModule) {
            //'use strict';
            //import ServiceConstants = app.Common.DigitalServicesModule.Constants;
            var DigitalServices = (function () {
                function DigitalServices($http, $q, $timeout, $log) {
                    this.$timeout = $timeout;
                    this.spinnerSemaphore = 0;
                    this.httpService = $http;
                    this.qService = $q;
                    this.handlerUrl = app.Common.DigitalServicesModule.Constants.DigitalServicesBase;
                    this.token = Token;
                    servicePort = typeof (servicePort) === "undefined" ? "" : (servicePort || "");
                }
                DigitalServices.prototype.getToken = function () {
                    return this.token;
                };
                DigitalServices.prototype.useGetHandler = function (serviceName, params, isProxy) {
                    var _this = this;
                    if (isProxy === void 0) { isProxy = true; }
                    var serviceFullUrl = this.handlerUrl + serviceName + '&' + app.Common.DigitalServicesModule.Constants.UserGuid;
                    if (params && params != '') {
                        serviceFullUrl = serviceFullUrl + "&" + params;
                    }
                    else if (!isProxy)
                        serviceFullUrl = serviceName;
                    var result = this.httpService.get(serviceFullUrl)
                        .then(function (response) { return _this.handlerResponded(response, params, serviceName, isProxy); });
                    return result;
                };
                /**
                * A Get handler that doesn't use 'handle response'. Is used to chain services. (keep the Promise)
                *
                * @param serviceName Name of service
                * @param data Request content - will be converted to <key> = <value> for the 'get' service.
                * @param isProxy Optional - if false, only the serviceName will be used, without the url of the proxy
                */
                DigitalServices.prototype.useSimpleGetHandler = function (serviceName, data, isProxy) {
                    if (isProxy === void 0) { isProxy = true; }
                    var serviceFullUrl = this.handlerUrl + serviceName;
                    if (data && data != '') {
                        serviceFullUrl = serviceFullUrl + "&" + ObjecttoParams(data);
                    }
                    else if (!isProxy)
                        serviceFullUrl = serviceName;
                    return this.httpService.get(serviceFullUrl);
                };
                /**
                * A Post handler that doesn't use 'handle response'. Is used to chain services. (keep the Promise)
                *
                * @param serviceName Name of service
                * @param data Request content - will be sent as is.
                * @param isProxy Optional - if false, only the serviceName will be used, without the url of the proxy
                */
                DigitalServices.prototype.useSimplePostHandler = function (serviceName, data, isProxy) {
                    if (isProxy === void 0) { isProxy = true; }
                    var serviceFullUrl = this.handlerUrl + serviceName;
                    if (!isProxy)
                        serviceFullUrl = serviceName;
                    if (servicePort && servicePort != '') {
                        //add support for diffrent ports usage.
                        serviceFullUrl = serviceFullUrl + "&servicePort=" + servicePort;
                    }
                    return this.httpService.post(serviceFullUrl, data, {
                        headers: {
                            "content-type": 'application/x-www-form-urlencoded; charset=UTF-8',
                            "__RequestVerificationToken": this.getToken()
                        }
                    });
                };
                /**
                * a Post Handler that use to save at the session the request and response of all the services of the process.
                *
                * @param serviceName Name of service
                * @param data Request content .
                * @param processName -  the process Name.
                * @param processServiceKey - a specail key for all process to save at session.
                * @param isFinalServiceSession Optional - if true  - send the id of Epi Page .
                */
                DigitalServices.prototype.useSimplePostHandlerJsoncontentType = function (serviceName, data, isProxy) {
                    if (isProxy === void 0) { isProxy = true; }
                    var serviceFullUrl = this.handlerUrl + serviceName;
                    if (!isProxy)
                        serviceFullUrl = serviceName;
                    if (servicePort && servicePort != '') {
                        //add support for diffrent ports usage.
                        serviceFullUrl = serviceFullUrl + "&servicePort=" + servicePort;
                    }
                    return this.httpService.post(serviceFullUrl, data, {
                        headers: {
                            "content-type": 'application/json; charset=UTF-8',
                            "__RequestVerificationToken": this.getToken()
                        }
                    });
                };
                DigitalServices.prototype.usePostServiceSessiontHandler = function (serviceName, data, processName, processServiceKey, finalServiceSession, isResendMail) {
                    if (finalServiceSession === void 0) { finalServiceSession = ''; }
                    if (isResendMail === void 0) { isResendMail = "false"; }
                    var serviceFullUrl = this.handlerUrl + processName + "&processServiceName=" + serviceName;
                    if (processServiceKey != '') {
                        serviceFullUrl = serviceFullUrl + "&processServiceKey=" + processServiceKey + (finalServiceSession ? "&finalServiceSession=" + finalServiceSession : '')
                            + (isResendMail ? "&isResendMail=" + isResendMail : '');
                    }
                    if (servicePort && servicePort != '') {
                        //add support for diffrent ports usage.
                        serviceFullUrl = serviceFullUrl + "&servicePort=" + servicePort;
                    }
                    return this.httpService.post(serviceFullUrl, data, {
                        headers: {
                            "content-type": 'application/x-www-form-urlencoded; charset=UTF-8',
                            "__RequestVerificationToken": this.getToken()
                        }
                    });
                };
                /**
                * A Post handler that use to make changes at the server before and after send to service;
                *
                * @param serviceName Name of service
                * @param data Request content -.
                * @param processName -  the process Name.
                * @param ProcessKey - a specail key the used in the server eg: PageId.
                */
                DigitalServices.prototype.usePostProcessServiceHandler = function (serviceName, data, processName, processServiceKey) {
                    var serviceFullUrl = this.handlerUrl + processName + "&processServiceName=" + serviceName;
                    serviceFullUrl = serviceFullUrl + "&processServiceKey=" + processServiceKey;
                    return this.httpService.post(serviceFullUrl, data, {
                        headers: {
                            "content-type": 'application/x-www-form-urlencoded; charset=UTF-8',
                            "__RequestVerificationToken": this.getToken()
                        }
                    });
                };
                DigitalServices.prototype.usePostProcessServiceFileHandler = function (serviceName, data, processName, processServiceKey) {
                    var serviceFullUrl = this.handlerUrl + processName + "&processServiceName=" + serviceName;
                    serviceFullUrl = serviceFullUrl + "&processServiceKey=" + processServiceKey;
                    var getModelAsFormData = function (data) {
                        var dataAsFormData = new FormData();
                        angular.forEach(data, function (value, key) {
                            dataAsFormData.append(key, value);
                        });
                        return dataAsFormData;
                    };
                    var request = {
                        method: 'POST',
                        url: serviceFullUrl,
                        data: getModelAsFormData(data),
                        headers: {
                            'Content-Type': undefined,
                            "__RequestVerificationToken": this.getToken()
                        }
                    };
                    return this.httpService(request);
                };
                /**
           * a Post Handler that use to call a java service but provide a logics in the proxy.
           *
           * @param serviceName Name of extrenalService the class that use logic function before and after call a java service/
           * @param data Request content .
           * @param processName -  the service Name.
           */
                DigitalServices.prototype.usePostExternalServiceHandler = function (serviceName, data, processName) {
                    var serviceFullUrl = this.handlerUrl + processName + "&processServiceName=" + serviceName;
                    if (servicePort && servicePort != '') {
                        //add support for diffrent ports usage.
                        serviceFullUrl = serviceFullUrl + "&servicePort=" + servicePort;
                    }
                    return this.httpService.post(serviceFullUrl, data, {
                        headers: {
                            "content-type": 'application/x-www-form-urlencoded; charset=UTF-8',
                            "__RequestVerificationToken": this.getToken()
                        }
                    });
                };
                DigitalServices.prototype.useTokenPostHandler = function (serviceName, data, isProxy) {
                    if (isProxy === void 0) { isProxy = true; }
                    var serviceFullUrl = this.handlerUrl + serviceName;
                    if (!isProxy) {
                        serviceFullUrl = serviceName;
                    }
                    if (servicePort && servicePort != '') {
                        //add support for diffrent ports usage.
                        serviceFullUrl = serviceFullUrl + "&servicePort=" + servicePort;
                    }
                    return this.httpService.post(serviceFullUrl, data, {
                        headers: {
                            "content-type": 'application/x-www-form-urlencoded; charset=UTF-8',
                            "__RequestVerificationToken": this.getToken()
                        }
                    });
                };
                //for all the process that save the data at server side . 
                /**
                * A Post handler that save the services response of process.
                *
                * @param serviceName Name of service
                * @param data Request content - will be converted to <key> = <value> for the 'get' service.
                * @param processName -  the process Name.
                * @param processServiceKey - a specail key for all process to save at session.
                * @param isFinalServiceSession Optional - if true  - send the id of Epi Page .
                */
                DigitalServices.prototype.useGetServiceSessiontHandlerUnAuthenticated = function (serviceName, params, processName, processServiceKey, finalServiceSession, bSendGuid) {
                    var _this = this;
                    if (processServiceKey === void 0) { processServiceKey = ''; }
                    if (finalServiceSession === void 0) { finalServiceSession = ''; }
                    if (bSendGuid === void 0) { bSendGuid = true; }
                    var serviceFullUrl = this.handlerUrl + processName + (bSendGuid ? '&' + app.Common.DigitalServicesModule.Constants.UserGuid : '') + "&processServiceName=" + serviceName;
                    if (processServiceKey != '') {
                        serviceFullUrl = serviceFullUrl + "&processServiceKey=" + processServiceKey + (finalServiceSession ? "&finalServiceSession=" + finalServiceSession : '');
                    }
                    if (params && params != '') {
                        serviceFullUrl = serviceFullUrl + "&" + params;
                    }
                    if (servicePort && servicePort != '') {
                        //add support for diffrent ports usage.
                        serviceFullUrl = serviceFullUrl + "&servicePort=" + servicePort;
                    }
                    var result = this.httpService.get(serviceFullUrl, { headers: { "content-type": 'application/x-www-form-urlencoded; charset=UTF-8' } })
                        .then(function (response) { return _this.handlerResponded(response, params, serviceName, false); });
                    return result;
                };
                /**
                * @param bSendGuid bSendGuid? Default is True.
                */
                DigitalServices.prototype.useGetHandlerUnAuthenticated = function (serviceName, params, bSendGuid) {
                    var _this = this;
                    if (bSendGuid === void 0) { bSendGuid = true; }
                    var serviceFullUrl = this.handlerUrl + serviceName + (bSendGuid ? '&' + app.Common.DigitalServicesModule.Constants.UserGuid : '');
                    if (params && params != '') {
                        serviceFullUrl = serviceFullUrl + "&" + params;
                    }
                    if (servicePort && servicePort != '') {
                        //add support for diffrent ports usage.
                        serviceFullUrl = serviceFullUrl + "&servicePort=" + servicePort;
                    }
                    var result = this.httpService.get(serviceFullUrl, { headers: { "content-type": 'application/x-www-form-urlencoded; charset=UTF-8' } })
                        .then(function (response) { return _this.handlerResponded(response, params, serviceName, false); });
                    return result;
                };
                DigitalServices.prototype.usePostHandler = function (serviceName, params, isProxy) {
                    var _this = this;
                    if (isProxy === void 0) { isProxy = true; }
                    var serviceFullUrl = this.handlerUrl + serviceName; // + '&' + app.Common.DigitalServicesModule.Constants.UserGuid
                    if (serviceName == 'ValidateIdData') {
                        serviceFullUrl = '/statics/jsonSamples/ValidateIdData.json';
                    }
                    if (!isProxy)
                        serviceFullUrl = serviceName;
                    var requestConfig = {
                        headers: {
                            "__RequestVerificationToken": this.getToken()
                        }
                    };
                    var result = this.httpService.post(serviceFullUrl, params, requestConfig)
                        .then(function (response) { return _this.handlerResponded(response, params, serviceName, isProxy); });
                    return result;
                };
                DigitalServices.prototype.usePostHandlerExternal = function (serviceUrl, params) {
                    var _this = this;
                    var requestConfig = {
                        headers: {
                            'Content-Type': 'application/json',
                            "__RequestVerificationToken": this.getToken()
                        }
                    };
                    var result = this.httpService.post(serviceUrl, params, requestConfig)
                        .then(function (response) { return _this.handlerResponded(response, params, serviceUrl, false); });
                    return result;
                };
                DigitalServices.prototype.useGetHandlerExternal = function (serviceUrl, params) {
                    var _this = this;
                    //var cfg: ng.IRequestShortcutConfig = {
                    //    headers:
                    //    {
                    //        'Content-Type': 'application/json; charset=utf-8',
                    //        'Accept-Encoding': 'gzip, deflate, sdch',
                    //        'Accept-Language:': 'en-US,en;q=0.8'
                    //    }
                    //};
                    var result = this.httpService.get(serviceUrl + '?' + params)
                        .then(function (response) { return _this.handlerResponded(response, params, serviceUrl, false); });
                    return result;
                };
                DigitalServices.prototype.useGetHandlerExternalBuCurrentUrl = function (serviceUrl, params) {
                    var _this = this;
                    //var cfg: ng.IRequestShortcutConfig = {
                    //    headers:
                    //    {
                    //        'Content-Type': 'application/json; charset=utf-8',
                    //        'Accept-Encoding': 'gzip, deflate, sdch',
                    //        'Accept-Language:': 'en-US,en;q=0.8'
                    //    }
                    //};
                    if ((window.location.href).charAt(window.location.href.length - 1) != '/') {
                        serviceUrl = "/" + serviceUrl;
                    }
                    var result = this.httpService.get(window.location.href + serviceUrl + '?' + params)
                        .then(function (response) { return _this.handlerResponded(response, params, serviceUrl, false); });
                    return result;
                };
                DigitalServices.prototype.useCrossDomainGet = function (serviceUrl, params) {
                    var _this = this;
                    var result = this.httpService.jsonp(serviceUrl + "?callback=JSON_CALLBACK")
                        .then(function (response) { return _this.handlerResponded(response, params, serviceUrl, false); });
                    return result;
                };
                DigitalServices.prototype.handlerResponded = function (response, params, serviceName, isPerformCheck) {
                    if (isPerformCheck === void 0) { isPerformCheck = true; }
                    try {
                        if (isPerformCheck) {
                            if (response.data["Header"]["Status"] != "-2")
                                //If user not logged in (-2) - handle here
                                return response.data;
                            else {
                                //check if not logged in EPI
                                if (IsEpiEditMode == false) {
                                    //window.location.hostname + window.location.pathname (instead of window.location.href)
                                    window.location.href = ("/PersonalArea/LogOff?returnUrl=" + window.location.hostname + window.location.pathname);
                                }
                                return response.data["Header"]["Status"];
                            }
                        }
                        else {
                            return response.data;
                        }
                    }
                    catch (err) {
                        console.log("Something went wrong with " + serviceName + ": " + err.message);
                    }
                };
                //useGetHandlerInternal(serviceUrl: string, params: any): ng.IPromise<any> {
                //}
                //for all the process that save the data at server side . 
                /**
                * A Post handler use captchagoogle on server side
                *
                * @param serviceName Name of service
                * @param data Request content - will be converted to <key> = <value> for the 'get' service.
                * @param processName -  the process Name.
                * @param processServiceKey - a specail key for all process to save at session.
                * @param isFinalServiceSession Optional - if true  - send the id of Epi Page .
                */
                DigitalServices.prototype.useGoogleCaptchaValidatePostHandler = function (serviceName, data, captchaKey) {
                    var serviceFullUrl = this.handlerUrl + "ValidateGoogleCaptchaService" + "&serviceName=" + serviceName;
                    if (servicePort && servicePort != '') {
                        //add support for diffrent ports usage.
                        serviceFullUrl = serviceFullUrl + "&servicePort=" + servicePort;
                    }
                    return this.httpService.post(serviceFullUrl, data, {
                        headers: {
                            "content-type": 'application/x-www-form-urlencoded; charset=UTF-8',
                            "__RequestVerificationToken": this.getToken()
                        }
                    });
                };
                DigitalServices.prototype.getAdjustedMaximumInterestDiscloserData = function (isFlex) {
                    if (isFlex === void 0) { isFlex = false; }
                    var serviceFullUrl = '/services/ProxyRequestHandler.ashx?reqName=GetAdjustedMaximumInterestDiscloserData';
                    var config = {
                        headers: {
                            "content-type": 'application/x-www-form-urlencoded; charset=UTF-8'
                        }
                    };
                    return this.httpService.post(serviceFullUrl, {}, config);
                };
                DigitalServices.prototype.getAdjustedMaximumInterest = function (isFlex) {
                    if (isFlex === void 0) { isFlex = false; }
                    var serviceFullUrl = '/services/ProxyRequestHandler.ashx?reqName=GetAdjustedMaximumInterest';
                    var config = {
                        headers: {
                            "content-type": 'application/x-www-form-urlencoded; charset=UTF-8'
                        }
                    };
                    return this.httpService.post(serviceFullUrl, {}, config);
                };
                DigitalServices.prototype.startWhatsappConversation = function (whatsappServiceRequest) {
                    var serviceFullUrl = '/services/ProxyRequestHandler.ashx?reqName=StartWhatsappConversationService';
                    var config = {
                        headers: {
                            "content-type": 'application/x-www-form-urlencoded; charset=UTF-8'
                        }
                    };
                    return this.httpService.post(serviceFullUrl, whatsappServiceRequest, config);
                };
                return DigitalServices;
            }());
            DigitalServices.$inject = ["$http", "$q", "$timeout", "$log"];
            DigitalServicesModule.DigitalServices = DigitalServices;
        })(DigitalServicesModule = Common.DigitalServicesModule || (Common.DigitalServicesModule = {}));
    })(Common = app.Common || (app.Common = {}));
})(app || (app = {}));
angular.module('app.Common.DigitalServicesModule', []).service('app.Common.DigitalServicesModule.DigitalServices', app.Common.DigitalServicesModule.DigitalServices);
//# sourceMappingURL=DigitalServices.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var app;
(function (app) {
    var Common;
    (function (Common) {
        var Features;
        (function (Features) {
            var Classes;
            (function (Classes) {
                var CreditCardListResponse = (function () {
                    function CreditCardListResponse() {
                        var _this = this;
                        this.imageSiteUrl = imageSiteUrl || "";
                        this.copyObj = function (json) {
                            var response = new CreditCardListResponse();
                            response.ActiveCards = _this.getCardInfo(json["Table1"]);
                            response.InactiveCards = _this.getCardInfo(json["Table2"]);
                            response.AllCards = _this.joinCardGroups(json["Table1"], json["Table2"]);
                            response.AllCardsT3 = _this.joinCardGroupsT3(json["Table1"], json["Table2"], json["Table3"]);
                            response.DigitalCards = _this.getCardInfo(json["Table3"]);
                            return response;
                        };
                        this.convertToCardViewModel = function (singleCardJson, index, isActive, isDigital) {
                            var card = new CreditCardsList("");
                            card.cardNumber = singleCardJson["cardNumber"];
                            card.cardName = singleCardJson["cardName"];
                            card.serviceType = singleCardJson["serviceType"];
                            card.userName = singleCardJson["userName"];
                            card.holderId = singleCardJson["holderId"] || "none";
                            card.logoSmallUrl = _this.imageSiteUrl + singleCardJson["logoSmallUrl"];
                            card.logoBigUrl = _this.imageSiteUrl + singleCardJson["logoBigUrl"];
                            card.expirationDate = singleCardJson["expirationDate"];
                            card.paymentDate = singleCardJson["paymentDate"];
                            card.bankId = singleCardJson["bankId"];
                            card.bankBranchId = singleCardJson["bankBranchId"];
                            card.bankAccountId = singleCardJson["bankAccountId"];
                            card.cardIndex = singleCardJson["cardIndex"];
                            card.club1 = singleCardJson["club1"];
                            card.isActive = isActive;
                            card.isDigital = isDigital;
                            card.kod_kartis_im_sodi = singleCardJson["kodKartisImSodi"];
                            card.kodIshurBenleumi = singleCardJson["kodIshurBenleumi"];
                            card.cardHolders = new Array();
                            card.cardSumTotal = new CardSumTotal("", "", "", "", "", false);
                            card.creditLineType = singleCardJson["creditLineType"];
                            return card;
                        };
                        this.checkIfFakeCard = function (json) {
                            if (json.cardNumber && json.cardNumber != '')
                                return false;
                            return true;
                        };
                        this.getCardInfo = function (json) {
                            var cards = new Array();
                            if (json != null) {
                                for (var i = 0; i <= json.length - 1; i++) {
                                    if (!_this.checkIfFakeCard(json[i])) {
                                        cards.push(_this.convertToCardViewModel(json[i], i, true, true));
                                    }
                                }
                            }
                            return cards;
                        };
                        this.joinCardGroups = function (json1, json2) {
                            var cards = new Array();
                            var activeCount = 0;
                            var fakeCount = 0; // fake count is to take into count the Table1 cards that are empty if it is empty;
                            if (json1 != null) {
                                for (var i = 0; i <= json1.length - 1; i++) {
                                    if (!_this.checkIfFakeCard(json1[i])) {
                                        cards.push(_this.convertToCardViewModel(json1[i], i, true, false));
                                    }
                                    else {
                                        fakeCount++;
                                    }
                                }
                                activeCount = json1.length - fakeCount;
                            }
                            if (json2 != null) {
                                for (var i = 0; i <= json2.length - 1; i++) {
                                    if (!_this.checkIfFakeCard(json2[i])) {
                                        cards.push(_this.convertToCardViewModel(json2[i], activeCount + i, false, false));
                                    }
                                }
                            }
                            return cards;
                        };
                        this.joinCardGroupsT3 = function (json1, json2, json3) {
                            var cards = new Array();
                            var activeCount = 0;
                            var fakeCount = 0; // fake count is to take into count the Table1 cards that are empty if it is empty;
                            if (json1 != null) {
                                for (var i = 0; i <= json1.length - 1; i++) {
                                    if (!_this.checkIfFakeCard(json1[i])) {
                                        cards.push(_this.convertToCardViewModel(json1[i], i, true, false));
                                    }
                                    else {
                                        fakeCount++;
                                    }
                                }
                                activeCount = json1.length - fakeCount;
                            }
                            if (json2 != null) {
                                for (var i = 0; i <= json2.length - 1; i++) {
                                    if (!_this.checkIfFakeCard(json2[i])) {
                                        cards.push(_this.convertToCardViewModel(json2[i], activeCount + i, false, false));
                                    }
                                }
                            }
                            if (json3 != null) {
                                for (var i = 0; i <= json3.length - 1; i++) {
                                    if (!_this.checkIfFakeCard(json3[i])) {
                                        cards.push(_this.convertToCardViewModel(json3[i], i, true, true));
                                    }
                                    else {
                                        fakeCount++;
                                    }
                                }
                                activeCount = json3.length - fakeCount;
                            }
                            return cards;
                        };
                        this.imageSiteUrl = imageSiteUrl;
                    }
                    return CreditCardListResponse;
                }());
                Classes.CreditCardListResponse = CreditCardListResponse;
                var CreditCardsList = (function () {
                    function CreditCardsList(cardName) {
                        if (cardName === void 0) { cardName = ""; }
                        var _this = this;
                        this.displayName = function () {
                            var text = (_this.cardNumber != "") ? _this.cardName + " - " + _this.cardNumber : _this.cardName;
                            return text;
                        };
                        this.cardName = cardName;
                        this.cardNumber = "";
                        this.cardSumTotal = new CardSumTotal("", "", "", "", "", false);
                    }
                    return CreditCardsList;
                }());
                Classes.CreditCardsList = CreditCardsList;
                var GroupedCardList = (function () {
                    function GroupedCardList(name, id, bank) {
                        if (name === void 0) { name = ""; }
                        if (id === void 0) { id = ""; }
                        if (bank === void 0) { bank = ""; }
                        this.userName = name;
                        this.holderId = id;
                        this.bankAccount = bank;
                        this.cardIndexes = new Array();
                        //new dashboard
                        //bankAccountIds = new Array<string>();
                    }
                    return GroupedCardList;
                }());
                Classes.GroupedCardList = GroupedCardList;
                var GraphValue = (function () {
                    function GraphValue() {
                    }
                    return GraphValue;
                }());
                Classes.GraphValue = GraphValue;
                var CardsEnrichmentRequest = (function () {
                    function CardsEnrichmentRequest() {
                    }
                    return CardsEnrichmentRequest;
                }());
                Classes.CardsEnrichmentRequest = CardsEnrichmentRequest;
                var SendSmtpMailRequest = (function () {
                    function SendSmtpMailRequest() {
                        this.from = "";
                        this.fromName = "";
                        this.to = "";
                        this.toName = "";
                        this.subject = "";
                        this.bodyHTML = true;
                        this.text = "";
                        this.cc = "";
                        this.bcc = "";
                        this.replyTo = "";
                    }
                    return SendSmtpMailRequest;
                }());
                Classes.SendSmtpMailRequest = SendSmtpMailRequest;
                var CallBackRequest = (function () {
                    function CallBackRequest() {
                    }
                    return CallBackRequest;
                }());
                Classes.CallBackRequest = CallBackRequest;
                var InsuranceConsentDataRequest = (function () {
                    function InsuranceConsentDataRequest() {
                    }
                    return InsuranceConsentDataRequest;
                }());
                Classes.InsuranceConsentDataRequest = InsuranceConsentDataRequest;
                //Digital Customer
                var getAccountBirthDetailsRequest = (function () {
                    function getAccountBirthDetailsRequest() {
                    }
                    return getAccountBirthDetailsRequest;
                }());
                Classes.getAccountBirthDetailsRequest = getAccountBirthDetailsRequest;
                var getAccountBirthDetailsResponse = (function () {
                    function getAccountBirthDetailsResponse() {
                    }
                    return getAccountBirthDetailsResponse;
                }());
                Classes.getAccountBirthDetailsResponse = getAccountBirthDetailsResponse;
                var CustomerContactDetailsRequest = (function () {
                    function CustomerContactDetailsRequest() {
                    }
                    return CustomerContactDetailsRequest;
                }());
                Classes.CustomerContactDetailsRequest = CustomerContactDetailsRequest;
                var CustomerContactDetailsResponse = (function () {
                    function CustomerContactDetailsResponse() {
                    }
                    return CustomerContactDetailsResponse;
                }());
                Classes.CustomerContactDetailsResponse = CustomerContactDetailsResponse;
                var ClientOnlineBankingRequest = (function () {
                    function ClientOnlineBankingRequest() {
                    }
                    return ClientOnlineBankingRequest;
                }());
                Classes.ClientOnlineBankingRequest = ClientOnlineBankingRequest;
                var ClientOnlineBankingResponse = (function () {
                    function ClientOnlineBankingResponse() {
                    }
                    return ClientOnlineBankingResponse;
                }());
                Classes.ClientOnlineBankingResponse = ClientOnlineBankingResponse;
                //new dashboard month
                var CardSumTotal = (function () {
                    function CardSumTotal(sumSekel, sumDollar, sumEuro, billingDate, cardtype, isactive) {
                        this.SumSekel = sumSekel;
                        this.SumDollar = sumDollar;
                        this.SumEuro = sumEuro;
                        this.BillingDate = billingDate;
                        this.cardType = cardtype;
                        this.isActive = isactive;
                    }
                    return CardSumTotal;
                }());
                Classes.CardSumTotal = CardSumTotal;
                var GoogleRecaptchaDetails = (function () {
                    function GoogleRecaptchaDetails() {
                        var _this = this;
                        this.onCreate = function (widgetId) {
                            _this.widgetId = widgetId;
                        };
                    }
                    return GoogleRecaptchaDetails;
                }());
                Classes.GoogleRecaptchaDetails = GoogleRecaptchaDetails;
                var ProductListOutput = (function () {
                    function ProductListOutput() {
                    }
                    return ProductListOutput;
                }());
                Classes.ProductListOutput = ProductListOutput;
                var ProductListInput = (function () {
                    function ProductListInput() {
                    }
                    return ProductListInput;
                }());
                Classes.ProductListInput = ProductListInput;
                var MfCreditPoolReqGetRequest = (function () {
                    function MfCreditPoolReqGetRequest(actionCode, listInputCount, joinChannelType, productListInput) {
                        if (actionCode === void 0) { actionCode = "1"; }
                        if (listInputCount === void 0) { listInputCount = "1"; }
                        if (joinChannelType === void 0) { joinChannelType = "1"; }
                        if (productListInput === void 0) { productListInput = []; }
                        this.actionCode = actionCode;
                        this.listInputCount = listInputCount;
                        this.joinChannelType = joinChannelType;
                        this.productListInput = productListInput;
                    }
                    return MfCreditPoolReqGetRequest;
                }());
                Classes.MfCreditPoolReqGetRequest = MfCreditPoolReqGetRequest;
                var MfCreditPoolReqAlwaysGetRequest = (function (_super) {
                    __extends(MfCreditPoolReqAlwaysGetRequest, _super);
                    function MfCreditPoolReqAlwaysGetRequest(actionCode) {
                        if (actionCode === void 0) { actionCode = "4"; }
                        return _super.call(this, actionCode) || this;
                    }
                    return MfCreditPoolReqAlwaysGetRequest;
                }(MfCreditPoolReqGetRequest));
                Classes.MfCreditPoolReqAlwaysGetRequest = MfCreditPoolReqAlwaysGetRequest;
                var MfCreditPoolReqReadOnlyGetRequest = (function (_super) {
                    __extends(MfCreditPoolReqReadOnlyGetRequest, _super);
                    function MfCreditPoolReqReadOnlyGetRequest(actionCode) {
                        if (actionCode === void 0) { actionCode = "3"; }
                        return _super.call(this, actionCode) || this;
                    }
                    return MfCreditPoolReqReadOnlyGetRequest;
                }(MfCreditPoolReqGetRequest));
                Classes.MfCreditPoolReqReadOnlyGetRequest = MfCreditPoolReqReadOnlyGetRequest;
                var MfCreditPoolReqSetRequest = (function () {
                    function MfCreditPoolReqSetRequest(response) {
                        this.actionCode = "2";
                        this.joinChannelType = "1";
                        this.userId = "x0t";
                        this.listInputCount = "1";
                        this.idCode = response.idCode;
                        this.countryCode = response.countryCode;
                        this.productListInput = response.ProductListOutput;
                    }
                    return MfCreditPoolReqSetRequest;
                }());
                Classes.MfCreditPoolReqSetRequest = MfCreditPoolReqSetRequest;
                var MfCreditPoolReqGetResponse = (function () {
                    function MfCreditPoolReqGetResponse() {
                    }
                    return MfCreditPoolReqGetResponse;
                }());
                Classes.MfCreditPoolReqGetResponse = MfCreditPoolReqGetResponse;
            })(Classes = Features.Classes || (Features.Classes = {}));
        })(Features = Common.Features || (Common.Features = {}));
    })(Common = app.Common || (app.Common = {}));
})(app || (app = {}));
//# sourceMappingURL=Classes.js.map;
(function () {
    var app = angular.module('app.Common.FeaturesModule', ['app.Common.DigitalServicesModule']);
})();
/// <reference path="../DigitalServices/DigitalServiceRequests.ts" />
var app;
(function (app) {
    var Common;
    (function (Common) {
        var FeaturesModule;
        (function (FeaturesModule) {
            'use strict';
            // import CreditCardListResponse = app.Common.Features.Classes.CreditCardListResponse;
            //  import ServiceConstants = app.Common.DigitalServicesModule.Constants;
            var FeatureServices = (function () {
                function FeatureServices(digitalServices, returnCodesService) {
                    var _this = this;
                    this.digitalServices = digitalServices;
                    this.returnCodesService = returnCodesService;
                    this.getCreditCards = function () {
                        //return this.digitalServices.useGetHandler(ServiceConstants.CardsList_102Digital, "");
                        if (_this.storedResults) {
                            return _this.storedResults;
                        }
                        else {
                            _this.storedResults = _this.digitalServices.useGetHandler(app.Common.DigitalServicesModule.Constants.CardsList_102Digital, "");
                            return _this.storedResults;
                        }
                        //return this.digitalServices.useGetHandler(ServiceConstants.CardsList_102, "");
                    };
                    this.getCards = function (dataRequest) {
                        return (_this.digitalServices.useGetHandler("GetCardsListForRepayment", ObjecttoParams(dataRequest)));
                    };
                    this.getCardMoreInfo = function (dataRequest) {
                        return _this.digitalServices.useGetHandler(app.Common.DigitalServicesModule.Constants.CardInfoEnrichment, ObjecttoParams(dataRequest));
                    };
                    this.ValidateCaptcha = function (captchaId, captchaInstanceId, userInput) {
                        return _this.digitalServices.useGetHandlerExternal(app.Common.DigitalServicesModule.Constants.ValidateCaptchaUrl, "captchaId=" + captchaId + "&instanceId=" + captchaInstanceId + "&userInput=" + userInput);
                    };
                    this.ValidateGoogleRecaptcha = function (recaptchaResponse) {
                        return _this.digitalServices.useGetHandlerExternal(app.Common.DigitalServicesModule.Constants.ValidateGoogleRecaptchaUrl, "recaptchaResponse=" + recaptchaResponse);
                    };
                    this.sendSmtpMail = function (dataRequest) {
                        return _this.digitalServices.useSimplePostHandler(app.Common.DigitalServicesModule.Constants.sendSmtpMail, ObjecttoParams(dataRequest));
                        // usePostHandler
                    };
                    this.CallBackAddReqest = function (data) {
                        return _this.digitalServices.useSimpleGetHandler(app.Common.DigitalServicesModule.Constants.CallBackAddRequest, data);
                    };
                    this.SendSmtpMailByProcess = function (dataRequest, Id, serviceProcessName, isObjectToParams, isFileAttached) {
                        if (isObjectToParams === void 0) { isObjectToParams = true; }
                        if (isFileAttached === void 0) { isFileAttached = false; }
                        if (isObjectToParams) {
                            return _this.digitalServices.usePostProcessServiceHandler(app.Common.DigitalServicesModule.Constants.sendSmtpMail, ObjecttoParams(dataRequest), serviceProcessName, Id);
                        }
                        else {
                            if (!isFileAttached) {
                                return _this.digitalServices.usePostProcessServiceHandler(app.Common.DigitalServicesModule.Constants.sendSmtpMail, dataRequest, serviceProcessName, Id);
                            }
                            else {
                                return _this.digitalServices.usePostProcessServiceFileHandler(app.Common.DigitalServicesModule.Constants.sendSmtpMail, dataRequest, serviceProcessName, Id);
                            }
                        }
                    };
                    this.getReturnCodeMessage = function (serviceName, returnCode) {
                        _this.messageRequest.serviceName = serviceName;
                        _this.messageRequest.returnCode = returnCode;
                        return _this.returnCodesService.getMessage(_this.messageRequest).then(function (response) {
                            var message = response["message"];
                            if (message != null && message != "") {
                                return message;
                            }
                            else {
                                return _this.defaultServiceError;
                            }
                        });
                    };
                    this.GetInsuranceConsentData = function () {
                        var serviceFullUrl = '/services/ProxyRequestHandler.ashx?reqName=' + app.Common.DigitalServicesModule.Constants.GetCustomerIsurentsConsent;
                        return _this.digitalServices.usePostHandlerExternal(serviceFullUrl, "");
                    };
                    this.UpdateCardList = function () {
                        return _this.digitalServices.useGetHandler(app.Common.DigitalServicesModule.Constants.CardsList_102Digital, "sessionOp=CLEARSESSION");
                    };
                    this.OpswatFileUpload = function (data) {
                        return _this.digitalServices.usePostProcessServiceFileHandler("", data, app.Common.DigitalServicesModule.Constants.OpswatFileUpload, "");
                    };
                    this.ValidateRecaptcha = function (captchaResponse) {
                        var queryParams = "captchaResponse=" + captchaResponse;
                        var response = _this.digitalServices.useGetHandlerExternal(app.Common.DigitalServicesModule.Constants.ValidateRecaptcha, queryParams);
                        return response;
                    };
                    this.mfCreditPoolReqGet = function (queryParams) {
                        return _this.digitalServices.useGetHandler(app.Common.DigitalServicesModule.Constants.MfCreditPoolReq, ObjecttoParams(queryParams));
                    };
                    this.mfCreditPoolReqSet = function (queryParams) {
                        return _this.digitalServices.useSimplePostHandler(app.Common.DigitalServicesModule.Constants.MfCreditPoolReq, queryParams);
                    };
                    this.pushGaCode = function (eventsPairs) {
                        PushGACode(eventsPairs);
                    };
                    this.PushGaCodeForLogin = function (eventName, messageName, messageText) {
                        var permStatus = window["permStatus"];
                        var isGuidLogin = ((permStatus || {})["PermissionStatusBean"] || {})["returnCode"] === "0";
                        var payload = isGuidLogin
                            ? { "event": eventName, 'ProcessName': permStatus["PermissionStatusBean"].permissionLevel }
                            : { "event": eventName };
                        if (messageName && messageText) {
                            payload[messageName] = messageText;
                        }
                        PushGACode(payload);
                    };
                }
                return FeatureServices;
            }());
            FeatureServices.$inject = ["app.Common.DigitalServicesModule.DigitalServices", "app.Common.ReturnCodesModule.Service"];
            FeaturesModule.FeatureServices = FeatureServices;
            angular.module('app.Common.FeaturesModule').service('app.Common.FeaturesModule.FeatureServices', ["app.Common.DigitalServicesModule.DigitalServices", app.Common.FeaturesModule.FeatureServices]);
        })(FeaturesModule = Common.FeaturesModule || (Common.FeaturesModule = {}));
    })(Common = app.Common || (app.Common = {}));
})(app || (app = {}));
//# sourceMappingURL=services.js.map;
/// <reference path="../../../../Scripts/typings/ng-idle/angular-idle.d.ts" />
(function () {
    var personalAreaApp = angular
        .module('app.PersonalArea.Header', ['app.Common.DigitalServicesModule']);
    angular.element(document.getElementById("header-app")).ready(function () {
        angular.bootstrap(document.getElementById("header-app"), ['app.PersonalArea.Header']);
    });
})();
//# sourceMappingURL=app.module.js.map;
/// <reference path="../../Common/DigitalServices/DigitalServices.ts" />
/// <reference path="../../Common/DigitalServices/DigitalServiceRequests.ts" />
var app;
(function (app) {
    var PersonalArea;
    (function (PersonalArea) {
        var Header;
        (function (Header) {
            var Service = (function () {
                function Service(digitalServices) {
                    var _this = this;
                    this.digitalServices = digitalServices;
                    this.GetMemberPeriod = function () {
                        var queryParams = { isCustomerTypeCorporate: false };
                        return _this.digitalServices.useSimpleGetHandler(app.Common.DigitalServicesModule.Constants.ShowCustomerData_101, queryParams);
                    };
                }
                return Service;
            }());
            Service.$inject = ["app.Common.DigitalServicesModule.DigitalServices"];
            Header.Service = Service;
            angular.module('app.PersonalArea.Header').service('app.PersonalArea.Header.Service', Service);
        })(Header = PersonalArea.Header || (PersonalArea.Header = {}));
    })(PersonalArea = app.PersonalArea || (app.PersonalArea = {}));
})(app || (app = {}));
//# sourceMappingURL=Service.js.map;
var app;
(function (app) {
    var PersonalArea;
    (function (PersonalArea) {
        var Header;
        (function (Header) {
            var Controller = (function () {
                function Controller(periodService) {
                    var _this = this;
                    this.periodService = periodService;
                    this.GetMemberPeriod = function () {
                        try {
                            _this.periodService.GetMemberPeriod().then(function (response) {
                                _this.memberSince = response.data.ShowCustomerData_101Bean.joinDate.split('/')[2];
                            });
                        }
                        catch (ex) {
                            console.log(ex);
                            _this.memberSince = "";
                        }
                    };
                    this.memberSince = "";
                    this.GetMemberPeriod();
                }
                return Controller;
            }());
            Controller.$inject = ["app.PersonalArea.Header.Service"];
            Header.Controller = Controller;
            angular.module('app.PersonalArea.Header').controller('app.PersonalArea.Header.Controller', Controller);
        })(Header = PersonalArea.Header || (PersonalArea.Header = {}));
    })(PersonalArea = app.PersonalArea || (app.PersonalArea = {}));
})(app || (app = {}));
//# sourceMappingURL=Controller.js.map;
(function () {
    angular.module('app.digitalCustomerLoginModule', ['ui.bootstrap', 'ngSanitize', 'app.Common.validations.UniValidationModule', 'ngMessages', 'app.Common.DigitalServicesModule', 'app.Common.FeaturesModule']);
    angular.element(document.getElementById("DigitalCustomerLoginModule")).ready(function () {
        angular.bootstrap(document.getElementById("DigitalCustomerLoginModule"), ['app.digitalCustomerLoginModule']);
    });
    angular.element(document.getElementById("approvalGatheringModule")).ready(function () {
        angular.bootstrap(document.getElementById("approvalGatheringModule"), ["app.digitalCustomerLoginModule"]);
    });
})();
//# sourceMappingURL=app.module.js.map;
var DigitalCustomerLoginModule;
(function (DigitalCustomerLoginModule) {
    var Controller = (function () {
        function Controller(services, $sce, $rootScope, featuresService) {
            var _this = this;
            this.services = services;
            this.$sce = $sce;
            this.$rootScope = $rootScope;
            this.featuresService = featuresService;
            ///DebitPopUp
            this.isShowingDebitPopUp = false;
            //masking
            this.hasPhoneBodyChanged = false;
            this.hasEmailChanged = false;
            this.processPhoneBody = function () {
                if (_this.step1Data.prefix + '-' + _this.step1Data.phoneBody !== _this.customerContactDetailsSelectResponse.maskedCellPhone) {
                    _this.hasPhoneBodyChanged = true;
                }
            };
            this.processMail = function () {
                if (_this.step1Data.email !== _this.customerContactDetailsSelectResponse.maskedMail) {
                    _this.hasEmailChanged = true;
                }
            };
            this.selectRelevantPopup = function () {
                //call 102Digital
                var allCreditCards = _this.featuresService.getCreditCards().then(function (results) {
                    try {
                        var data = results[app.Common.DigitalServicesModule.Constants.CardsList_102Digital.toBean()];
                        if (data.showPopupCollectionIndicator == 'true') {
                            _this.isShowingDebitPopUp = true;
                        }
                        else {
                            _this.isShowingDebitPopUp = false;
                            _this.loadingDigitalCustomerPopup();
                        }
                    }
                    catch (e) {
                        _this.isShowingDebitPopUp = false;
                        console.log(e);
                    }
                });
            };
            //// showDebitingPopup
            this.getCardIdx = function () {
                if (document.getElementById("insuranceModal") != null) {
                    var that = _this;
                    (function detectInsuranceModal() {
                        if (document.getElementById("insuranceModal") != null) {
                            console.log("insuranceModal");
                            window.setTimeout(detectInsuranceModal, 1 * 1000);
                        }
                        else {
                            console.log("close insurance Modal");
                            that.selectRelevantPopup();
                        }
                    }).call(_this);
                }
                else {
                    _this.selectRelevantPopup();
                }
            };
            this.getAllData = function (data) {
                try {
                    var parsedData = [];
                    parsedData = JSON.parse(data);
                    if (parsedData == null) {
                        _this.isServiceError = true;
                    }
                    else {
                        _this.epiData = parsedData[0];
                        _this.phonePrefixes = parsedData[1];
                        _this.translations = parsedData[2];
                        _this.currSite = parsedData[3];
                        if (_this.epiData != null && _this.phonePrefixes != null && _this.translations != null && _this.currSite != null) {
                            _this.isServiceError = false;
                        }
                        else {
                            _this.isServiceError = true;
                        }
                    }
                }
                catch (ex) {
                    _this.isServiceError = true;
                }
            };
            this.loadHtml = function () {
                //Load Html if there are no service errors
                if (_this.isServiceError) {
                    _this.isDisplayWizard = false;
                }
                else {
                    _this.isDisplayWizard = true;
                    PushGACode({
                        'PersonalZoneUpdateDetailsStep1Proc': _this.isOtpLogged ? 'otp' : 'Permanent password',
                        'event': 'PersonalZoneUpdateDetailsStep1'
                    });
                }
            };
            //hanle the checkbox of Mail/Ivr/Sms
            this.handleBankingAction = function (isActionOn) {
                _this.hasPopupBeenTouched = true;
                if (!isActionOn) {
                    _this.bankingAction = false;
                    _this.dualCompany = false;
                }
                if (_this.updateMailIndicator && _this.updateIvrIndicator && _this.updateCellularIndicator) {
                    _this.bankingAction = true;
                    _this.dualCompany = true;
                }
            };
            this.submitStep1 = function () {
                if (!_this.ErrorStep1) {
                    if (_this.isLoading == true)
                        return;
                    _this.isLoading = true;
                    if (!_this.step1Data.email && !_this.isEmptyStep1) {
                        _this.isEmptyStep1 = true;
                        _this.isLoading = false;
                        return;
                    }
                    _this.isEmptyStep1 = false;
                    _this.CustomerContactDetailsUpdateStep1().then(function (ContactDetailsReponse) {
                        _this.customerContactDetailsUpdateResponse = ContactDetailsReponse.data[app.Common.DigitalServicesModule.Constants.ContanctDetails.toBean()];
                        if (ContactDetailsReponse.data.Header.Status == "1" && _this.customerContactDetailsUpdateResponse && _this.customerContactDetailsUpdateResponse.returnCode == '0') {
                            _this.ClientOnlineBankingSelect().then(function (ClientOnlineResponse) {
                                _this.isLoading = false;
                                _this.clientOnlineBankingSelectResponse = ClientOnlineResponse.data[app.Common.DigitalServicesModule.Constants.ClientOnlineBanking.toBean()];
                                if (ClientOnlineResponse.data.Header.Status == "1" && _this.clientOnlineBankingSelectResponse && _this.clientOnlineBankingSelectResponse.returnCode == '0') {
                                    if (_this.clientOnlineBankingSelectResponse.showBankingComm != '1' || _this.customerContactDetailsSelectResponse.showAdvertisingCode != '1') {
                                        _this.currStep = 2;
                                        PushGACode({
                                            'PersonalZoneUpdateDetailsStep2Proc': _this.isOtpLogged ? 'otp' : 'Permanent password',
                                            'event': 'PersonalZoneUpdateDetailsStep2'
                                        });
                                    }
                                    else {
                                        //second step is not shown
                                        _this.isDisplayWizard = false;
                                        PushGACode({
                                            'PersonalZoneUpdateDetailsStep1SuccessProc': _this.isOtpLogged ? 'otp' : 'Permanent password',
                                            'PersonalZoneUpdateDetailsStep1SuccessMailEntry': _this.step1Data.email ? 'true' : 'false',
                                            'event': 'PersonalZoneUpdateDetailsStep1Success'
                                        });
                                    }
                                }
                                else {
                                    _this.isDisplayWizard = false;
                                    PushGACode({
                                        'PersonalZoneUpdateDetailsStep1FailureProc': _this.isOtpLogged ? 'otp' : 'Permanent password',
                                        'PersonalZoneUpdateDetailsStep1FailureName': (_this.customerContactDetailsSelectResponse && _this.customerContactDetailsSelectResponse.message) ? _this.customerContactDetailsSelectResponse.message : _this.generalErrorMsg,
                                        'event': 'PersonalZoneUpdateDetailsStep1Failure'
                                    });
                                }
                            });
                        }
                        else {
                            _this.isLoading = false;
                            _this.ErrorStep1 = true;
                            _this.ErrorMsgStep1 = (_this.customerContactDetailsUpdateResponse && _this.customerContactDetailsUpdateResponse.message) ? _this.customerContactDetailsUpdateResponse.message : _this.generalErrorMsg;
                            PushGACode({
                                'PersonalZoneUpdateDetailsStep1FailureProc': _this.isOtpLogged ? 'otp' : 'Permanent password',
                                'PersonalZoneUpdateDetailsStep1FailureName': (_this.customerContactDetailsSelectResponse && _this.customerContactDetailsSelectResponse.message) ? _this.customerContactDetailsSelectResponse.message : _this.generalErrorMsg,
                                'event': 'PersonalZoneUpdateDetailsStep1Failure'
                            });
                        }
                    });
                }
            };
            this.submitStep2 = function () {
                if (!_this.ErrorStep2) {
                    if (_this.isLoading == true)
                        return;
                    _this.isLoading = true;
                    if (!_this.hasPopupBeenTouched && !_this.isEmptyStep2
                        && (_this.customerContactDetailsSelectResponse.showAdvertisingCode != '1' || _this.clientOnlineBankingSelectResponse.showBankingComm != '1')) {
                        _this.isEmptyStep2 = true;
                        _this.isLoading = false;
                        return;
                    }
                    _this.isEmptyStep2 = false;
                    //onlineBanking Update
                    _this.ClientOnlineBankingUpdate().then(function (clineOnlineBankingResponse) {
                        _this.isLoading = false;
                        _this.clientOnlineBankingUpdateResponse = clineOnlineBankingResponse.data[app.Common.DigitalServicesModule.Constants.ClientOnlineBanking.toBean()];
                        var clientOnlineBankingMessage = (_this.clientOnlineBankingUpdateResponse && _this.clientOnlineBankingUpdateResponse.message) ? _this.clientOnlineBankingUpdateResponse.message : _this.generalErrorMsg;
                        if (_this.advertisingCode || _this.dualCompanyMarketingAgreement) {
                            _this.CustomerContactDetailsUpdateStep2().then(function (contactDtailsData) {
                                _this.customerContactDetailsUpdateResponse = contactDtailsData.data[app.Common.DigitalServicesModule.Constants.ContanctDetails.toBean()];
                                if (contactDtailsData.data.Header.Status == "1" && _this.customerContactDetailsUpdateResponse &&
                                    clineOnlineBankingResponse.data.Header.Status == "1" && _this.clientOnlineBankingUpdateResponse &&
                                    (_this.customerContactDetailsUpdateResponse.returnCode == '0' || _this.clientOnlineBankingUpdateResponse.returnCode == '0')) {
                                    _this.isDisplayWizard = false;
                                    _this.successUpdate();
                                }
                                else {
                                    _this.ErrorStep2 = true;
                                    var customerContactDetailsMessage = (_this.customerContactDetailsUpdateResponse && _this.customerContactDetailsUpdateResponse.message) ? _this.customerContactDetailsUpdateResponse.message : _this.generalErrorMsg;
                                    _this.ErrorMsgStep2 = (_this.customerContactDetailsUpdateResponse.returnCode != '0') ? customerContactDetailsMessage : _this.generalErrorMsg;
                                    _this.ErrorMsgStep2 = (_this.clientOnlineBankingUpdateResponse.returnCode != '0') ? clientOnlineBankingMessage : _this.generalErrorMsg;
                                }
                            });
                        }
                        else {
                            if (clineOnlineBankingResponse.data.Header.Status == "1" && _this.clientOnlineBankingUpdateResponse
                                && (_this.clientOnlineBankingUpdateResponse.returnCode == '0')) {
                                _this.isDisplayWizard = false;
                                _this.successUpdate();
                            }
                            else {
                                _this.ErrorStep2 = true;
                                _this.ErrorMsgStep2 = (_this.clientOnlineBankingUpdateResponse && _this.clientOnlineBankingUpdateResponse.message) ? _this.clientOnlineBankingUpdateResponse.message : _this.generalErrorMsg;
                            }
                        }
                    });
                }
            };
            //GA end process
            this.successUpdate = function () {
                var ga = {};
                ga['PersonalZoneUpdateDetailsStep2SuccessProc'] = _this.isOtpLogged ? 'otp' : 'Permanent password';
                ga['PersonalZoneUpdateDetailsStep2SuccessBank'] = _this.bankingAction ? 'Bank-Yes' : 'Bank-No';
                //check sms,mail,ivr
                var contactOptions = [];
                if (_this.updateMailIndicator)
                    contactOptions.push('Mail');
                if (_this.updateCellularIndicator)
                    contactOptions.push('SMS');
                if (_this.updateIvrIndicator)
                    contactOptions.push('Voice');
                if (_this.updateInternetIndicator)
                    contactOptions.push('Intenet');
                if (contactOptions.length > 0) {
                    var csv = contactOptions.join(',');
                    ga['PersonalZoneUpdateDetailsStep2SuccessBank'] = 'Bank-Yes';
                    ga['PersonalZoneUpdateDetailsStep2SuccessBankChan'] = csv;
                }
                //dual customer
                if (_this.clientOnlineBankingSelectResponse.showBankingComm != '1' &&
                    _this.customerContactDetailsSelectResponse.multicompanyCode == '3') {
                    //isracard site
                    if (_this.currSite == '11') {
                        //if (this.dualCompanyMarketingAgreement) {
                        if (_this.dualCompany) {
                            ga['PersonalZoneUpdateDetailsStep2SuccessAmex'] = 'Amex-Yes';
                        }
                        else {
                            ga['PersonalZoneUpdateDetailsStep2SuccessAmex'] = 'Amex-No';
                        }
                    }
                    else if (_this.currSite == '77') {
                        //if (this.dualCompanyMarketingAgreement) {
                        if (_this.dualCompany) {
                            ga['PersonalZoneUpdateDetailsStep2SuccessIsracard'] = 'Isracard-Yes';
                        }
                        else {
                            ga['PersonalZoneUpdateDetailsStep2SuccessIsracard'] = 'Isracard-No';
                        }
                    }
                }
                //advertising
                if (_this.customerContactDetailsSelectResponse.showAdvertisingCode != '1') {
                    ga['PersonalZoneUpdateDetailsStep2SuccessAdv'] =
                        _this.advertisingCode ? 'Adv-Yes' : 'Adv-No';
                }
                //Mail
                ga['PersonalZoneUpdateDetailsStep1SuccessMailEntry'] = _this.step1Data.email ? 'true' : 'false';
                ga['event'] = 'PersonalZoneUpdateDetailsStep2Success';
                PushGACode(ga);
            };
            //Contact Details Function
            this.CustomerContactDetailsSelect = function () {
                _this.customerContactDetailsRequest.actionCode = 0; //Select
                _this.customerContactDetailsRequest.channelCode = _this.dcChannelCode;
                _this.customerContactDetailsRequest.companyCode = parseInt(_this.currSite);
                return _this.services.CustomerContactDetails(_this.customerContactDetailsRequest);
            };
            this.CustomerContactDetailsUpdateStep1 = function () {
                _this.customerContactDetailsRequest.actionCode = 2; //update 1  
                if (_this.step1Data.prefix + '-' + _this.step1Data.phoneBody != _this.customerContactDetailsSelectResponse.maskedCellPhone) {
                    _this.customerContactDetailsRequest.prefixCellphone = _this.step1Data.prefix;
                    _this.customerContactDetailsRequest.cellphoneNumber = _this.step1Data.phoneBody;
                    _this.customerContactDetailsRequest.cellphoneIndicator = 1;
                }
                else {
                    _this.customerContactDetailsRequest.cellphoneIndicator = 2;
                }
                if (_this.step1Data.email != _this.customerContactDetailsSelectResponse.maskedMail && _this.step1Data.email != "") {
                    _this.customerContactDetailsRequest.email = _this.step1Data.email;
                    _this.customerContactDetailsRequest.emailIndicator = 1;
                }
                else {
                    _this.customerContactDetailsRequest.emailIndicator = 0;
                }
                return _this.services.CustomerContactDetails(_this.customerContactDetailsRequest);
            };
            this.CustomerContactDetailsUpdateStep2 = function () {
                _this.customerContactDetailsRequest = new app.Common.Features.Classes.CustomerContactDetailsRequest();
                _this.customerContactDetailsRequest.actionCode = 1; //update 1  
                _this.customerContactDetailsRequest.channelCode = _this.dcChannelCode;
                if (_this.advertisingCode && !_this.dualCompanyMarketingAgreement) {
                    _this.customerContactDetailsRequest.companyCode = parseInt(_this.currSite);
                }
                if (!_this.advertisingCode && _this.dualCompanyMarketingAgreement) {
                    if (parseInt(_this.currSite) == 11) {
                        _this.customerContactDetailsRequest.companyCode = 77;
                    }
                    else {
                        _this.customerContactDetailsRequest.companyCode = 11;
                    }
                }
                if (_this.customerContactDetailsSelectResponse.showAdvertisingCode != '1' && _this.customerContactDetailsSelectResponse.multicompanyCode == '3') {
                    if (_this.advertisingCode && _this.dualCompanyMarketingAgreement) {
                        _this.customerContactDetailsRequest.companyCode = 99;
                    }
                }
                _this.customerContactDetailsRequest.mailDeliveryCode = 1;
                _this.customerContactDetailsRequest.smsBenefitCode = 1;
                _this.customerContactDetailsRequest.mailDeliveryCodeIndicator = 1;
                _this.customerContactDetailsRequest.smsBenefitCodeIndicator = 1;
                return _this.services.CustomerContactDetails(_this.customerContactDetailsRequest);
            };
            //Client Online Banking
            this.ClientOnlineBankingSelect = function () {
                _this.clientOnlineBankingRequest.actionCode = 1; //select 
                _this.clientOnlineBankingRequest.inputCode = 1;
                _this.clientOnlineBankingRequest.cardPrefix = 0;
                _this.clientOnlineBankingRequest.cardNumber = 0;
                _this.clientOnlineBankingRequest.channelCode = 3;
                _this.clientOnlineBankingRequest.accessLevel = 1;
                _this.clientOnlineBankingRequest.updateSource = 9;
                _this.clientOnlineBankingRequest.cardServiceCode = 0;
                _this.clientOnlineBankingRequest.companyCode = _this.onlineBankingCompanyCode;
                return _this.services.ClientOnlineBanking(_this.clientOnlineBankingRequest);
            };
            this.ClientOnlineBankingUpdate = function () {
                _this.clientOnlineBankingRequest.actionCode = 2;
                if (_this.clientOnlineBankingSelectResponse.showBankingComm != '1' && _this.customerContactDetailsSelectResponse.multicompanyCode == '3' && _this.dualCompany)
                    _this.clientOnlineBankingRequest.companyCode = 4;
                _this.clientOnlineBankingRequest.accessLevel = 2;
                _this.clientOnlineBankingRequest.joiningChannelCode = _this.dcChannelCode;
                _this.clientOnlineBankingRequest.channelCode = 3;
                _this.clientOnlineBankingRequest.updatingUser = "X0T";
                _this.clientOnlineBankingRequest.consentCodeInternet = 2;
                _this.clientOnlineBankingRequest.updateIndicationInternet = 1;
                _this.clientOnlineBankingRequest.consentCodeFax = 0;
                _this.clientOnlineBankingRequest.updateIndicationFax = 0;
                //updateIvrIndicator
                switch (_this.updateIvrIndicator) {
                    case true:
                        _this.clientOnlineBankingRequest.consentCodeIVR = 2;
                        _this.clientOnlineBankingRequest.updateIndicationIVR = 1;
                        break;
                    case false:
                        _this.clientOnlineBankingRequest.consentCodeIVR = 3;
                        _this.clientOnlineBankingRequest.updateIndicationIVR = 1;
                        break;
                    default:
                        _this.clientOnlineBankingRequest.consentCodeIVR = 0;
                        _this.clientOnlineBankingRequest.updateIndicationIVR = 0;
                }
                //updateMailIndicator
                switch (_this.updateMailIndicator) {
                    case true:
                        _this.clientOnlineBankingRequest.consentCodeMail = 2;
                        _this.clientOnlineBankingRequest.updateIndicationMail = 1;
                        break;
                    case false:
                        _this.clientOnlineBankingRequest.consentCodeMail = 3;
                        _this.clientOnlineBankingRequest.updateIndicationMail = 1;
                        break;
                    default:
                        _this.clientOnlineBankingRequest.consentCodeMail = 0;
                        _this.clientOnlineBankingRequest.updateIndicationMail = 0;
                }
                //updateCellularIndicator
                switch (_this.updateCellularIndicator) {
                    case true:
                        _this.clientOnlineBankingRequest.consentCodeCellular = 2;
                        _this.clientOnlineBankingRequest.updateIndicationCellular = 1;
                        break;
                    case false:
                        _this.clientOnlineBankingRequest.consentCodeCellular = 3;
                        _this.clientOnlineBankingRequest.updateIndicationCellular = 1;
                        break;
                    default:
                        _this.clientOnlineBankingRequest.consentCodeCellular = 0;
                        _this.clientOnlineBankingRequest.updateIndicationCellular = 0;
                }
                //updateInternetIndicator
                switch (_this.updateInternetIndicator) {
                    case true:
                        _this.clientOnlineBankingRequest.consentCodeInternet = 2;
                        _this.clientOnlineBankingRequest.updateIndicationInternet = 1;
                        break;
                    case false:
                        _this.clientOnlineBankingRequest.consentCodeInternet = 3;
                        _this.clientOnlineBankingRequest.updateIndicationInternet = 1;
                        break;
                    default:
                        _this.clientOnlineBankingRequest.consentCodeInternet = 0;
                        _this.clientOnlineBankingRequest.updateIndicationInternet = 0;
                }
                return _this.services.ClientOnlineBanking(_this.clientOnlineBankingRequest);
            };
            this.handleBankingServices = function (toTurnOn) {
                _this.hasPopupBeenTouched = true;
                if (_this.bankingAction || toTurnOn) {
                    _this.bankingAction = true;
                    _this.updateIvrIndicator = _this.updateMailIndicator = _this.updateCellularIndicator = _this.updateInternetIndicator = true;
                    _this.dualCompany = true;
                }
                else {
                    _this.updateIvrIndicator = _this.updateMailIndicator = _this.updateCellularIndicator = false;
                    _this.dualCompany = false;
                }
            };
            this.closePopup = function () {
                _this.isDisplayWizard = false;
                if (_this.currStep == 1) {
                    PushGACode({
                        'PersonalZoneUpdateDetailsCancellationClickProc': _this.isOtpLogged ? 'otp' : 'Permanent password',
                        'PersonalZoneUpdateDetailsCancellationClickLoc': 'Step1',
                        'event': 'PersonalZoneUpdateDetailsCancellationClick'
                    });
                }
                else {
                    PushGACode({
                        'PersonalZoneUpdateDetailsCancellationClickProc': _this.isOtpLogged ? 'otp' : 'Permanent password',
                        'PersonalZoneUpdateDetailsCancellationClickLoc': 'Step2',
                        'event': 'PersonalZoneUpdateDetailsCancellationClick'
                    });
                }
                //  this.$rootScope.$broadcast("uncle", "some data");
            };
            this.notNow = function () {
                _this.isDisplayWizard = false;
                _this.hideCloseIcon = true;
                _this.setCookie();
                PushGACode({
                    'PersonalZoneUpdateDetailsContinueNextTimeClickProc': _this.isOtpLogged ? 'otp' : 'Permanent password',
                    'event': 'PersonalZoneUpdateDetailsContinueNextTimeClick'
                });
            };
            this.setCookie = function () {
                document.cookie = "hasLoggedInBefore" + "=" + true + ";";
            };
            this.getTooltipSection = function () {
                var bankingActionTooltip = (_this.epiData.BankingActionTitle != null) ? _this.epiData.BankingActionTitle : "";
                var bankingActionTooltipText = (_this.epiData.BankingActionTooltip != null) ? _this.epiData.BankingActionTooltip : "";
                var bankingActionPre = "";
                var bankingActionFix = "";
                if (bankingActionTooltipText) {
                    bankingActionPre = "<span class='tooltip'><span class= 'tooltiptext'>" + bankingActionTooltipText + "</span>";
                    bankingActionFix = "</span>";
                    bankingActionTooltip = bankingActionTooltip.replace("{", bankingActionPre);
                    bankingActionTooltip = bankingActionTooltip.replace("}", bankingActionFix);
                }
                return bankingActionTooltip;
            };
            this.trustAsHtml = function (str) {
                return _this.$sce.trustAsHtml(str);
            };
            this.customerContactDetailsRequest = new app.Common.Features.Classes.CustomerContactDetailsRequest();
            this.getAccountBirthDetailsRequest = new app.Common.Features.Classes.getAccountBirthDetailsRequest();
            this.clientOnlineBankingRequest = new app.Common.Features.Classes.ClientOnlineBankingRequest();
            this.step1Data = new Object();
            this.currStep = 1;
            this.isDisplayWizard = false;
            this.isServiceError = false;
            this.allowSkipping = true;
            this.isLoading = false;
            this.isOtpLogged = isOtpLogged != "False";
            this.customerFirstName = firstName;
            this.isShowingDebitPopUp = false;
            // load the popup after Approval Gathering Popup if it exists
            if (document.getElementById("approvalGatheringPopup")) {
                $rootScope.$on("loadNextPopupEvent", function (event, args) {
                    _this.getCardIdx();
                });
            }
            else {
                this.getCardIdx();
            }
        }
        Controller.prototype.close = function () {
            angular.element('.modal').css('display', 'none');
            this.loadingDigitalCustomerPopup();
        };
        //// showDebitingPopup
        ////DigitalCustomerPopup
        Controller.prototype.loadingDigitalCustomerPopup = function () {
            var _this = this;
            if (DisplayDigitalCustomerLogin.toLowerCase() == "true") {
                var allData = this.services.GetAllData().then(function (data) {
                    _this.getAllData(data);
                    if (_this.currSite == "11") {
                        _this.dcChannelCode = 100;
                        _this.onlineBankingCompanyCode = 1;
                    }
                    else if (_this.currSite == "77") {
                        _this.dcChannelCode = 102;
                        _this.onlineBankingCompanyCode = 2;
                    }
                    _this.getAccountBirthDetailsRequest.identificationLevel = 2;
                    _this.getAccountBirthDetailsRequest.checkLevel = 2;
                    _this.getAccountBirthDetailsRequest.actionCode = 3;
                    _this.getAccountBirthDetailsRequest.birthDate = 2;
                    _this.getAccountBirthDetailsRequest.acctCheckLevel = 0;
                    _this.getAccountBirthDetailsRequest.bankNumber = 0;
                    _this.getAccountBirthDetailsRequest.branchNumber = 0;
                    _this.getAccountBirthDetailsRequest.acctNumber = 0;
                    _this.getAccountBirthDetailsRequest.acctType = 0;
                    _this.getAccountBirthDetailsRequest.birthDate = 0;
                    _this.getAccountBirthDetailsRequest.companyCode = parseInt(_this.currSite);
                    _this.getAccountBirthDetailsRequest.applicationSource = _this.dcChannelCode;
                    _this.getAccountBirthDetailsRequest.applicationReason = 1;
                    _this.services.AccountBirthDetails(_this.getAccountBirthDetailsRequest).then(function (AccountBirthDetailsResponse) {
                        _this.getAccountBirthDetailsResponse = AccountBirthDetailsResponse.data[app.Common.DigitalServicesModule.Constants.GetAccountBirthDetails.toBean()];
                        if (AccountBirthDetailsResponse.data.Header.Status == "1" && _this.getAccountBirthDetailsResponse && _this.getAccountBirthDetailsResponse.returnCode == '300') {
                            _this.generalErrorMsg = _this.epiData.GeneralErrorMsg;
                            _this.bankingActionTooltip = _this.getTooltipSection();
                            _this.CustomerContactDetailsSelect().then(function (ContactDetailsResponse) {
                                _this.customerContactDetailsSelectResponse = ContactDetailsResponse.data[app.Common.DigitalServicesModule.Constants.ContanctDetails.toBean()];
                                if (ContactDetailsResponse.data.Header.Status == "1" && _this.customerContactDetailsSelectResponse && _this.customerContactDetailsSelectResponse.returnCode == '0') {
                                    if (_this.customerContactDetailsSelectResponse.prefixCellphone == "000") {
                                        _this.customerContactDetailsSelectResponse.prefixCellphone = "";
                                        _this.step1Data.digitalCustomerLogin_select = _this.translations.digitalCustomerLogin_select;
                                    }
                                    if (_this.customerContactDetailsSelectResponse.cellphoneNumber == "0")
                                        _this.customerContactDetailsSelectResponse.cellphoneNumber = "";
                                    if (_this.customerContactDetailsSelectResponse.cellphoneNumber == "0")
                                        _this.customerContactDetailsSelectResponse.cellphoneNumber = "";
                                    //this.step1Data.email = this.customerContactDetailsSelectResponse.email;
                                    _this.step1Data.email = _this.customerContactDetailsSelectResponse.maskedMail;
                                    _this.step1Data.prefix = _this.customerContactDetailsSelectResponse.prefixCellphone;
                                    _this.step1Data.digitalCustomerLogin_selected = _this.customerContactDetailsSelectResponse.prefixCellphone;
                                    //this.step1Data.phoneBody = this.customerContactDetailsSelectResponse.cellphoneNumber;
                                    if (_this.customerContactDetailsSelectResponse.maskedCellPhone.indexOf('-') > 0) {
                                        _this.step1Data.phoneBody = _this.customerContactDetailsSelectResponse.maskedCellPhone.split('-')[1];
                                    }
                                    if (document.cookie.indexOf("hasLoggedInBefore") > -1) {
                                        _this.allowSkipping = false;
                                    }
                                    _this.loadHtml();
                                }
                            });
                        }
                    });
                });
            }
        };
        return Controller;
    }());
    Controller.$inject = ["DigitalCustomerLoginModule.Services", "$sce", "$rootScope", "app.Common.FeaturesModule.FeatureServices"];
    DigitalCustomerLoginModule.Controller = Controller;
    angular.module('app.digitalCustomerLoginModule').controller('DigitalCustomerLoginModule.Controller', Controller);
})(DigitalCustomerLoginModule || (DigitalCustomerLoginModule = {}));
//# sourceMappingURL=Controller.js.map;
var DigitalCustomerLoginModule;
(function (DigitalCustomerLoginModule) {
    "use strict";
    var ApprovalGatheringController = (function () {
        function ApprovalGatheringController(services, $sce, $rootScope, featuresService) {
            var _this = this;
            this.services = services;
            this.$sce = $sce;
            this.$rootScope = $rootScope;
            this.featuresService = featuresService;
            this.showCloseButtonForm = false; // show / hide the X header button
            this.showCloseButtonStatus = true; // show / hide the X header button
            this.fillExpiryDateDropdowns = function (data) {
                _this.userData = data.MfCreditPoolReqBean;
                _this.minDate = _this.maxDate = new Date();
                _this.userData.ProductListOutput.map(function (card) {
                    var arrDate = card.expiryDate.split(".");
                    var cardExpirationDate = new Date(arrDate[2], arrDate[1] - 1, arrDate[0]);
                    _this.maxDate = _this.maxDate < cardExpirationDate ? cardExpirationDate : _this.maxDate;
                });
                // round dates to min and max month day accordingly to solve calculation corner cases
                _this.minDate.setDate(1);
                _this.maxDate = new Date(_this.maxDate.getFullYear(), _this.maxDate.getMonth() + 1, 0);
                var maxYear = _this.maxDate.getFullYear();
                for (var i = new Date().getFullYear(); i <= maxYear; i++) {
                    _this.yearArray.push(i);
                }
                _this.selectedYear = _this.yearArray[_this.yearArray.length - 1];
                var maxMonth = _this.maxDate.getMonth();
                for (var i = 0; i <= maxMonth; i++) {
                    _this.monthArray.push(i + 1);
                }
                _this.selectedMonth = _this.monthArray[_this.monthArray.length - 1];
                // remove extra items for prevent choosing an incorrect date
                _this.initYearsSelect(_this.selectedMonth);
                _this.initMonthSelect(_this.selectedYear);
            };
            this.showStatus = function (actionCode, returnCode) {
                // defaults
                _this.status.title = returnCode !== "0" ? _this.epiStatus.FailedTitleText : _this.epiStatus.SuccessTitleText;
                _this.status.image = returnCode !== "0" ? _this.epiStatus.FailedImage : _this.epiStatus.SuccessImage;
                _this.status.header = _this.epiStatus.GetReturnOneHeaderText;
                _this.status.body = _this.epiStatus.GetReturnOneBodyText;
                // agreements statuses for set
                if (actionCode === "2") {
                    returnCode === "1" && (_this.status.header = _this.epiStatus.SetReturnOneHeaderText, _this.status.body = _this.epiStatus.SetReturnOneBodyText);
                    returnCode === "0" && (_this.status.header = _this.epiStatus.SetReturnZeroHeaderText, _this.status.body = _this.epiStatus.SetReturnZeroBodyText);
                    // agreements statuses for get
                }
                else {
                    returnCode === "1" && (_this.status.header = _this.epiStatus.GetReturnOneHeaderText, _this.status.body = _this.epiStatus.GetReturnOneBodyText);
                    returnCode === "9" && (_this.status.header = _this.epiStatus.GetReturnNineHeaderText, _this.status.body = _this.epiStatus.GetReturnNineBodyText);
                }
                _this.showStatusPopup = true;
            };
            this.closeFormPopup = function () {
                _this.showFormPopup = false;
            };
            this.closeStatusPopup = function () {
                _this.showFormPopup = _this.showStatusPopup = false;
                if (_this.shownAsPage) {
                    window.location.href = _this.epiStatus.CloseBtnRedirect;
                }
                else {
                    _this.$rootScope.$emit("loadNextPopupEvent", {});
                }
            };
            this.buildRequest = function (shownAsPage, readOnly) {
                var request;
                if (shownAsPage) {
                    request = readOnly
                        ? new app.Common.Features.Classes.MfCreditPoolReqReadOnlyGetRequest()
                        : new app.Common.Features.Classes.MfCreditPoolReqAlwaysGetRequest();
                }
                else {
                    request = new app.Common.Features.Classes.MfCreditPoolReqGetRequest();
                }
                return JSON.parse(JSON.stringify(request));
            };
            setTimeout(function () { _this.featuresService.pushGaCode({ 'event': "PZPopupCustomerApprovals" }); }, 100);
            this.readOnly = window["agreementsModeReadOnly"] || false;
            this.shownAsPage = window["agreementsShownAsPage"] || false;
            this.showFormPopup = false;
            this.showStatusPopup = false;
            this.userData = {};
            this.monthArray = [];
            this.yearArray = [];
            this.status = { title: "", image: "", header: "", body: "" };
            this.loadApprovalGatheringPopup();
        }
        ApprovalGatheringController.prototype.approveGathering = function (agree) {
            var _this = this;
            // set all the items of this.userData.ProductListOutput by form inputs (1/2) and the expiration date
            var expiryDate = new Date(this.selectedYear, this.selectedMonth, 1); // create date with a one extra month
            expiryDate.setDate(expiryDate.getDate() - 1); // calculate the last day in selected month
            var pushGaCodeData = { 'AgreementPeriod': expiryDate.toLocaleDateString() };
            var request = new app.Common.Features.Classes.MfCreditPoolReqSetRequest(this.userData);
            if (agree) {
                request.productListInput.map(function (card) {
                    var cardElem = document.querySelector("#card_" + card.cardNumber);
                    card.monitorType = cardElem.checked ? "1" : "2";
                    cardElem.checked && (card.agreementExpiryDate = "" + ('0' + expiryDate.getDate()).slice(-2) +
                        ("." + ('0' + (expiryDate.getMonth() + 1)).slice(-2) + "." + expiryDate.getFullYear()));
                });
                pushGaCodeData["ProductsListApproval"] = JSON.stringify(request.productListInput);
                pushGaCodeData["event"] = "PZPopupCustomerApprovalsAgreeClick";
            }
            else {
                // set all the items (except 1 signed items) of this.userData.ProductListOutput to "2" value
                request.productListInput.map(function (card) {
                    card.monitorType = "2";
                });
                pushGaCodeData["ProductsListDisagree"] = JSON.stringify(request.productListInput);
                pushGaCodeData["event"] = "PZPopupCustomerApprovalsDisagreeClick";
            }
            // approval gathering set data service call
            this.featuresService.mfCreditPoolReqSet(request).then(function (res) {
                var data = res.data;
                if ((data.Header.Status !== "1") || (data.MfCreditPoolReqBean && data.MfCreditPoolReqBean.returnCode !== "0")) {
                    _this.showStatus(request.actionCode, data.MfCreditPoolReqBean && data.MfCreditPoolReqBean.returnCode);
                }
                if (_this.shownAsPage) {
                    _this.showStatus(request.actionCode, data.MfCreditPoolReqBean && data.MfCreditPoolReqBean.returnCode);
                }
                else {
                    _this.closeFormPopup();
                    _this.$rootScope.$emit("loadNextPopupEvent", {});
                }
            });
            this.featuresService.pushGaCode(pushGaCodeData);
        };
        ApprovalGatheringController.prototype.displayApprovalGatheringPopup = function () {
            var _this = this;
            this.services.GetApprovalGatheringStatusData().then(function (epiStatusResponse) {
                _this.epiStatus = JSON.parse(epiStatusResponse);
                var request = _this.buildRequest(_this.shownAsPage, _this.readOnly);
                // get approval gathering data
                _this.featuresService.mfCreditPoolReqGet(request).then(function (res) {
                    if ((res.Header && res.Header.Status === "1") && (res.MfCreditPoolReqBean && res.MfCreditPoolReqBean.returnCode === "0")) {
                        _this.showFormPopup = res.MfCreditPoolReqBean.ProductListOutput && (res.MfCreditPoolReqBean.ProductListOutput.length > 0);
                        if (_this.showFormPopup) {
                            // get epi form texts
                            _this.services.GetApprovalGatheringFormData().then(function (epiFormResponse) {
                                _this.epiData = JSON.parse(epiFormResponse);
                            });
                            _this.fillExpiryDateDropdowns(res);
                        }
                        else {
                            _this.shownAsPage && _this.showStatus(request.actionCode, res.MfCreditPoolReqBean && res.MfCreditPoolReqBean.returnCode);
                            !_this.shownAsPage && _this.$rootScope.$emit("loadNextPopupEvent", {});
                        }
                    }
                    else {
                        _this.shownAsPage && _this.showStatus(request.actionCode, res.MfCreditPoolReqBean && res.MfCreditPoolReqBean.returnCode);
                        !_this.shownAsPage && _this.$rootScope.$emit("loadNextPopupEvent", {});
                    }
                });
            });
        };
        ApprovalGatheringController.prototype.loadApprovalGatheringPopup = function () {
            debugger;
            if (window["insuranceConsentPopupShown"]) {
                var that = this;
                (function detectInsuranceModal() {
                    if (window["insuranceConsentPopupShown"]) {
                        console.log("insuranceModal");
                        window.setTimeout(detectInsuranceModal, 1 * 1000);
                    }
                    else {
                        console.log("close insurance Modal");
                        that.displayApprovalGatheringPopup();
                    }
                })();
            }
            else {
                debugger;
                this.displayApprovalGatheringPopup();
            }
            // get epi statuses texts (success and fail texts)
        };
        // remove extra items for prevent choosing an incorrect date
        ApprovalGatheringController.prototype.initYearsSelect = function (month) {
            var maxYear = this.maxDate.getFullYear();
            var minYear = this.minDate.getFullYear();
            this.yearArray = [];
            for (var year = minYear; year <= maxYear; year++) {
                var curDate = new Date(year, month, 1);
                curDate.setDate(curDate.getDate() - 1); // calculate last day of a month
                if (curDate >= this.minDate && curDate <= this.maxDate) {
                    this.yearArray.push(year);
                }
            }
        };
        // remove extra items for prevent choosing an incorrect date
        ApprovalGatheringController.prototype.initMonthSelect = function (year) {
            this.monthArray = [];
            for (var month = 0; month <= 11; month++) {
                var curDate = new Date(year, month + 1, 1);
                curDate.setDate(curDate.getDate() - 1); // calculate last day of a month
                if (curDate >= this.minDate && curDate <= this.maxDate) {
                    this.monthArray.push(month + 1);
                }
            }
        };
        // prevent html script rendering
        ApprovalGatheringController.prototype.formatContent = function (content) {
            if (content === void 0) { content = ""; }
            return content
                .replace(/&/g, "&amp;")
                .replace(/"/g, "&quot;")
                .replace(/'/g, "&#39")
                .replace(/</g, "&lt;")
                .replace(/>/g, "&gt;")
                .replace(/{br}/gi, "<br />");
        };
        ;
        return ApprovalGatheringController;
    }());
    ApprovalGatheringController.$inject = ["DigitalCustomerLoginModule.Services", "$sce", "$rootScope", "app.Common.FeaturesModule.FeatureServices"];
    DigitalCustomerLoginModule.ApprovalGatheringController = ApprovalGatheringController;
    angular.module("app.digitalCustomerLoginModule").controller("DigitalCustomerLoginModule.ApprovalGatheringController", ApprovalGatheringController);
})(DigitalCustomerLoginModule || (DigitalCustomerLoginModule = {}));
//# sourceMappingURL=ApprovalGatheringController.js.map;
var DigitalCustomerLoginModule;
(function (DigitalCustomerLoginModule) {
    var Services = (function () {
        function Services(digitalServices) {
            var _this = this;
            this.digitalServices = digitalServices;
            this.GetAllData = function () {
                var response = _this.digitalServices.useGetHandlerExternal(app.Common.DigitalServicesModule.Constants.DigitalCustomerData, "");
                return response;
            };
            this.GetApprovalGatheringFormData = function () {
                return _this.digitalServices.usePostHandlerExternal(app.Common.DigitalServicesModule.Constants.ApprovalGatheringFormData, "");
            };
            this.GetApprovalGatheringStatusData = function () {
                return _this.digitalServices.usePostHandlerExternal(app.Common.DigitalServicesModule.Constants.ApprovalGatheringStatusData, "");
            };
            // ****************** DIGITAL CUSTOMER ******************
            this.CustomerContactDetails = function (data) {
                //return this.digitalServices.useSimplePostHandler(app.Common.DigitalServicesModule.Constants.ContanctDetails, data);
                return _this.digitalServices.useSimplePostHandler(app.Common.DigitalServicesModule.Constants.MaskedContactDetails, data);
            };
            this.ClientOnlineBanking = function (data) {
                return _this.digitalServices.useSimplePostHandler(app.Common.DigitalServicesModule.Constants.ClientOnlineBanking, data);
            };
            this.AccountBirthDetails = function (data) {
                return _this.digitalServices.useSimplePostHandler(app.Common.DigitalServicesModule.Constants.GetAccountBirthDetails, data);
            };
        }
        return Services;
    }());
    Services.$inject = ["app.Common.DigitalServicesModule.DigitalServices"];
    DigitalCustomerLoginModule.Services = Services;
    angular.module('app.digitalCustomerLoginModule').service('DigitalCustomerLoginModule.Services', Services);
})(DigitalCustomerLoginModule || (DigitalCustomerLoginModule = {}));
//# sourceMappingURL=Services.js.map;
