From 7a375fd88cf8a21d3a42a4c607c7b6b33a845fd9 Mon Sep 17 00:00:00 2001 From: Kelp Date: Fri, 13 Jun 2014 23:57:45 +0800 Subject: [PATCH] fixed #2. --- application/forms/application_form.py | 3 + .../coffeescript/controllers/settings.coffee | 35 ++++++ .../frontend/coffeescript/provider.coffee | 6 ++ application/frontend/javascript/app.js | 101 +++++++++++++++++- application/frontend/javascript/site.min.js | 2 +- .../frontend/views/modal/application.html | 35 ++++++ application/urls.py | 4 + application/views/applications.py | 34 +++++- 8 files changed, 213 insertions(+), 7 deletions(-) diff --git a/application/forms/application_form.py b/application/forms/application_form.py index 29e7cd8..1305b8c 100644 --- a/application/forms/application_form.py +++ b/application/forms/application_form.py @@ -1,4 +1,5 @@ from wtforms import Form, StringField, BooleanField, validators +from application.forms import ArrayField class ApplicationForm(Form): @@ -15,3 +16,5 @@ class ApplicationForm(Form): app_key = BooleanField( default=False ) + member_ids = ArrayField() + root_ids = ArrayField() diff --git a/application/frontend/coffeescript/controllers/settings.coffee b/application/frontend/coffeescript/controllers/settings.coffee index d79fa0d..4a0338d 100644 --- a/application/frontend/coffeescript/controllers/settings.coffee +++ b/application/frontend/coffeescript/controllers/settings.coffee @@ -61,9 +61,18 @@ angular.module 'v.controllers.settings', [] $v = $injector.get '$v' $validator = $injector.get '$validator' $state = $injector.get '$state' + $timeout = $injector.get '$timeout' $scope.mode = 'edit' $scope.application = application + for member in application.members + member.isRoot = member.id in application.root_ids + $scope.$watch 'application.members', -> + root_ids = [] + for member in $scope.application.members when member.isRoot + root_ids.push member.id + $scope.application.root_ids = root_ids + , yes $scope.modal = autoShow: yes hide: -> @@ -76,8 +85,34 @@ angular.module 'v.controllers.settings', [] id: $scope.application.id title: $scope.application.title description: $scope.application.description + member_ids: $scope.application.member_ids + root_ids: $scope.application.root_ids $v.api.application.updateApplication(data).success -> $scope.modal.hide() + $scope.memberService = + email: '' + invite: ($event) -> + $event.preventDefault() + $validator.validate($scope, 'memberService').success -> + NProgress.start() + $v.api.application.addApplicationMember($scope.application.id, $scope.memberService.email).success (member) -> + NProgress.done() + $scope.application.member_ids.push member.id + $scope.application.members.push member + $scope.memberService.email = '' + $timeout -> $validator.reset $scope, 'memberService' + removeMember: ($event, memberId) -> + $event.preventDefault() + for index in [0...$scope.application.members.length] when $scope.application.members[index].id is memberId + $scope.application.members.splice index, 1 + break + for index in [0...$scope.application.member_ids.length] when $scope.application.member_ids[index] is memberId + $scope.application.member_ids.splice index, 1 + break + for index in [0...$scope.application.root_ids.length] when $scope.application.root_ids[index] is memberId + $scope.application.root_ids.splice index, 1 + break + return $scope.updateAppKey = -> NProgress.start() data = diff --git a/application/frontend/coffeescript/provider.coffee b/application/frontend/coffeescript/provider.coffee index 3a16ad4..85165bd 100644 --- a/application/frontend/coffeescript/provider.coffee +++ b/application/frontend/coffeescript/provider.coffee @@ -106,6 +106,12 @@ angular.module 'v.provider', [] params: index: index all: all + addApplicationMember: (applicationId, email) => + @http + method: 'post' + url: "/settings/applications/#{applicationId}/members" + data: + email: email addApplication: (application) => ### @param application: diff --git a/application/frontend/javascript/app.js b/application/frontend/javascript/app.js index bb61e59..152a718 100644 --- a/application/frontend/javascript/app.js +++ b/application/frontend/javascript/app.js @@ -80,6 +80,8 @@ }).call(this); (function() { + var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + angular.module('v.controllers.settings', []).controller('SettingsController', [ '$scope', '$injector', function($scope, $injector) { var $state; @@ -161,12 +163,30 @@ } ]).controller('SettingsApplicationController', [ '$scope', '$injector', 'application', function($scope, $injector, application) { - var $state, $v, $validator; + var $state, $timeout, $v, $validator, member, _i, _len, _ref, _ref1; $v = $injector.get('$v'); $validator = $injector.get('$validator'); $state = $injector.get('$state'); + $timeout = $injector.get('$timeout'); $scope.mode = 'edit'; $scope.application = application; + _ref = application.members; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + member = _ref[_i]; + member.isRoot = (_ref1 = member.id, __indexOf.call(application.root_ids, _ref1) >= 0); + } + $scope.$watch('application.members', function() { + var root_ids, _j, _len1, _ref2; + root_ids = []; + _ref2 = $scope.application.members; + for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { + member = _ref2[_j]; + if (member.isRoot) { + root_ids.push(member.id); + } + } + return $scope.application.root_ids = root_ids; + }, true); $scope.modal = { autoShow: true, hide: function() {}, @@ -183,13 +203,58 @@ data = { id: $scope.application.id, title: $scope.application.title, - description: $scope.application.description + description: $scope.application.description, + member_ids: $scope.application.member_ids, + root_ids: $scope.application.root_ids }; return $v.api.application.updateApplication(data).success(function() { return $scope.modal.hide(); }); }); }; + $scope.memberService = { + email: '', + invite: function($event) { + $event.preventDefault(); + return $validator.validate($scope, 'memberService').success(function() { + NProgress.start(); + return $v.api.application.addApplicationMember($scope.application.id, $scope.memberService.email).success(function(member) { + NProgress.done(); + $scope.application.member_ids.push(member.id); + $scope.application.members.push(member); + $scope.memberService.email = ''; + return $timeout(function() { + return $validator.reset($scope, 'memberService'); + }); + }); + }); + }, + removeMember: function($event, memberId) { + var index, _j, _k, _l, _ref2, _ref3, _ref4; + $event.preventDefault(); + for (index = _j = 0, _ref2 = $scope.application.members.length; 0 <= _ref2 ? _j < _ref2 : _j > _ref2; index = 0 <= _ref2 ? ++_j : --_j) { + if (!($scope.application.members[index].id === memberId)) { + continue; + } + $scope.application.members.splice(index, 1); + break; + } + for (index = _k = 0, _ref3 = $scope.application.member_ids.length; 0 <= _ref3 ? _k < _ref3 : _k > _ref3; index = 0 <= _ref3 ? ++_k : --_k) { + if (!($scope.application.member_ids[index] === memberId)) { + continue; + } + $scope.application.member_ids.splice(index, 1); + break; + } + for (index = _l = 0, _ref4 = $scope.application.root_ids.length; 0 <= _ref4 ? _l < _ref4 : _l > _ref4; index = 0 <= _ref4 ? ++_l : --_l) { + if (!($scope.application.root_ids[index] === memberId)) { + continue; + } + $scope.application.root_ids.splice(index, 1); + break; + } + } + }; return $scope.updateAppKey = function() { var data; NProgress.start(); @@ -308,6 +373,27 @@ return $(element).select(); } }; + }).directive('vEnter', function() { + return { + + /* + Run the AngularJS expression when pressed `Enter`. + */ + restrict: 'A', + link: function(scope, element, attrs) { + return element.bind('keydown keypress', function(e) { + if (e.which !== 13) { + return; + } + e.preventDefault(); + return scope.$apply(function() { + return scope.$eval(attrs.vEnter, { + $event: e + }); + }); + }); + } + }; }).directive('vModal', function() { return { @@ -624,6 +710,17 @@ }); }; })(this), + addApplicationMember: (function(_this) { + return function(applicationId, email) { + return _this.http({ + method: 'post', + url: "/settings/applications/" + applicationId + "/members", + data: { + email: email + } + }); + }; + })(this), addApplication: (function(_this) { return function(application) { diff --git a/application/frontend/javascript/site.min.js b/application/frontend/javascript/site.min.js index c838b02..e94cf05 100644 --- a/application/frontend/javascript/site.min.js +++ b/application/frontend/javascript/site.min.js @@ -6,4 +6,4 @@ d?c.$element.find(".modal-dialog").one(a.support.transition.end,function(){c.$el }}}}function ec(a){for(var b=a.split("/"),c=b.length;c--;)b[c]=Y(b[c]);return b.join("/")}function fc(a,b,c){var d=Mc(a,c);b.$$protocol=d.protocol,b.$$host=d.hostname,b.$$port=m(d.port)||ee[d.protocol]||null}function gc(a,b,c){var d="/"!==a.charAt(0);d&&(a="/"+a);var e=Mc(a,c);b.$$path=decodeURIComponent(d&&"/"===e.pathname.charAt(0)?e.pathname.substring(1):e.pathname),b.$$search=W(e.search),b.$$hash=decodeURIComponent(e.hash),b.$$path&&"/"!=b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function hc(a,b){return 0===b.indexOf(a)?b.substr(a.length):void 0}function ic(a){var b=a.indexOf("#");return-1==b?a:a.substr(0,b)}function jc(a){return a.substr(0,ic(a).lastIndexOf("/")+1)}function kc(a){return a.substring(0,a.indexOf("/",a.indexOf("//")+2))}function lc(a,b){this.$$html5=!0,b=b||"";var d=jc(a);fc(a,this,a),this.$$parse=function(b){var c=hc(d,b);if(!u(c))throw fe("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',b,d);gc(c,this,a),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var a=X(this.$$search),b=this.$$hash?"#"+Y(this.$$hash):"";this.$$url=ec(this.$$path)+(a?"?"+a:"")+b,this.$$absUrl=d+this.$$url.substr(1)},this.$$rewrite=function(e){var f,g;return(f=hc(a,e))!==c?(g=f,(f=hc(b,f))!==c?d+(hc("/",f)||f):a+g):(f=hc(d,e))!==c?d+f:d==e+"/"?d:void 0}}function mc(a,b){var c=jc(a);fc(a,this,a),this.$$parse=function(d){function e(a,b,c){var d,e=/^\/?.*?:(\/.*)/;return 0===b.indexOf(c)&&(b=b.replace(c,"")),e.exec(b)?a:(d=e.exec(a),d?d[1]:a)}var f=hc(a,d)||hc(c,d),g="#"==f.charAt(0)?hc(b,f):this.$$html5?f:"";if(!u(g))throw fe("ihshprfx",'Invalid url "{0}", missing hash prefix "{1}".',d,b);gc(g,this,a),this.$$path=e(this.$$path,g,a),this.$$compose()},this.$$compose=function(){var c=X(this.$$search),d=this.$$hash?"#"+Y(this.$$hash):"";this.$$url=ec(this.$$path)+(c?"?"+c:"")+d,this.$$absUrl=a+(this.$$url?b+this.$$url:"")},this.$$rewrite=function(b){return ic(a)==ic(b)?b:void 0}}function nc(a,b){this.$$html5=!0,mc.apply(this,arguments);var c=jc(a);this.$$rewrite=function(d){var e;return a==ic(d)?d:(e=hc(c,d))?a+b+e:c===d+"/"?c:void 0}}function oc(a){return function(){return this[a]}}function pc(a,b){return function(c){return r(c)?this[a]:(this[a]=b(c),this.$$compose(),this)}}function qc(){var b="",c=!1;this.hashPrefix=function(a){return s(a)?(b=a,this):b},this.html5Mode=function(a){return s(a)?(c=a,this):c},this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(d,e,f,g){function h(a){d.$broadcast("$locationChangeSuccess",i.absUrl(),a)}var i,j,k,l=e.baseHref(),m=e.url();c?(k=kc(m)+(l||"/"),j=f.history?lc:nc):(k=ic(m),j=mc),i=new j(k,"#"+b),i.$$parse(i.$$rewrite(m)),g.on("click",function(b){if(!b.ctrlKey&&!b.metaKey&&2!=b.which){for(var c=sd(b.target);"a"!==md(c[0].nodeName);)if(c[0]===g[0]||!(c=c.parent())[0])return;var f=c.prop("href");t(f)&&"[object SVGAnimatedString]"===f.toString()&&(f=Mc(f.animVal).href);var h=i.$$rewrite(f);f&&!c.attr("target")&&h&&!b.isDefaultPrevented()&&(b.preventDefault(),h!=e.url()&&(i.$$parse(h),d.$apply(),a.angular["ff-684208-preventDefault"]=!0))}}),i.absUrl()!=m&&e.url(i.absUrl(),!0),e.onUrlChange(function(a){i.absUrl()!=a&&(d.$evalAsync(function(){var b=i.absUrl();i.$$parse(a),d.$broadcast("$locationChangeStart",a,b).defaultPrevented?(i.$$parse(b),e.url(b)):h(b)}),d.$$phase||d.$digest())});var n=0;return d.$watch(function(){var a=e.url(),b=i.$$replace;return n&&a==i.absUrl()||(n++,d.$evalAsync(function(){d.$broadcast("$locationChangeStart",i.absUrl(),a).defaultPrevented?i.$$parse(a):(e.url(i.absUrl(),b),h(a))})),i.$$replace=!1,n}),i}]}function rc(){var a=!0,b=this;this.debugEnabled=function(b){return s(b)?(a=b,this):a},this.$get=["$window",function(c){function d(a){return 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)),a}function e(a){var b=c.console||{},e=b[a]||b.log||o,g=!1;try{g=!!e.apply}catch(h){}return g?function(){var a=[];return f(arguments,function(b){a.push(d(b))}),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(){a&&c.apply(b,arguments)}}()}}]}function sc(a,b){if("constructor"===a)throw he("isecfld",'Referencing "constructor" field in Angular expressions is disallowed! Expression: {0}',b);return a}function tc(a,b){if(a){if(a.constructor===a)throw he("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",b);if(a.document&&a.location&&a.alert&&a.setInterval)throw he("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",b);if(a.children&&(a.nodeName||a.prop&&a.attr&&a.find))throw he("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",b)}return a}function uc(a,b,d,e,f){f=f||{};for(var g,h=b.split("."),i=0;h.length>1;i++){g=sc(h.shift(),e);var j=a[g];j||(j={},a[g]=j),a=j,a.then&&f.unwrapPromises&&(ge(e),"$$v"in a||!function(a){a.then(function(b){a.$$v=b})}(a),a.$$v===c&&(a.$$v={}),a=a.$$v)}return g=sc(h.shift(),e),a[g]=d,d}function vc(a,b,d,e,f,g,h){return sc(a,g),sc(b,g),sc(d,g),sc(e,g),sc(f,g),h.unwrapPromises?function(h,i){var j,k=i&&i.hasOwnProperty(a)?i:h;return null==k?k:(k=k[a],k&&k.then&&(ge(g),"$$v"in k||(j=k,j.$$v=c,j.then(function(a){j.$$v=a})),k=k.$$v),b?null==k?c:(k=k[b],k&&k.then&&(ge(g),"$$v"in k||(j=k,j.$$v=c,j.then(function(a){j.$$v=a})),k=k.$$v),d?null==k?c:(k=k[d],k&&k.then&&(ge(g),"$$v"in k||(j=k,j.$$v=c,j.then(function(a){j.$$v=a})),k=k.$$v),e?null==k?c:(k=k[e],k&&k.then&&(ge(g),"$$v"in k||(j=k,j.$$v=c,j.then(function(a){j.$$v=a})),k=k.$$v),f?null==k?c:(k=k[f],k&&k.then&&(ge(g),"$$v"in k||(j=k,j.$$v=c,j.then(function(a){j.$$v=a})),k=k.$$v),k):k):k):k):k)}:function(g,h){var i=h&&h.hasOwnProperty(a)?h:g;return null==i?i:(i=i[a],b?null==i?c:(i=i[b],d?null==i?c:(i=i[d],e?null==i?c:(i=i[e],f?null==i?c:i=i[f]:i):i):i):i)}}function wc(a,b){return sc(a,b),function(b,d){return null==b?c:(d&&d.hasOwnProperty(a)?d:b)[a]}}function xc(a,b,d){return sc(a,d),sc(b,d),function(d,e){return null==d?c:(d=(e&&e.hasOwnProperty(a)?e:d)[a],null==d?c:d[b])}}function yc(a,b,d){if(ne.hasOwnProperty(a))return ne[a];var e,g=a.split("."),h=g.length;if(b.unwrapPromises||1!==h)if(b.unwrapPromises||2!==h)if(b.csp)e=6>h?vc(g[0],g[1],g[2],g[3],g[4],d,b):function(a,e){var f,i=0;do f=vc(g[i++],g[i++],g[i++],g[i++],g[i++],d,b)(a,e),e=c,a=f;while(h>i);return f};else{var i="var p;\n";f(g,function(a,c){sc(a,d),i+="if(s == null) return undefined;\ns="+(c?"s":'((k&&k.hasOwnProperty("'+a+'"))?k:s)')+'["'+a+'"];\n'+(b.unwrapPromises?'if (s && s.then) {\n pw("'+d.replace(/(["\r\n])/g,"\\$1")+'");\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n':"")}),i+="return s;";var j=new Function("s","k","pw",i);j.toString=q(i),e=b.unwrapPromises?function(a,b){return j(a,b,ge)}:j}else e=xc(g[0],g[1],d);else e=wc(g[0],d);return"hasOwnProperty"!==a&&(ne[a]=e),e}function zc(){var a={},b={csp:!1,unwrapPromises:!1,logPromiseWarnings:!0};this.unwrapPromises=function(a){return s(a)?(b.unwrapPromises=!!a,this):b.unwrapPromises},this.logPromiseWarnings=function(a){return s(a)?(b.logPromiseWarnings=a,this):b.logPromiseWarnings},this.$get=["$filter","$sniffer","$log",function(c,d,e){return b.csp=d.csp,ge=function(a){b.logPromiseWarnings&&!ie.hasOwnProperty(a)&&(ie[a]=!0,e.warn("[$parse] Promise found in the expression `"+a+"`. Automatic unwrapping of promises in Angular expressions is deprecated."))},function(d){var e;switch(typeof d){case"string":if(a.hasOwnProperty(d))return a[d];var f=new le(b),g=new me(f,c,b);return e=g.parse(d,!1),"hasOwnProperty"!==d&&(a[d]=e),e;case"function":return d;default:return o}}}]}function Ac(){this.$get=["$rootScope","$exceptionHandler",function(a,b){return Bc(function(b){a.$evalAsync(b)},b)}]}function Bc(a,b){function d(a){return a}function e(a){return j(a)}function g(a){var b=h(),c=0,d=x(a)?[]:{};return f(a,function(a,e){c++,i(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),b.promise}var h=function(){var f,g,j=[];return g={resolve:function(b){if(j){var d=j;j=c,f=i(b),d.length&&a(function(){for(var a,b=0,c=d.length;c>b;b++)a=d[b],f.then(a[0],a[1],a[2])})}},reject:function(a){g.resolve(k(a))},notify:function(b){if(j){var c=j;j.length&&a(function(){for(var a,d=0,e=c.length;e>d;d++)a=c[d],a[2](b)})}},promise:{then:function(a,c,g){var i=h(),k=function(c){try{i.resolve((y(a)?a:d)(c))}catch(e){i.reject(e),b(e)}},l=function(a){try{i.resolve((y(c)?c:e)(a))}catch(d){i.reject(d),b(d)}},m=function(a){try{i.notify((y(g)?g:d)(a))}catch(c){b(c)}};return j?j.push([k,l,m]):f.then(k,l,m),i.promise},"catch":function(a){return this.then(null,a)},"finally":function(a){function b(a,b){var c=h();return b?c.resolve(a):c.reject(a),c.promise}function c(c,e){var f=null;try{f=(a||d)()}catch(g){return b(g,!1)}return f&&y(f.then)?f.then(function(){return b(c,e)},function(a){return b(a,!1)}):b(c,e)}return this.then(function(a){return c(a,!0)},function(a){return c(a,!1)})}}}},i=function(b){return b&&y(b.then)?b:{then:function(c){var d=h();return a(function(){d.resolve(c(b))}),d.promise}}},j=function(a){var b=h();return b.reject(a),b.promise},k=function(c){return{then:function(d,f){var g=h();return a(function(){try{g.resolve((y(f)?f:e)(c))}catch(a){g.reject(a),b(a)}}),g.promise}}},l=function(c,f,g,k){var l,m=h(),n=function(a){try{return(y(f)?f:d)(a)}catch(c){return b(c),j(c)}},o=function(a){try{return(y(g)?g:e)(a)}catch(c){return b(c),j(c)}},p=function(a){try{return(y(k)?k:d)(a)}catch(c){b(c)}};return a(function(){i(c).then(function(a){l||(l=!0,m.resolve(i(a).then(n,o,p)))},function(a){l||(l=!0,m.resolve(o(a)))},function(a){l||m.notify(p(a))})}),m.promise};return{defer:h,reject:j,when:l,all:g}}function Cc(){this.$get=["$window","$timeout",function(a,b){var c=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame,d=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelRequestAnimationFrame,e=!!c,f=e?function(a){var b=c(a);return function(){d(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};return f.supported=e,f}]}function Dc(){var a=10,b=d("$rootScope"),c=null;this.digestTtl=function(b){return arguments.length&&(a=b),a},this.$get=["$injector","$exceptionHandler","$parse","$browser",function(d,g,h,i){function k(){this.$id=j(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this["this"]=this.$root=this,this.$$destroyed=!1,this.$$asyncQueue=[],this.$$postDigestQueue=[],this.$$listeners={},this.$$listenerCount={},this.$$isolateBindings={}}function l(a){if(r.$$phase)throw b("inprog","{0} already in progress",r.$$phase);r.$$phase=a}function m(){r.$$phase=null}function n(a,b){var c=h(a);return db(c,b),c}function p(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function q(){}k.prototype={constructor:k,$new:function(a){var b,c;return a?(c=new k,c.$root=this.$root,c.$$asyncQueue=this.$$asyncQueue,c.$$postDigestQueue=this.$$postDigestQueue):(b=function(){},b.prototype=this,c=new b,c.$id=j()),c["this"]=c,c.$$listeners={},c.$$listenerCount={},c.$parent=this,c.$$watchers=c.$$nextSibling=c.$$childHead=c.$$childTail=null,c.$$prevSibling=this.$$childTail,this.$$childHead?(this.$$childTail.$$nextSibling=c,this.$$childTail=c):this.$$childHead=this.$$childTail=c,c},$watch:function(a,b,d){var e=this,f=n(a,"watch"),g=e.$$watchers,h={fn:b,last:q,get:f,exp:a,eq:!!d};if(c=null,!y(b)){var i=n(b||o,"listener");h.fn=function(a,b,c){i(c)}}if("string"==typeof a&&f.constant){var j=h.fn;h.fn=function(a,b,c){j.call(this,a,b,c),I(g,h)}}return g||(g=e.$$watchers=[]),g.unshift(h),function(){I(g,h),c=null}},$watchCollection:function(a,b){function c(){f=m(j);var a,b;if(t(f))if(e(f)){g!==n&&(g=n,q=g.length=0,l++),a=f.length,q!==a&&(l++,g.length=q=a);for(var c=0;a>c;c++){var d=g[c]!==g[c]&&f[c]!==f[c];d||g[c]===f[c]||(l++,g[c]=f[c])}}else{g!==o&&(g=o={},q=0,l++),a=0;for(b in f)f.hasOwnProperty(b)&&(a++,g.hasOwnProperty(b)?g[b]!==f[b]&&(l++,g[b]=f[b]):(q++,g[b]=f[b],l++));if(q>a){l++;for(b in g)g.hasOwnProperty(b)&&!f.hasOwnProperty(b)&&(q--,delete g[b])}}else g!==f&&(g=f,l++);return l}function d(){if(p?(p=!1,b(f,f,j)):b(f,i,j),k)if(t(f))if(e(f)){i=new Array(f.length);for(var a=0;a1,l=0,m=h(a),n=[],o={},p=!0,q=0;return this.$watch(c,d)},$digest:function(){var d,e,f,h,i,j,k,n,o,p,r,s=this.$$asyncQueue,t=this.$$postDigestQueue,u=a,v=this,w=[];l("$digest"),c=null;do{for(j=!1,n=v;s.length;){try{r=s.shift(),r.scope.$eval(r.expression)}catch(x){m(),g(x)}c=null}a:do{if(h=n.$$watchers)for(i=h.length;i--;)try{if(d=h[i])if((e=d.get(n))===(f=d.last)||(d.eq?L(e,f):"number"==typeof e&&"number"==typeof f&&isNaN(e)&&isNaN(f))){if(d===c){j=!1;break a}}else j=!0,c=d,d.last=d.eq?J(e):e,d.fn(e,f===q?e:f,n),5>u&&(o=4-u,w[o]||(w[o]=[]),p=y(d.exp)?"fn: "+(d.exp.name||d.exp.toString()):d.exp,p+="; newVal: "+R(e)+"; oldVal: "+R(f),w[o].push(p))}catch(x){m(),g(x)}if(!(k=n.$$childHead||n!==v&&n.$$nextSibling))for(;n!==v&&!(k=n.$$nextSibling);)n=n.$parent}while(n=k);if((j||s.length)&&!u--)throw m(),b("infdig","{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}",a,R(w))}while(j||s.length);for(m();t.length;)try{t.shift()()}catch(x){g(x)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy"),this.$$destroyed=!0,this!==r&&(f(this.$$listenerCount,P(null,p,this)),a.$$childHead==this&&(a.$$childHead=this.$$nextSibling),a.$$childTail==this&&(a.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=null,this.$$listeners={},this.$$watchers=this.$$asyncQueue=this.$$postDigestQueue=[],this.$destroy=this.$digest=this.$apply=o,this.$on=this.$watch=function(){return o})}},$eval:function(a,b){return h(a)(this,b)},$evalAsync:function(a){r.$$phase||r.$$asyncQueue.length||i.defer(function(){r.$$asyncQueue.length&&r.$digest()}),this.$$asyncQueue.push({scope:this,expression:a})},$$postDigest:function(a){this.$$postDigestQueue.push(a)},$apply:function(a){try{return l("$apply"),this.$eval(a)}catch(b){g(b)}finally{m();try{r.$digest()}catch(b){throw g(b),b}}},$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(){c[H(c,b)]=null,p(e,1,a)}},$emit:function(a){var b,c,d,e=[],f=this,h=!1,i={name:a,targetScope:f,stopPropagation:function(){h=!0},preventDefault:function(){i.defaultPrevented=!0},defaultPrevented:!1},j=N([i],arguments,1);do{for(b=f.$$listeners[a]||e,i.currentScope=f,c=0,d=b.length;d>c;c++)if(b[c])try{b[c].apply(null,j)}catch(k){g(k)}else b.splice(c,1),c--,d--;if(h)return i;f=f.$parent}while(f);return i},$broadcast:function(a){for(var b,c,d,e=this,f=e,h=e,i={name:a,targetScope:e,preventDefault:function(){i.defaultPrevented=!0},defaultPrevented:!1},j=N([i],arguments,1);f=h;){for(i.currentScope=f,b=f.$$listeners[a]||[],c=0,d=b.length;d>c;c++)if(b[c])try{b[c].apply(null,j)}catch(k){g(k)}else b.splice(c,1),c--,d--;if(!(h=f.$$listenerCount[a]&&f.$$childHead||f!==e&&f.$$nextSibling))for(;f!==e&&!(h=f.$$nextSibling);)f=f.$parent}return i}};var r=new k;return r}]}function Ec(){var a=/^\s*(https?|ftp|mailto|tel|file):/,b=/^\s*(https?|ftp|file):|data:image\//;this.aHrefSanitizationWhitelist=function(b){return s(b)?(a=b,this):a},this.imgSrcSanitizationWhitelist=function(a){return s(a)?(b=a,this):b},this.$get=function(){return function(c,d){var e,f=d?b:a;return rd&&!(rd>=8)||(e=Mc(c).href,""===e||e.match(f))?c:"unsafe:"+e}}}function Fc(a){return a.replace(/([-()\[\]{}+?*.$\^|,:#-1)throw oe("iwcard","Illegal sequence *** in string matcher. String: {0}",a);return a=Fc(a).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*"),new RegExp("^"+a+"$")}if(z(a))return new RegExp("^"+a.source+"$");throw oe("imatcher",'Matchers may only be "self", string patterns or RegExp objects')}function Hc(a){var b=[];return s(a)&&f(a,function(a){b.push(Gc(a))}),b}function Ic(){this.SCE_CONTEXTS=pe;var a=["self"],b=[];this.resourceUrlWhitelist=function(b){return arguments.length&&(a=Hc(b)),a},this.resourceUrlBlacklist=function(a){return arguments.length&&(b=Hc(a)),b},this.$get=["$injector",function(d){function e(a,b){return"self"===a?Nc(b):!!a.exec(b.href)}function f(c){var d,f,g=Mc(c.toString()),h=!1;for(d=0,f=a.length;f>d;d++)if(e(a[d],g)){h=!0;break}if(h)for(d=0,f=b.length;f>d;d++)if(e(b[d],g)){h=!1;break}return h}function g(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};return a&&(b.prototype=new a),b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},b}function h(a,b){var d=m.hasOwnProperty(a)?m[a]:null;if(!d)throw oe("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",a,b);if(null===b||b===c||""===b)return b;if("string"!=typeof b)throw oe("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",a);return new d(b)}function i(a){return a instanceof l?a.$$unwrapTrustedValue():a}function j(a,b){if(null===b||b===c||""===b)return b;var d=m.hasOwnProperty(a)?m[a]:null;if(d&&b instanceof d)return b.$$unwrapTrustedValue();if(a===pe.RESOURCE_URL){if(f(b))return b;throw oe("insecurl","Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",b.toString())}if(a===pe.HTML)return k(b);throw oe("unsafe","Attempting to use an unsafe value in a safe context.")}var k=function(){throw oe("unsafe","Attempting to use an unsafe value in a safe context.")};d.has("$sanitize")&&(k=d.get("$sanitize"));var l=g(),m={};return m[pe.HTML]=g(l),m[pe.CSS]=g(l),m[pe.URL]=g(l),m[pe.JS]=g(l),m[pe.RESOURCE_URL]=g(m[pe.URL]),{trustAs:h,getTrusted:j,valueOf:i}}]}function Jc(){var a=!0;this.enabled=function(b){return arguments.length&&(a=!!b),a},this.$get=["$parse","$sniffer","$sceDelegate",function(b,c,d){if(a&&c.msie&&c.msieDocumentMode<8)throw oe("iequirks","Strict Contextual Escaping does not support Internet Explorer version < 9 in quirks mode. You can fix this by adding the text to the top of your HTML document. See http://docs.angularjs.org/api/ng.$sce for more information.");var e=J(pe);e.isEnabled=function(){return a},e.trustAs=d.trustAs,e.getTrusted=d.getTrusted,e.valueOf=d.valueOf,a||(e.trustAs=e.getTrusted=function(a,b){return b},e.valueOf=p),e.parseAs=function(a,c){var d=b(c);return d.literal&&d.constant?d:function(b,c){return e.getTrusted(a,d(b,c))}};var g=e.parseAs,h=e.getTrusted,i=e.trustAs;return f(pe,function(a,b){var c=md(b);e[kb("parse_as_"+c)]=function(b){return g(a,b)},e[kb("get_trusted_"+c)]=function(b){return h(a,b)},e[kb("trust_as_"+c)]=function(b){return i(a,b)}}),e}]}function Kc(){this.$get=["$window","$document",function(a,b){var c,d,e={},f=m((/android (\d+)/.exec(md((a.navigator||{}).userAgent))||[])[1]),g=/Boxee/i.test((a.navigator||{}).userAgent),h=b[0]||{},i=h.documentMode,j=/^(Moz|webkit|O|ms)(?=[A-Z])/,k=h.body&&h.body.style,l=!1,n=!1;if(k){for(var o in k)if(d=j.exec(o)){c=d[0],c=c.substr(0,1).toUpperCase()+c.substr(1);break}c||(c="WebkitOpacity"in k&&"webkit"),l=!!("transition"in k||c+"Transition"in k),n=!!("animation"in k||c+"Animation"in k),!f||l&&n||(l=u(h.body.style.webkitTransition),n=u(h.body.style.webkitAnimation))}return{history:!(!a.history||!a.history.pushState||4>f||g),hashchange:"onhashchange"in a&&(!i||i>7),hasEvent:function(a){if("input"==a&&9==rd)return!1;if(r(e[a])){var b=h.createElement("div");e[a]="on"+a in b}return e[a]},csp:M(),vendorPrefix:c,transitions:l,animations:n,android:f,msie:rd,msieDocumentMode:i}}]}function Lc(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(a,b,c,d){function e(e,g,h){var i,j=c.defer(),k=j.promise,l=s(h)&&!h;return i=b.defer(function(){try{j.resolve(e())}catch(b){j.reject(b),d(b)}finally{delete f[k.$$timeoutId]}l||a.$apply()},g),k.$$timeoutId=i,f[i]=j,k}var f={};return e.cancel=function(a){return a&&a.$$timeoutId in f?(f[a.$$timeoutId].reject("canceled"),delete f[a.$$timeoutId],b.defer.cancel(a.$$timeoutId)):!1},e}]}function Mc(a){var b=a;return rd&&(qe.setAttribute("href",b),b=qe.href),qe.setAttribute("href",b),{href:qe.href,protocol:qe.protocol?qe.protocol.replace(/:$/,""):"",host:qe.host,search:qe.search?qe.search.replace(/^\?/,""):"",hash:qe.hash?qe.hash.replace(/^#/,""):"",hostname:qe.hostname,port:qe.port,pathname:"/"===qe.pathname.charAt(0)?qe.pathname:"/"+qe.pathname}}function Nc(a){var b=u(a)?Mc(a):a;return b.protocol===re.protocol&&b.host===re.host}function Oc(){this.$get=q(a)}function Pc(a){function b(d,e){if(t(d)){var g={};return f(d,function(a,c){g[c]=b(c,a)}),g}return a.factory(d+c,e)}var c="Filter";this.register=b,this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}],b("currency",Rc),b("date",Zc),b("filter",Qc),b("json",$c),b("limitTo",_c),b("lowercase",we),b("number",Sc),b("orderBy",ad),b("uppercase",xe)}function Qc(){return function(a,b,c){if(!x(a))return a;var d=typeof c,e=[];e.check=function(a){for(var b=0;b-1});var f=function(a,b){if("string"==typeof b&&"!"===b.charAt(0))return!f(a,b.substr(1));switch(typeof a){case"boolean":case"number":case"string":return c(a,b);case"object":switch(typeof b){case"object":return c(a,b);default:for(var d in a)if("$"!==d.charAt(0)&&f(a[d],b))return!0}return!1;case"array":for(var e=0;ea;a=Math.abs(a);var g=a+"",h="",i=[],j=!1;if(-1!==g.indexOf("e")){var k=g.match(/([\d\.]+)e(-?)(\d+)/);k&&"-"==k[2]&&k[3]>e+1?g="0":(h=g,j=!0)}if(j)e>0&&a>-1&&1>a&&(h=a.toFixed(e));else{var l=(g.split(se)[1]||"").length;r(e)&&(e=Math.min(Math.max(b.minFrac,l),b.maxFrac));var m=Math.pow(10,e);a=Math.round(a*m)/m;var n=(""+a).split(se),o=n[0];n=n[1]||"";var p,q=0,s=b.lgSize,u=b.gSize;if(o.length>=s+u)for(q=o.length-s,p=0;q>p;p++)(q-p)%u===0&&0!==p&&(h+=c),h+=o.charAt(p);for(p=q;pa&&(d="-",a=-a),a=""+a;a.length0||f>-c)&&(f+=c),0===f&&-12==c&&(f=12),Uc(f,b,d)}}function Wc(a,b){return function(c,d){var e=c["get"+a](),f=od(b?"SHORT"+a:a);return d[f][e]}}function Xc(a){var b=-1*a.getTimezoneOffset(),c=b>=0?"+":"";return c+=Uc(Math[b>0?"floor":"ceil"](b/60),2)+Uc(Math.abs(b%60),2)}function Yc(a,b){return a.getHours()<12?b.AMPMS[0]:b.AMPMS[1]}function Zc(a){function b(a){var b;if(b=a.match(c)){var d=new Date(0),e=0,f=0,g=b[8]?d.setUTCFullYear:d.setFullYear,h=b[8]?d.setUTCHours:d.setHours;b[9]&&(e=m(b[9]+b[10]),f=m(b[9]+b[11])),g.call(d,m(b[1]),m(b[2])-1,m(b[3]));var i=m(b[4]||0)-e,j=m(b[5]||0)-f,k=m(b[6]||0),l=Math.round(1e3*parseFloat("0."+(b[7]||0)));return h.call(d,i,j,k,l),d}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,d){var e,g,h="",i=[];if(d=d||"mediumDate",d=a.DATETIME_FORMATS[d]||d,u(c)&&(c=ve.test(c)?m(c):b(c)),v(c)&&(c=new Date(c)),!w(c))return c;for(;d;)g=ue.exec(d),g?(i=N(i,g,1),d=i.pop()):(i.push(d),d=null);return f(i,function(b){e=te[b],h+=e?e(c,a.DATETIME_FORMATS):b.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),h}}function $c(){return function(a){return R(a,!0)}}function _c(){return function(a,b){if(!x(a)&&!u(a))return a;if(b=m(b),u(a))return b?b>=0?a.slice(0,b):a.slice(b,a.length):"";var c,d,e=[];for(b>a.length?b=a.length:b<-a.length&&(b=-a.length),b>0?(c=0,d=b):(c=a.length+b,d=a.length);d>c;c++)e.push(a[c]);return e}}function ad(a){return function(b,c,d){function e(a,b){for(var d=0;da?-1:1):d>c?-1:1}if(!x(b))return b;if(!c)return b;c=x(c)?c:[c],c=F(c,function(b){var c=!1,d=b||p;if(u(b)&&(("+"==b.charAt(0)||"-"==b.charAt(0))&&(c="-"==b.charAt(0),b=b.substring(1)),d=a(b),d.constant)){var e=d();return f(function(a,b){return g(a[e],b[e])},c)}return f(function(a,b){return g(d(a),d(b))},c)});for(var h=[],i=0;i15&&19>b||b>=37&&40>=b||l()}),f.hasEvent("paste")&&b.on("paste cut",l)}b.on("change",j),e.$render=function(){b.val(e.$isEmpty(e.$viewValue)?"":e.$viewValue)};var n,o,p=c.ngPattern;if(p){var q=function(a,b){return dd(e,"pattern",e.$isEmpty(b)||a.test(b),b)};o=p.match(/^\/(.*)\/([gim]*)$/),o?(p=new RegExp(o[1],o[2]),n=function(a){return q(p,a)}):n=function(c){var e=a.$eval(p);if(!e||!e.test)throw d("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",p,e,U(b));return q(e,c)},e.$formatters.push(n),e.$parsers.push(n)}if(c.ngMinlength){var r=m(c.ngMinlength),s=function(a){return dd(e,"minlength",e.$isEmpty(a)||a.length>=r,a)};e.$parsers.push(s),e.$formatters.push(s)}if(c.ngMaxlength){var t=m(c.ngMaxlength),u=function(a){return dd(e,"maxlength",e.$isEmpty(a)||a.length<=t,a)};e.$parsers.push(u),e.$formatters.push(u)}}function gd(a,b,d,e,f,g){if(fd(a,b,d,e,f,g),e.$parsers.push(function(a){var b=e.$isEmpty(a);return b||Ge.test(a)?(e.$setValidity("number",!0),""===a?null:b?a:parseFloat(a)):(e.$setValidity("number",!1),c)}),ed(e,"number",b),e.$formatters.push(function(a){return e.$isEmpty(a)?"":""+a}),d.min){var h=function(a){var b=parseFloat(d.min);return dd(e,"min",e.$isEmpty(a)||a>=b,a)};e.$parsers.push(h),e.$formatters.push(h)}if(d.max){var i=function(a){var b=parseFloat(d.max);return dd(e,"max",e.$isEmpty(a)||b>=a,a)};e.$parsers.push(i),e.$formatters.push(i)}e.$formatters.push(function(a){return dd(e,"number",e.$isEmpty(a)||v(a),a)})}function hd(a,b,c,d,e,f){fd(a,b,c,d,e,f);var g=function(a){return dd(d,"url",d.$isEmpty(a)||Ee.test(a),a)};d.$formatters.push(g),d.$parsers.push(g)}function id(a,b,c,d,e,f){fd(a,b,c,d,e,f);var g=function(a){return dd(d,"email",d.$isEmpty(a)||Fe.test(a),a)};d.$formatters.push(g),d.$parsers.push(g)}function jd(a,b,c,d){r(c.name)&&b.attr("name",j()),b.on("click",function(){b[0].checked&&a.$apply(function(){d.$setViewValue(c.value)})}),d.$render=function(){var a=c.value;b[0].checked=a==d.$viewValue},c.$observe("value",d.$render)}function kd(a,b,c,d){var e=c.ngTrueValue,f=c.ngFalseValue;u(e)||(e=!0),u(f)||(f=!1),b.on("click",function(){a.$apply(function(){d.$setViewValue(b[0].checked)})}),d.$render=function(){b[0].checked=d.$viewValue},d.$isEmpty=function(a){return a!==e},d.$formatters.push(function(a){return a===e}),d.$parsers.push(function(a){return a?e:f})}function ld(a,b){return a="ngClass"+a,["$animate",function(c){function d(a,b){var c=[];a:for(var d=0;d0||c[a])&&(c[a]=(c[a]||0)+b,c[a]===+(b>0)&&d.push(a))}),h.data("$classCounts",c),d.join(" ")}function m(a,b){var e=d(b,a),f=d(a,b);f=l(f,-1),e=l(e,1),0===e.length?c.removeClass(h,f):0===f.length?c.addClass(h,e):c.setClass(h,e,f)}function n(a){if(b===!0||g.$index%2===b){var c=e(a||[]);if(o){if(!L(a,o)){var d=e(o);m(d,c)}}else j(c)}o=J(a)}var o;g.$watch(i[a],n,!0),i.$observe("class",function(){n(g.$eval(i[a]))}),"ngClass"!==a&&g.$watch("$index",function(c,d){var f=1&c;if(f!==d&1){var h=e(g.$eval(i[a]));f===b?j(h):k(h)}})}}}]}var md=function(a){return u(a)?a.toLowerCase():a},nd=Object.prototype.hasOwnProperty,od=function(a){return u(a)?a.toUpperCase():a},pd=function(a){return u(a)?a.replace(/[A-Z]/g,function(a){return String.fromCharCode(32|a.charCodeAt(0))}):a},qd=function(a){return u(a)?a.replace(/[a-z]/g,function(a){return String.fromCharCode(-33&a.charCodeAt(0))}):a};"i"!=="I".toLowerCase()&&(md=pd,od=qd);var rd,sd,td,ud,vd,wd=[].slice,xd=[].push,yd=Object.prototype.toString,zd=d("ng"),Ad=(a.angular,a.angular||(a.angular={})),Bd=["0","0","0"];rd=m((/msie (\d+)/.exec(md(navigator.userAgent))||[])[1]),isNaN(rd)&&(rd=m((/trident\/.*; rv:(\d+)/.exec(md(navigator.userAgent))||[])[1])),o.$inject=[],p.$inject=[]; var Cd=function(){return String.prototype.trim?function(a){return u(a)?a.trim():a}:function(a){return u(a)?a.replace(/^\s\s*/,"").replace(/\s\s*$/,""):a}}();vd=9>rd?function(a){return a=a.nodeName?a:a[0],a.scopeName&&"HTML"!=a.scopeName?od(a.scopeName+":"+a.nodeName):a.nodeName}:function(a){return a.nodeName?a.nodeName:a[0].nodeName};var Dd=/[A-Z]/g,Ed={full:"1.2.16",major:1,minor:2,dot:16,codeName:"badger-enumeration"},Fd=pb.cache={},Gd=pb.expando="ng-"+(new Date).getTime(),Hd=1,Id=a.document.addEventListener?function(a,b,c){a.addEventListener(b,c,!1)}:function(a,b,c){a.attachEvent("on"+b,c)},Jd=a.document.removeEventListener?function(a,b,c){a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent("on"+b,c)},Kd=(pb._data=function(a){return this.cache[a[this.expando]]||{}},/([\:\-\_]+(.))/g),Ld=/^moz([A-Z])/,Md=d("jqLite"),Nd=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Od=/<|&#?\w+;/,Pd=/<([\w:]+)/,Qd=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Rd={option:[1,'"],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Rd.optgroup=Rd.option,Rd.tbody=Rd.tfoot=Rd.colgroup=Rd.caption=Rd.thead,Rd.th=Rd.td;var Sd=pb.prototype={ready:function(c){function d(){e||(e=!0,c())}var e=!1;"complete"===b.readyState?setTimeout(d):(this.on("DOMContentLoaded",d),pb(a).on("load",d))},toString:function(){var a=[];return f(this,function(b){a.push(""+b)}),"["+a.join(", ")+"]"},eq:function(a){return sd(a>=0?this[a]:this[this.length+a])},length:0,push:xd,sort:[].sort,splice:[].splice},Td={};f("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(a){Td[md(a)]=a});var Ud={};f("input,select,option,textarea,button,form,details".split(","),function(a){Ud[od(a)]=!0}),f({data:vb,inheritedData:Bb,scope:function(a){return sd(a).data("$scope")||Bb(a.parentNode||a,["$isolateScope","$scope"])},isolateScope:function(a){return sd(a).data("$isolateScope")||sd(a).data("$isolateScopeNoTemplate")},controller:Ab,injector:function(a){return Bb(a,"$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:wb,css:function(a,b,d){if(b=kb(b),!s(d)){var e;return 8>=rd&&(e=a.currentStyle&&a.currentStyle[b],""===e&&(e="auto")),e=e||a.style[b],8>=rd&&(e=""===e?c:e),e}a.style[b]=d},attr:function(a,b,d){var e=md(b);if(Td[e]){if(!s(d))return a[b]||(a.attributes.getNamedItem(b)||o).specified?e:c;d?(a[b]=!0,a.setAttribute(b,e)):(a[b]=!1,a.removeAttribute(e))}else if(s(d))a.setAttribute(b,d);else if(a.getAttribute){var f=a.getAttribute(b,2);return null===f?c:f}},prop:function(a,b,c){return s(c)?void(a[b]=c):a[b]},text:function(){function a(a,c){var d=b[a.nodeType];return r(c)?d?a[d]:"":void(a[d]=c)}var b=[];return 9>rd?(b[1]="innerText",b[3]="nodeValue"):b[1]=b[3]="textContent",a.$dv="",a}(),val:function(a,b){if(r(b)){if("SELECT"===vd(a)&&a.multiple){var c=[];return f(a.options,function(a){a.selected&&c.push(a.value||a.text)}),0===c.length?null:c}return a.value}a.value=b},html:function(a,b){if(r(b))return a.innerHTML;for(var c=0,d=a.childNodes;ci;i++){var j=a(this[i],b,d);g=g?g+j:j}return g}for(e=0;e":function(a,b,c,d){return c(a,b)>d(a,b)},"<=":function(a,b,c,d){return c(a,b)<=d(a,b)},">=":function(a,b,c,d){return c(a,b)>=d(a,b)},"&&":function(a,b,c,d){return c(a,b)&&d(a,b)},"||":function(a,b,c,d){return c(a,b)||d(a,b)},"&":function(a,b,c,d){return c(a,b)&d(a,b)},"|":function(a,b,c,d){return d(a,b)(a,b,c(a,b))},"!":function(a,b,c){return!c(a,b)}},ke={n:"\n",f:"\f",r:"\r",t:" ",v:" ","'":"'",'"':'"'},le=function(a){this.options=a};le.prototype={constructor:le,lex:function(a){this.text=a,this.index=0,this.ch=c,this.lastCh=":",this.tokens=[];for(var b,d=[];this.index="0"&&"9">=a},isWhitespace:function(a){return" "===a||"\r"===a||" "===a||"\n"===a||" "===a||" "===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,b,c){c=c||this.index;var d=s(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,c)+"]":" "+c;throw he("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",a,d,this.text)},readNumber:function(){for(var a="",b=this.index;this.index0){var e=this.tokens[0],f=e.text;if(f===a||f===b||f===c||f===d||!a&&!b&&!c&&!d)return e}return!1},expect:function(a,b,c,d){var e=this.peek(a,b,c,d);return e?(this.json&&!e.json&&this.throwError("is not valid json",e),this.tokens.shift(),e):!1},consume:function(a){this.expect(a)||this.throwError("is unexpected, expecting ["+a+"]",this.peek())},unaryFn:function(a,b){return l(function(c,d){return a(c,d,b)},{constant:b.constant})},ternaryFn:function(a,b,c){return l(function(d,e){return a(d,e)?b(d,e):c(d,e)},{constant:a.constant&&b.constant&&c.constant})},binaryFn:function(a,b,c){return l(function(d,e){return b(d,e,a,c)},{constant:a.constant&&c.constant})},statements:function(){for(var a=[];;)if(this.tokens.length>0&&!this.peek("}",")",";","]")&&a.push(this.filterChain()),!this.expect(";"))return 1===a.length?a[0]:function(b,c){for(var d,e=0;e","<=",">="))&&(b=this.binaryFn(b,a.fn,this.relational())),b},additive:function(){for(var a,b=this.multiplicative();a=this.expect("+","-");)b=this.binaryFn(b,a.fn,this.multiplicative());return b},multiplicative:function(){for(var a,b=this.unary();a=this.expect("*","/","%");)b=this.binaryFn(b,a.fn,this.unary());return b},unary:function(){var a;return this.expect("+")?this.primary():(a=this.expect("-"))?this.binaryFn(me.ZERO,a.fn,this.unary()):(a=this.expect("!"))?this.unaryFn(a.fn,this.unary()):this.primary()},fieldAccess:function(a){var b=this,c=this.expect().text,d=yc(c,this.options,this.text);return l(function(b,c,e){return d(e||a(b,c))},{assign:function(d,e,f){return uc(a(d,f),c,e,b.text,b.options)}})},objectIndex:function(a){var b=this,d=this.expression();return this.consume("]"),l(function(e,f){var g,h,i=a(e,f),j=d(e,f);return i?(g=tc(i[j],b.text),g&&g.then&&b.options.unwrapPromises&&(h=g,"$$v"in g||(h.$$v=c,h.then(function(a){h.$$v=a})),g=g.$$v),g):c},{assign:function(c,e,f){var g=d(c,f),h=tc(a(c,f),b.text);return h[g]=e}})},functionCall:function(a,b){var c=[];if(")"!==this.peekToken().text)do c.push(this.expression());while(this.expect(","));this.consume(")");var d=this;return function(e,f){for(var g=[],h=b?b(e,f):e,i=0;i=rd&&(c.href||c.name||c.$set("href",""),a.append(b.createComment("IE fix"))),c.href||c.xlinkHref||c.name?void 0:function(a,b){var c="[object SVGAnimatedString]"===yd.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(c)||a.preventDefault()})}}}),ze={};f(Td,function(a,b){if("multiple"!=a){var c=Qb("ng-"+b);ze[c]=function(){return{priority:100,link:function(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}}}}}),f(["src","srcset","href"],function(a){var b=Qb("ng-"+a);ze[b]=function(){return{priority:99,link:function(c,d,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===yd.call(d.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null),e.$observe(b,function(a){a&&(e.$set(g,a),rd&&f&&d.prop(f,e[g]))})}}}});var Ae={$addControl:o,$removeControl:o,$setValidity:o,$setDirty:o,$setPristine:o};cd.$inject=["$element","$attrs","$scope","$animate"];var Be=function(a){return["$timeout",function(b){var d={name:"form",restrict:a?"EAC":"E",controller:cd,compile:function(){return{pre:function(a,d,e,f){if(!e.action){var g=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};Id(d[0],"submit",g),d.on("$destroy",function(){b(function(){Jd(d[0],"submit",g)},0,!1)})}var h=d.parent().controller("form"),i=e.name||e.ngForm;i&&uc(a,i,f,i),h&&d.on("$destroy",function(){h.$removeControl(f),i&&uc(a,i,c,i),l(f,Ae)})}}}};return d}]},Ce=Be(),De=Be(!0),Ee=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,Fe=/^[a-z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*$/i,Ge=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,He={text:fd,number:gd,url:hd,email:id,radio:jd,checkbox:kd,hidden:o,button:o,submit:o,reset:o,file:o},Ie=["$browser","$sniffer",function(a,b){return{restrict:"E",require:"?ngModel",link:function(c,d,e,f){f&&(He[md(e.type)]||He.text)(c,d,e,f,b,a)}}}],Je="ng-valid",Ke="ng-invalid",Le="ng-pristine",Me="ng-dirty",Ne=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate",function(a,b,c,e,g,h){function i(a,b){b=b?"-"+ab(b,"-"):"",h.removeClass(e,(a?Ke:Je)+b),h.addClass(e,(a?Je:Ke)+b)}this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$name=c.name;var j=g(c.ngModel),k=j.assign;if(!k)throw d("ngModel")("nonassign","Expression '{0}' is non-assignable. Element: {1}",c.ngModel,U(e));this.$render=o,this.$isEmpty=function(a){return r(a)||""===a||null===a||a!==a};var l=e.inheritedData("$formController")||Ae,m=0,n=this.$error={};e.addClass(Le),i(!0),this.$setValidity=function(a,b){n[a]!==!b&&(b?(n[a]&&m--,m||(i(!0),this.$valid=!0,this.$invalid=!1)):(i(!1),this.$invalid=!0,this.$valid=!1,m++),n[a]=!b,i(b,a),l.$setValidity(a,b,this))},this.$setPristine=function(){this.$dirty=!1,this.$pristine=!0,h.removeClass(e,Me),h.addClass(e,Le)},this.$setViewValue=function(c){this.$viewValue=c,this.$pristine&&(this.$dirty=!0,this.$pristine=!1,h.removeClass(e,Le),h.addClass(e,Me),l.$setDirty()),f(this.$parsers,function(a){c=a(c)}),this.$modelValue!==c&&(this.$modelValue=c,k(a,c),f(this.$viewChangeListeners,function(a){try{a()}catch(c){b(c)}}))};var p=this;a.$watch(function(){var b=j(a);if(p.$modelValue!==b){var c=p.$formatters,d=c.length;for(p.$modelValue=b;d--;)b=c[d](b);p.$viewValue!==b&&(p.$viewValue=b,p.$render())}return b})}],Oe=function(){return{require:["ngModel","^?form"],controller:Ne,link:function(a,b,c,d){var e=d[0],f=d[1]||Ae;f.$addControl(e),a.$on("$destroy",function(){f.$removeControl(e)})}}},Pe=q({require:"ngModel",link:function(a,b,c,d){d.$viewChangeListeners.push(function(){a.$eval(c.ngChange)})}}),Qe=function(){return{require:"?ngModel",link:function(a,b,c,d){if(d){c.required=!0;var e=function(a){return c.required&&d.$isEmpty(a)?void d.$setValidity("required",!1):(d.$setValidity("required",!0),a)};d.$formatters.push(e),d.$parsers.unshift(e),c.$observe("required",function(){e(d.$viewValue)})}}}},Re=function(){return{require:"ngModel",link:function(a,b,d,e){var g=/\/(.*)\//.exec(d.ngList),h=g&&new RegExp(g[1])||d.ngList||",",i=function(a){if(!r(a)){var b=[];return a&&f(a.split(h),function(a){a&&b.push(Cd(a))}),b}};e.$parsers.push(i),e.$formatters.push(function(a){return x(a)?a.join(", "):c}),e.$isEmpty=function(a){return!a||!a.length}}}},Se=/^(true|false|\d+)$/,Te=function(){return{priority:100,compile:function(a,b){return Se.test(b.ngValue)?function(a,b,c){c.$set("value",a.$eval(c.ngValue))}:function(a,b,c){a.$watch(c.ngValue,function(a){c.$set("value",a)})}}}},Ue=bd(function(a,b,d){b.addClass("ng-binding").data("$binding",d.ngBind),a.$watch(d.ngBind,function(a){b.text(a==c?"":a)})}),Ve=["$interpolate",function(a){return function(b,c,d){var e=a(c.attr(d.$attr.ngBindTemplate));c.addClass("ng-binding").data("$binding",e),d.$observe("ngBindTemplate",function(a){c.text(a)})}}],We=["$sce","$parse",function(a,b){return function(c,d,e){function f(){return(g(c)||"").toString()}d.addClass("ng-binding").data("$binding",e.ngBindHtml);var g=b(e.ngBindHtml);c.$watch(f,function(){d.html(a.getTrustedHtml(g(c))||"")})}}],Xe=ld("",!0),Ye=ld("Odd",0),Ze=ld("Even",1),$e=bd({compile:function(a,b){b.$set("ngCloak",c),a.removeClass("ng-cloak")}}),_e=[function(){return{scope:!0,controller:"@",priority:500}}],af={};f("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=Qb("ng-"+a);af[b]=["$parse",function(c){return{compile:function(d,e){var f=c(e[b]);return function(b,c){c.on(md(a),function(a){b.$apply(function(){f(b,{$event:a})})})}}}}]});var bf=["$animate",function(a){return{transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,g){var h,i,j;c.$watch(e.ngIf,function(f){T(f)?i||(i=c.$new(),g(i,function(c){c[c.length++]=b.createComment(" end ngIf: "+e.ngIf+" "),h={clone:c},a.enter(c,d.parent(),d)})):(j&&(j.remove(),j=null),i&&(i.$destroy(),i=null),h&&(j=gb(h.clone),a.leave(j,function(){j=null}),h=null))})}}}],cf=["$http","$templateCache","$anchorScroll","$animate","$sce",function(a,b,c,d,e){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:Ad.noop,compile:function(f,g){var h=g.ngInclude||g.src,i=g.onload||"",j=g.autoscroll;return function(f,g,k,l,m){var n,o,p,q=0,r=function(){o&&(o.remove(),o=null),n&&(n.$destroy(),n=null),p&&(d.leave(p,function(){o=null}),o=p,p=null)};f.$watch(e.parseAsResourceUrl(h),function(e){var h=function(){!s(j)||j&&!f.$eval(j)||c()},k=++q;e?(a.get(e,{cache:b}).success(function(a){if(k===q){var b=f.$new();l.template=a;var c=m(b,function(a){r(),d.enter(a,null,g,h)});n=b,p=c,n.$emit("$includeContentLoaded"),f.$eval(i)}}).error(function(){k===q&&r()}),f.$emit("$includeContentRequested")):(r(),l.template=null)})}}}}],df=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,c,d,e){c.html(e.template),a(c.contents())(b)}}}],ef=bd({priority:450,compile:function(){return{pre:function(a,b,c){a.$eval(c.ngInit)}}}}),ff=bd({terminal:!0,priority:1e3}),gf=["$locale","$interpolate",function(a,b){var c=/{}/g;return{restrict:"EA",link:function(d,e,g){var h=g.count,i=g.$attr.when&&e.attr(g.$attr.when),j=g.offset||0,k=d.$eval(i)||{},l={},m=b.startSymbol(),n=b.endSymbol(),o=/^when(Minus)?(.+)$/;f(g,function(a,b){o.test(b)&&(k[md(b.replace("when","").replace("Minus","-"))]=e.attr(g.$attr[b]))}),f(k,function(a,d){l[d]=b(a.replace(c,m+h+"-"+j+n))}),d.$watch(function(){var b=parseFloat(d.$eval(h));return isNaN(b)?"":(b in k||(b=a.pluralCat(b-j)),l[b](d,e,!0))},function(a){e.text(a)})}}}],hf=["$parse","$animate",function(a,c){function g(a){return a.clone[0]}function h(a){return a.clone[a.clone.length-1]}var i="$$NG_REMOVED",j=d("ngRepeat");return{transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,link:function(d,k,l,m,n){var o,p,q,r,s,t,u,v,w,x=l.ngRepeat,y=x.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),z={$id:Fb};if(!y)throw j("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",x);if(t=y[1],u=y[2],o=y[3],o?(p=a(o),q=function(a,b,c){return w&&(z[w]=a),z[v]=b,z.$index=c,p(d,z)}):(r=function(a,b){return Fb(b)},s=function(a){return a}),y=t.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/),!y)throw j("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",t);v=y[3]||y[1],w=y[2];var A={};d.$watchCollection(u,function(a){var l,m,o,p,t,u,y,z,B,C,D,E,F=k[0],G={},H=[];if(e(a))C=a,B=q||r;else{B=q||s,C=[];for(u in a)a.hasOwnProperty(u)&&"$"!=u.charAt(0)&&C.push(u);C.sort()}for(p=C.length,m=H.length=C.length,l=0;m>l;l++)if(u=a===C?l:C[l],y=a[u],z=B(u,y,l),eb(z,"`track by` id"),A.hasOwnProperty(z))D=A[z],delete A[z],G[z]=D,H[l]=D;else{if(G.hasOwnProperty(z))throw f(H,function(a){a&&a.scope&&(A[a.id]=a)}),j("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}",x,z);H[l]={id:z},G[z]=!1}for(u in A)A.hasOwnProperty(u)&&(D=A[u],E=gb(D.clone),c.leave(E),f(E,function(a){a[i]=!0}),D.scope.$destroy());for(l=0,m=C.length;m>l;l++){if(u=a===C?l:C[l],y=a[u],D=H[l],H[l-1]&&(F=h(H[l-1])),D.scope){t=D.scope,o=F;do o=o.nextSibling;while(o&&o[i]);g(D)!=o&&c.move(gb(D.clone),null,sd(F)),F=h(D)}else t=d.$new();t[v]=y,w&&(t[w]=u),t.$index=l,t.$first=0===l,t.$last=l===p-1,t.$middle=!(t.$first||t.$last),t.$odd=!(t.$even=0===(1&l)),D.scope||n(t,function(a){a[a.length++]=b.createComment(" end ngRepeat: "+x+" "),c.enter(a,null,sd(F)),F=a,D.scope=t,D.clone=a,G[D.id]=D})}A=G})}}}],jf=["$animate",function(a){return function(b,c,d){b.$watch(d.ngShow,function(b){a[T(b)?"removeClass":"addClass"](c,"ng-hide")})}}],kf=["$animate",function(a){return function(b,c,d){b.$watch(d.ngHide,function(b){a[T(b)?"addClass":"removeClass"](c,"ng-hide")})}}],lf=bd(function(a,b,c){a.$watch(c.ngStyle,function(a,c){c&&a!==c&&f(c,function(a,c){b.css(c,"")}),a&&b.css(a)},!0)}),mf=["$animate",function(a){return{restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(b,c,d,e){var g,h,i,j=d.ngSwitch||d.on,k=[];b.$watch(j,function(c){var j,l=k.length;if(l>0){if(i){for(j=0;l>j;j++)i[j].remove();i=null}for(i=[],j=0;l>j;j++){var m=h[j];k[j].$destroy(),i[j]=m,a.leave(m,function(){i.splice(j,1),0===i.length&&(i=null)})}}h=[],k=[],(g=e.cases["!"+c]||e.cases["?"])&&(b.$eval(d.change),f(g,function(c){var d=b.$new();k.push(d),c.transclude(d,function(b){var d=c.element;h.push(b),a.enter(b,d.parent(),d)})}))})}}}],nf=bd({transclude:"element",priority:800,require:"^ngSwitch",link:function(a,b,c,d,e){d.cases["!"+c.ngSwitchWhen]=d.cases["!"+c.ngSwitchWhen]||[],d.cases["!"+c.ngSwitchWhen].push({transclude:e,element:b})}}),of=bd({transclude:"element",priority:800,require:"^ngSwitch",link:function(a,b,c,d,e){d.cases["?"]=d.cases["?"]||[],d.cases["?"].push({transclude:e,element:b})}}),pf=bd({link:function(a,b,c,e,f){if(!f)throw d("ngTransclude")("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",U(b));f(function(a){b.empty(),b.append(a)})}}),qf=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,c){if("text/ng-template"==c.type){var d=c.id,e=b[0].text;a.put(d,e)}}}}],rf=d("ngOptions"),sf=q({terminal:!0}),tf=["$compile","$parse",function(a,d){var e=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\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]+?))?$/,h={$setViewValue:o};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(a,b,c){var d,e,f=this,g={},i=h;f.databound=c.ngModel,f.init=function(a,b,c){i=a,d=b,e=c},f.addOption=function(b){eb(b,'"option value"'),g[b]=!0,i.$viewValue==b&&(a.val(b),e.parent()&&e.remove())},f.removeOption=function(a){this.hasOption(a)&&(delete g[a],i.$viewValue==a&&this.renderUnknownOption(a))},f.renderUnknownOption=function(b){var c="? "+Fb(b)+" ?";e.val(c),a.prepend(e),a.val(c),e.prop("selected",!0)},f.hasOption=function(a){return g.hasOwnProperty(a)},b.$on("$destroy",function(){f.renderUnknownOption=o})}],link:function(h,i,j,k){function l(a,b,c,d){c.$render=function(){var a=c.$viewValue;d.hasOption(a)?(z.parent()&&z.remove(),b.val(a),""===a&&o.prop("selected",!0)):r(a)&&o?b.val(""):d.renderUnknownOption(a) },b.on("change",function(){a.$apply(function(){z.parent()&&z.remove(),c.$setViewValue(b.val())})})}function m(a,b,c){var d;c.$render=function(){var a=new Gb(c.$viewValue);f(b.find("option"),function(b){b.selected=s(a.get(b.value))})},a.$watch(function(){L(d,c.$viewValue)||(d=J(c.$viewValue),c.$render())}),b.on("change",function(){a.$apply(function(){var a=[];f(b.find("option"),function(b){b.selected&&a.push(b.value)}),c.$setViewValue(a)})})}function n(b,f,h){function i(){var a,c,d,e,i,j,q,u,A,B,C,D,E,F,G,H={"":[]},I=[""],J=h.$modelValue,K=p(b)||[],L=m?g(K):K,M={},N=!1;if(t)if(r&&x(J)){N=new Gb([]);for(var O=0;OC;C++){if(q=C,m){if(q=L[C],"$"===q.charAt(0))continue;M[m]=q}if(M[l]=K[q],a=n(b,M)||"",(c=H[a])||(c=H[a]=[],I.push(a)),t)D=s(N.remove(r?r(b,M):o(b,M)));else{if(r){var P={};P[l]=J,D=r(b,P)===r(b,M)}else D=J===o(b,M);N=N||D}G=k(b,M),G=s(G)?G:"",c.push({id:r?r(b,M):m?L[C]:C,label:G,selected:D})}for(t||(v||null===J?H[""].unshift({id:"",label:"",selected:!N}):N||H[""].unshift({id:"?",label:"",selected:!0})),B=0,u=I.length;u>B;B++){for(a=I[B],c=H[a],z.length<=B?(e={element:y.clone().attr("label",a),label:c.label},i=[e],z.push(i),f.append(e.element)):(i=z[B],e=i[0],e.label!=a&&e.element.attr("label",e.label=a)),E=null,C=0,A=c.length;A>C;C++)d=c[C],(j=i[C+1])?(E=j.element,j.label!==d.label&&E.text(j.label=d.label),j.id!==d.id&&E.val(j.id=d.id),j.selected!==d.selected&&E.prop("selected",j.selected=d.selected)):(""===d.id&&v?F=v:(F=w.clone()).val(d.id).attr("selected",d.selected).text(d.label),i.push(j={element:F,label:d.label,id:d.id,selected:d.selected}),E?E.after(F):e.element.append(F),E=F);for(C++;i.length>C;)i.pop().element.remove()}for(;z.length>B;)z.pop()[0].element.remove()}var j;if(!(j=u.match(e)))throw rf("iexp","Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",u,U(f));var k=d(j[2]||j[1]),l=j[4]||j[6],m=j[5],n=d(j[3]||""),o=d(j[2]?j[1]:l),p=d(j[7]),q=j[8],r=q?d(j[8]):null,z=[[{element:f,label:""}]];v&&(a(v)(b),v.removeClass("ng-scope"),v.remove()),f.empty(),f.on("change",function(){b.$apply(function(){var a,d,e,g,i,j,k,n,q,s=p(b)||[],u={};if(t){for(e=[],j=0,n=z.length;n>j;j++)for(a=z[j],i=1,k=a.length;k>i;i++)if((g=a[i].element)[0].selected){if(d=g.val(),m&&(u[m]=d),r)for(q=0;q1&&z[0][1].id!==d&&(z[0][1].selected=!1)}h.$setViewValue(e)})}),h.$render=i,b.$watch(i)}if(k[1]){for(var o,p=k[0],q=k[1],t=j.multiple,u=j.ngOptions,v=!1,w=sd(b.createElement("option")),y=sd(b.createElement("optgroup")),z=w.clone(),A=0,B=i.children(),C=B.length;C>A;A++)if(""===B[A].value){o=v=B.eq(A);break}p.init(q,v,z),t&&(q.$isEmpty=function(a){return!a||0===a.length}),u?n(h,i,q):t?m(h,i,q):l(h,i,q,p)}}}}],uf=["$interpolate",function(a){var b={addOption:o,removeOption:o};return{restrict:"E",priority:100,compile:function(c,d){if(r(d.value)){var e=a(c.text(),!0);e||d.$set("value",c.text())}return function(a,c,d){var f="$selectController",g=c.parent(),h=g.data(f)||g.parent().data(f);h&&h.databound?c.prop("selected",!1):h=b,e?a.$watch(e,function(a,b){d.$set("value",a),a!==b&&h.removeOption(b),h.addOption(a)}):h.addOption(d.value),c.on("$destroy",function(){h.removeOption(d.value)})}}}}],vf=q({restrict:"E",terminal:!0});return a.angular.bootstrap?void console.log("WARNING: Tried to load angular more than once."):(bb(),ib(Ad),void sd(b).ready(function(){$(b,_)}))}(window,document),!angular.$$csp()&&angular.element(document).find("head").prepend(''),"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return I(new(I(function(){},{prototype:a})),b)}function e(a){return H(arguments,function(b){b!==a&&H(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=0>d?Math.ceil(d):Math.floor(d),0>d&&(d+=c);c>d;d++)if(d in a&&a[d]===b)return d;return-1}function h(a,b,c,d){var e,h=f(c,d),i={},j=[];for(var k in h)if(h[k].params&&h[k].params.length){e=h[k].params;for(var l in e)g(j,e[l])>=0||(j.push(e[l]),i[e[l]]=a[e[l]])}return I({},i,b)}function i(a,b){var c={};return H(a,function(a){var d=b[a];c[a]=null!=d?String(d):null}),c}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e "));if(o[c]=d,E(a))m.push(c,[function(){return b.get(a)}],h);else{var e=b.annotate(a);H(e,function(a){a!==c&&g.hasOwnProperty(a)&&k(g[a],a)}),m.push(c,a,e)}n.pop(),o[c]=f}}function l(a){return F(a)&&a.then&&a.$$promises}if(!F(g))throw new Error("'invocables' must be an object");var m=[],n=[],o={};return H(g,k),g=n=o=null,function(d,f,g){function h(){--s||(t||e(r,f.$$values),p.$$values=r,p.$$promises=!0,o.resolve(r))}function k(a){p.$$failure=a,o.reject(a)}function n(c,e,f){function i(a){l.reject(a),k(a)}function j(){if(!C(p.$$failure))try{l.resolve(b.invoke(e,g,r)),l.promise.then(function(a){r[c]=a,h()},i)}catch(a){i(a)}}var l=a.defer(),m=0;H(f,function(a){q.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,q[a].then(function(b){r[a]=b,--m||j()},i))}),m||j(),q[c]=l.promise}if(l(d)&&g===c&&(g=f,f=d,d=null),d){if(!F(d))throw new Error("'locals' must be an object")}else d=i;if(f){if(!l(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=j;var o=a.defer(),p=o.promise,q=p.$$promises={},r=I({},d),s=1+m.length/3,t=!1;if(C(f.$$failure))return k(f.$$failure),p;f.$$values?(t=e(r,f.$$values),h()):(I(q,f.$$promises),f.then(h,k));for(var u=0,v=m.length;v>u;u+=3)d.hasOwnProperty(m[u])?h():n(m[u],m[u+1],m[u+2]);return p}},this.resolve=function(a,b,c,d){return this.study(a)(b,c,d)}}function m(a,b,c){this.fromConfig=function(a,b,c){return C(a.template)?this.fromString(a.template,b):C(a.templateUrl)?this.fromUrl(a.templateUrl,b):C(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){return D(a)?a(b):a},this.fromUrl=function(c,d){return D(c)&&(c=c(d)),null==c?null:a.get(c,{cache:b}).then(function(a){return a.data})},this.fromProvider=function(a,b,d){return c.invoke(a,null,d||{params:b})}}function n(a){function b(b){if(!/^\w+(-+\w+)*$/.test(b))throw new Error("Invalid parameter name '"+b+"' in pattern '"+a+"'");if(f[b])throw new Error("Duplicate parameter name '"+b+"' in pattern '"+a+"'");f[b]=!0,j.push(b)}function c(a){return a.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&")}var d,e=/([:*])(\w+)|\{(\w+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,f={},g="^",h=0,i=this.segments=[],j=this.params=[];this.source=a;for(var k,l,m;(d=e.exec(a))&&(k=d[2]||d[3],l=d[4]||("*"==d[1]?".*":"[^/]*"),m=a.substring(h,d.index),!(m.indexOf("?")>=0));)g+=c(m)+"("+l+")",b(k),i.push(m),h=e.lastIndex;m=a.substring(h);var n=m.indexOf("?");if(n>=0){var o=this.sourceSearch=m.substring(n);m=m.substring(0,n),this.sourcePath=a.substring(0,h+n),H(o.substring(1).split(/[&?]/),b)}else this.sourcePath=a,this.sourceSearch="";g+=c(m)+"$",i.push(m),this.regexp=new RegExp(g),this.prefix=i[0]}function o(){this.compile=function(a){return new n(a)},this.isMatcher=function(a){return F(a)&&D(a.exec)&&D(a.format)&&D(a.concat)},this.$get=function(){return this}}function p(a){function b(a){var b=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(a.source);return null!=b?b[1].replace(/\\(.)/g,"$1"):""}function c(a,b){return a.replace(/\$(\$|\d{1,2})/,function(a,c){return b["$"===c?0:Number(c)]})}function d(a,b,c){if(!c)return!1;var d=a.invoke(b,b,{$match:c});return C(d)?d:!0}var e=[],f=null;this.rule=function(a){if(!D(a))throw new Error("'rule' must be a function");return e.push(a),this},this.otherwise=function(a){if(E(a)){var b=a;a=function(){return b}}else if(!D(a))throw new Error("'rule' must be a function");return f=a,this},this.when=function(e,f){var g,h=E(f);if(E(e)&&(e=a.compile(e)),!h&&!D(f)&&!G(f))throw new Error("invalid 'handler' in when()");var i={matcher:function(b,c){return h&&(g=a.compile(c),c=["$match",function(a){return g.format(a)}]),I(function(a,e){return d(a,c,b.exec(e.path(),e.search()))},{prefix:E(b.prefix)?b.prefix:""})},regex:function(a,e){if(a.global||a.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(g=e,e=["$match",function(a){return c(g,a)}]),I(function(b,c){return d(b,e,a.exec(c.path()))},{prefix:b(a)})}},j={matcher:a.isMatcher(e),regex:e instanceof RegExp};for(var k in j)if(j[k])return this.rule(i[k](e,f));throw new Error("invalid 'what' in when()")},this.$get=["$location","$rootScope","$injector",function(a,b,c){function d(b){function d(b){var d=b(c,a);return d?(E(d)&&a.replace().url(d),!0):!1}if(!b||!b.defaultPrevented){var g,h=e.length;for(g=0;h>g;g++)if(d(e[g]))return;f&&d(f)}}return b.$on("$locationChangeSuccess",d),{sync:function(){d()}}}]}function q(a,e,f){function g(a){return 0===a.indexOf(".")||0===a.indexOf("^")}function l(a,b){var d=E(a),e=d?a:a.name,f=g(e);if(f){if(!b)throw new Error("No reference point given for path '"+e+"'");for(var h=e.split("."),i=0,j=h.length,k=b;j>i;i++)if(""!==h[i]||0!==i){if("^"!==h[i])break;if(!k.parent)throw new Error("Path '"+e+"' not valid for state '"+b.name+"'");k=k.parent}else k=b;h=h.slice(i).join("."),e=k.name+(k.name&&h?".":"")+h}var l=w[e];return!l||!d&&(d||l!==a&&l.self!==a)?c:l}function m(a,b){x[a]||(x[a]=[]),x[a].push(b)}function n(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){return this.name}});var c=b.name;if(!E(c)||c.indexOf("@")>=0)throw new Error("State must have a valid name");if(w.hasOwnProperty(c))throw new Error("State '"+c+"'' is already defined");var e=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):E(b.parent)?b.parent:"";if(e&&!w[e])return m(e,b.self);for(var f in z)D(z[f])&&(b[f]=z[f](b,z.$delegates[f]));if(w[c]=b,!b[y]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){v.$current.navigable==b&&j(a,c)||v.transitionTo(b,a,{location:!1})}]),x[c])for(var g=0;g-1}function p(a){var b=a.split("."),c=v.$current.name.split(".");if("**"===b[0]&&(c=c.slice(c.indexOf(b[1])),c.unshift("**")),"**"===b[b.length-1]&&(c.splice(c.indexOf(b[b.length-2])+1,Number.MAX_VALUE),c.push("**")),b.length!=c.length)return!1;for(var d=0,e=b.length;e>d;d++)"*"===b[d]&&(c[d]="*");return c.join("")===b.join("")}function q(a,b){return E(a)&&!C(b)?z[a]:D(b)&&E(a)?(z[a]&&!z.$delegates[a]&&(z.$delegates[a]=z[a]),z[a]=b,this):this}function r(a,b){return F(a)?b=a:b.name=a,n(b),this}function s(a,e,g,m,n,q,r,s,x){function z(){r.url()!==M&&(r.url(M),r.replace())}function A(a,c,d,f,h){var i=d?c:k(a.params,c),j={$stateParams:i};h.resolve=n.resolve(a.resolve,j,h.resolve,a);var l=[h.resolve.then(function(a){h.globals=a})];return f&&l.push(f),H(a.views,function(c,d){var e=c.resolve&&c.resolve!==a.resolve?c.resolve:{};e.$template=[function(){return g.load(d,{view:c,locals:j,params:i,notify:!1})||""}],l.push(n.resolve(e,j,h.resolve,a).then(function(f){if(D(c.controllerProvider)||G(c.controllerProvider)){var g=b.extend({},e,j);f.$$controller=m.invoke(c.controllerProvider,null,g)}else f.$$controller=c.controller;f.$$state=a,f.$$controllerAs=c.controllerAs,h[d]=f}))}),e.all(l).then(function(){return h})}var B=e.reject(new Error("transition superseded")),F=e.reject(new Error("transition prevented")),K=e.reject(new Error("transition aborted")),L=e.reject(new Error("transition failed")),M=r.url(),N=x.baseHref();return u.locals={resolve:null,globals:{$stateParams:{}}},v={params:{},current:u.self,$current:u,transition:null},v.reload=function(){v.transitionTo(v.current,q,{reload:!0,inherit:!1,notify:!1})},v.go=function(a,b,c){return this.transitionTo(a,b,I({inherit:!0,relative:v.$current},c))},v.transitionTo=function(b,c,f){c=c||{},f=I({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},f||{});var g,k=v.$current,n=v.params,o=k.path,p=l(b,f.relative);if(!C(p)){var s={to:b,toParams:c,options:f};if(g=a.$broadcast("$stateNotFound",s,k.self,n),g.defaultPrevented)return z(),K;if(g.retry){if(f.$retry)return z(),L;var w=v.transition=e.when(g.retry);return w.then(function(){return w!==v.transition?B:(s.options.$retry=!0,v.transitionTo(s.to,s.toParams,s.options))},function(){return K}),z(),w}if(b=s.to,c=s.toParams,f=s.options,p=l(b,f.relative),!C(p)){if(f.relative)throw new Error("Could not resolve '"+b+"' from state '"+f.relative+"'");throw new Error("No such state '"+b+"'")}}if(p[y])throw new Error("Cannot transition to abstract state '"+b+"'");f.inherit&&(c=h(q,c||{},v.$current,p)),b=p;var x,D,E=b.path,G=u.locals,H=[];for(x=0,D=E[x];D&&D===o[x]&&j(c,n,D.ownParams)&&!f.reload;x++,D=E[x])G=H[x]=D.locals;if(t(b,k,G,f))return b.self.reloadOnSearch!==!1&&z(),v.transition=null,e.when(v.current);if(c=i(b.params,c||{}),f.notify&&(g=a.$broadcast("$stateChangeStart",b.self,c,k.self,n),g.defaultPrevented))return z(),F;for(var N=e.when(G),O=x;O=x;d--)g=o[d],g.self.onExit&&m.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=x;d1||b.ctrlKey||b.metaKey||b.shiftKey||f.attr("target")||(c(function(){a.go(i.state,j,o)}),b.preventDefault())})}}}function y(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs",function(d,e,f){function g(){a.$current.self===i&&h()?e.addClass(l):e.removeClass(l)}function h(){return!k||j(k,b)}var i,k,l;l=c(f.uiSrefActive||"",!1)(d),this.$$setStateInfo=function(b,c){i=a.get(b,w(e)),k=c,g()},d.$on("$stateChangeSuccess",g)}]}}function z(a){return function(b){return a.is(b)}}function A(a){return function(b){return a.includes(b)}}function B(a,b){function e(a){this.locals=a.locals.globals,this.params=this.locals.$stateParams}function f(){this.locals=null,this.params=null}function g(c,g){if(null!=g.redirectTo){var h,j=g.redirectTo;if(E(j))h=j;else{if(!D(j))throw new Error("Invalid 'redirectTo' in when()");h=function(a,b){return j(a,b.path(),b.search())}}b.when(c,h)}else a.state(d(g,{parent:null,name:"route:"+encodeURIComponent(c),url:c,onEnter:e,onExit:f}));return i.push(g),this}function h(a,b,d){function e(a){return""!==a.name?a:c}var f={routes:i,params:d,current:c};return b.$on("$stateChangeStart",function(a,c,d,f){b.$broadcast("$routeChangeStart",e(c),e(f))}),b.$on("$stateChangeSuccess",function(a,c,d,g){f.current=e(c),b.$broadcast("$routeChangeSuccess",e(c),e(g)),J(d,f.params)}),b.$on("$stateChangeError",function(a,c,d,f,g,h){b.$broadcast("$routeChangeError",e(c),e(f),h)}),f}var i=[];e.$inject=["$$state"],this.when=g,this.$get=h,h.$inject=["$state","$rootScope","$routeParams"]}var C=b.isDefined,D=b.isFunction,E=b.isString,F=b.isObject,G=b.isArray,H=b.forEach,I=b.extend,J=b.copy;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),l.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",l),m.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",m),n.prototype.concat=function(a){return new n(this.sourcePath+a+this.sourceSearch)},n.prototype.toString=function(){return this.source},n.prototype.exec=function(a,b){var c=this.regexp.exec(a);if(!c)return null;var d,e=this.params,f=e.length,g=this.segments.length-1,h={};if(g!==c.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");for(d=0;g>d;d++)h[e[d]]=c[d+1];for(;f>d;d++)h[e[d]]=b[e[d]];return h},n.prototype.parameters=function(){return this.params},n.prototype.format=function(a){var b=this.segments,c=this.params;if(!a)return b.join("");var d,e,f,g=b.length-1,h=c.length,i=b[0];for(d=0;g>d;d++)f=a[c[d]],null!=f&&(i+=encodeURIComponent(f)),i+=b[d+1];for(;h>d;d++)f=a[c[d]],null!=f&&(i+=(e?"&":"?")+c[d]+"="+encodeURIComponent(f),e=!0);return i},b.module("ui.router.util").provider("$urlMatcherFactory",o),p.$inject=["$urlMatcherFactoryProvider"],b.module("ui.router.router").provider("$urlRouter",p),q.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider","$locationProvider"],b.module("ui.router.state").value("$stateParams",{}).provider("$state",q),r.$inject=[],b.module("ui.router.state").provider("$view",r),b.module("ui.router.state").provider("$uiViewScroll",s),t.$inject=["$state","$injector","$uiViewScroll"],u.$inject=["$compile","$controller","$state"],b.module("ui.router.state").directive("uiView",t),b.module("ui.router.state").directive("uiView",u),x.$inject=["$state","$timeout"],y.$inject=["$state","$stateParams","$interpolate"],b.module("ui.router.state").directive("uiSref",x).directive("uiSrefActive",y),z.$inject=["$state"],A.$inject=["$state"],b.module("ui.router.state").filter("isState",z).filter("includedByState",A),B.$inject=["$stateProvider","$urlRouterProvider"],b.module("ui.router.compat").provider("$route",B).directive("ngView",t)}(window,window.angular),function(){var a;a=angular.element,angular.module("validator.directive",["validator.provider"]).directive("validator",["$injector",function(b){return{restrict:"A",require:"ngModel",link:function(c,d,e,f){var g,h,i,j,k,l,m,n,o;return h=b.get("$validator"),g=b.get("$parse"),j=g(e.ngModel),n=[],o=function(a,g){var h,i,k,l,m,o,p;for(null==g&&(g={}),l=0,h=0,i=function(){var a,h,i;if(++l===n.length){for(f.$setValidity(e.ngModel,!0),h=0,i=n.length;i>h;h++)a=n[h],a.success(j(c),c,d,e,b);"function"==typeof g.success&&g.success()}},p=[],m=0,o=n.length;o>m;m++){switch(k=n[m],a){case"blur":if("blur"!==k.invoke)continue;k.enableError=!0;break;case"watch":if("watch"!==k.invoke&&!k.enableError){i();continue}break;case"broadcast":k.enableError=!0}p.push(function(a){return a.validator(j(c),c,d,e,{success:function(){return i()},error:function(){if(a.enableError&&1===++h&&(f.$setValidity(e.ngModel,!1),a.error(j(c),c,d,e,b)),1===("function"==typeof g.error?g.error():void 0)){try{d[0].scrollIntoViewIfNeeded()}catch(i){}return d[0].select()}}})}(k))}return p},l=function(){var a;return a=h.getRule("required"),null==a&&(a=h.convertRule("required",{validator:/^.+$/,invoke:"watch"})),n.push(a)},m=function(a){var f,g,h,i,k;for(k=[],f=g=0,h=n.length;h>g;f=g+=1)(null!=(i=n[f])?i.name:void 0)===a&&(n[f].success(j(c),c,d,e,b),n.splice(f,1),k.push(f--));return k},e.$observe("validator",function(a){var f,g,i,j,m,o,p;if(n.length=0,(k.validatorRequired||k.required)&&l(),f=a.match(/^\/(.*)\/$/))return i=h.convertRule("dynamic",{validator:RegExp(f[1]),invoke:e.validatorInvoke,error:e.validatorError}),void n.push(i);if(f=a.match(/^\[(.*)\]$/)){for(j=f[1].split(","),p=[],m=0,o=j.length;o>m;m++)g=j[m],i=h.getRule(g.replace(/^\s+|\s+$/g,"")),"function"==typeof i.init&&i.init(c,d,e,b),p.push(i?n.push(i):void 0);return p}}),e.$observe("validatorError",function(a){var b,c;return b=e.validator.match(/^\/(.*)\/$/),b?(m("dynamic"),c=h.convertRule("dynamic",{validator:RegExp(b[1]),invoke:e.validatorInvoke,error:a}),n.push(c)):void 0}),k={validatorRequired:!1,required:!1},e.$observe("validatorRequired",function(a){return a&&"false"!==a?(l(),k.validatorRequired=!0):k.validatorRequired?(m("required"),k.validatorRequired=!1):void 0}),e.$observe("required",function(a){return a&&"false"!==a?(l(),k.required=!0):k.required?(m("required"),k.required=!1):void 0}),i=function(a,b){var d,f,h,i;return b?e.validatorGroup===b?!0:a.targetScope===c?0===e.ngModel.indexOf(b):(d=function(a,b){var c,e;for(c in a)switch(e=a[c],typeof e){case"string":if("$$hashKey"===c&&e===b)return!0;break;case"object":if(d(e,b))return!0}return!1},f=e.ngModel.indexOf("."),h=f>=0?e.ngModel.substr(0,f):e.ngModel,i=g(h)(c),d(g(b)(a.targetScope),i.$$hashKey)):!0},c.$on(h.broadcastChannel.prepare,function(a,b){return i(a,b.model)?b.accept():void 0}),c.$on(h.broadcastChannel.start,function(a,b){return i(a,b.model)?o("broadcast",{success:b.success,error:b.error}):void 0}),c.$on(h.broadcastChannel.reset,function(a,f){var g,h,k;if(i(a,f.model))for(h=0,k=n.length;k>h;h++)g=n[h],g.success(j(c),c,d,e,b),"watch"!==g.invoke&&(g.enableError=!1)}),c.$watch(e.ngModel,function(a,b){return a!==b?o("watch",{oldValue:b}):void 0}),a(d).bind("blur",function(){return c.$apply(function(){return o("blur")})})}}}])}.call(this),function(){angular.module("validator",["validator.directive"])}.call(this),function(){var a;a=angular.element,angular.module("validator.provider",[]).provider("$validator",function(){var b,c,d;b=null,c=null,d=null,this.rules={},this.broadcastChannel={prepare:"$validatePrepare",start:"$validateStart",reset:"$validateReset"},this.setupProviders=function(a){return b=a,c=b.get("$q"),d=b.get("$timeout")},this.convertError=function(b){var c;return"function"==typeof b?b:(c=b.constructor===String?b:"",function(b,d,e,f){var g,h,i,j,k,l,m;for(i=a(e).parent(),m=[];0!==i.length;){if(i.hasClass("form-group")){for(i.addClass("has-error"),l=i.find("label"),j=0,k=l.length;k>j;j++)h=l[j],a(h).hasClass("error")&&a(h).remove();g=a(""),f.id&&g.attr("for",f.id),a(e).parent().append(g);break}m.push(i=i.parent())}return m})},this.convertSuccess=function(b){return"function"==typeof b?b:function(b,c,d){var e,f,g,h,i,j;for(f=a(d).parent(),j=[];0!==f.length;){if(f.hasClass("has-error")){for(f.removeClass("has-error"),i=f.find("label"),g=0,h=i.length;h>g;g++)e=i[g],a(e).hasClass("error")&&a(e).remove();break}j.push(f=f.parent())}return j}},this.convertValidator=function(a){var d,e,f;return f=function(){},a.constructor===RegExp?(e=a,f=function(a,b,c,d,f){return null==a&&(a=""),e.test(a)?"function"==typeof f.success?f.success():void 0:"function"==typeof f.error?f.error():void 0}):"function"==typeof a&&(d=a,f=function(a,e,f,g,h){return c.all([d(a,e,f,g,b)]).then(function(a){return a&&a.length>0&&a[0]?"function"==typeof h.success?h.success():void 0:"function"==typeof h.error?h.error():void 0},function(){return"function"==typeof h.error?h.error():void 0})}),f},this.convertRule=function(a){return function(b,c){var d,e,f;return null==c&&(c={}),d={name:b,enableError:"watch"===c.invoke,invoke:c.invoke,init:c.init,validator:null!=(e=c.validator)?e:function(){return!0},error:null!=(f=c.error)?f:"",success:c.success},d.error=a.convertError(d.error),d.success=a.convertSuccess(d.success),d.validator=a.convertValidator(d.validator),d}}(this),this.register=function(a,b){return null==b&&(b={}),this.rules[a]=this.convertRule(a,b)},this.getRule=function(a){return this.rules[a]?this.rules[a]:null},this.validate=function(a){return function(e,f){var g,h,i,j,k;return i=c.defer(),k=i.promise,h={total:0,success:0,error:0},j={promises:{success:[],error:[],then:[]},accept:function(){return h.total++},validatedSuccess:function(){var a,b,c,d,e,f,g;if(++h.success===h.total){for(f=j.promises.success,b=0,d=f.length;d>b;b++)(a=f[b])();for(g=j.promises.then,c=0,e=g.length;e>c;c++)(a=g[c])()}return h.success},validatedError:function(){var a,b,c,d,e,f,g;if(0===h.error++){for(f=j.promises.error,b=0,d=f.length;d>b;b++)(a=f[b])();for(g=j.promises.then,c=0,e=g.length;e>c;c++)(a=g[c])()}return h.error}},k.success=function(a){return j.promises.success.push(a),k},k.error=function(a){return j.promises.error.push(a),k},k.then=function(a){return j.promises.then.push(a),k},g={model:f,accept:j.accept,success:j.validatedSuccess,error:j.validatedError},e.$broadcast(a.broadcastChannel.prepare,g),d(function(){var a,c,d,f,i;{if(0!==h.total)return a=b.get("$validator"),e.$broadcast(a.broadcastChannel.start,g);for(i=j.promises.success,d=0,f=i.length;f>d;d++)(c=i[d])()}}),k}}(this),this.reset=function(a){return function(b,c){return b.$broadcast(a.broadcastChannel.reset,{model:c})}}(this),this.get=function(a){return this.setupProviders(a),{rules:this.rules,broadcastChannel:this.broadcastChannel,register:this.register,convertRule:this.convertRule,getRule:this.getRule,validate:this.validate,reset:this.reset}},this.get.$inject=["$injector"],this.$get=this.get})}.call(this),function(){angular.module("v.controllers",["v.controllers.navigation","v.controllers.index","v.controllers.login","v.controllers.settings","v.controllers.logs"])}.call(this),function(){angular.module("v.controllers.index",[]).controller("IndexController",["$scope","$injector",function(a,b){var c,d;return d=b.get("$v"),c=b.get("$state"),d.user.is_login?c.go("v.log-default"):$stae.go("v.login")}])}.call(this),function(){angular.module("v.controllers.login",[]).controller("LoginController",["$scope","$injector",function(a,b){var c;return c=b.get("$v"),a.url=c.url}])}.call(this),function(){angular.module("v.controllers.logs",[]).controller("LogsController",["$scope","$injector","applications","logs",function(a,b,c,d){var e,f;return e=b.get("$state"),f=b.get("$stateParams"),a.applications=c,a.logs=d,a.currentApplication=d.application,a.keyword=f.keyword,a.search=function(b,c){return b.preventDefault(),e.go("v.log-list",{applicationId:a.currentApplication.id,keyword:c},{reload:!0}) -},a.showDetail=function(b){return e.go("v.log-detail",{applicationId:a.currentApplication.id,logId:b},{reload:!0})}}]).controller("LogController",["$scope","application","log",function(a,b,c){return a.application=b,a.log=c}])}.call(this),function(){angular.module("v.controllers.navigation",[]).controller("NavigationController",["$scope","$injector",function(a,b){var c;return c=b.get("$v"),a.user=c.user,a.url=c.url}])}.call(this),function(){angular.module("v.controllers.settings",[]).controller("SettingsController",["$scope","$injector",function(a,b){var c;return c=b.get("$state"),c.go("v.settings-profile")}]).controller("SettingsProfileController",["$scope","$injector","profile",function(a,b,c){var d,e;return d=b.get("$v"),e=b.get("$validator"),a.profile={model:c,submit:function(b){return b.preventDefault(),e.validate(a,"profile.model").success(function(){return NProgress.start(),d.api.settings.updateProfile({name:a.profile.model.name}).success(function(){return NProgress.done(),d.alert.saved()})})}}}]).controller("SettingsApplicationsController",["$scope","$injector","applications",function(a,b,c){var d,e,f,g;return f=b.get("$v"),d=b.get("$state"),e=b.get("$stateParams"),g=b.get("$validator"),a.applications=c,a.removeApplication=function(a,b){return b.preventDefault(),f.alert.confirm("Do you want to delete the application "+a.title+"?",function(b){return b?(NProgress.start(),f.api.application.removeApplication(a.id).success(function(){return d.go(d.current,e,{reload:!0})})):void 0})}}]).controller("SettingsNewApplicationController",["$scope","$injector",function(a,b){var c,d,e;return d=b.get("$v"),e=b.get("$validator"),c=b.get("$state"),a.mode="new",a.application={title:"",description:""},a.modal={autoShow:!0,hide:function(){},hiddenCallback:function(){return c.go("v.settings-applications",null,{reload:!0})}},a.submit=function(){return e.validate(a,"application").success(function(){return NProgress.start(),d.api.application.addApplication(a.application).success(function(){return a.modal.hide()})})}}]).controller("SettingsApplicationController",["$scope","$injector","application",function(a,b,c){var d,e,f;return e=b.get("$v"),f=b.get("$validator"),d=b.get("$state"),a.mode="edit",a.application=c,a.modal={autoShow:!0,hide:function(){},hiddenCallback:function(){return d.go("v.settings-applications",null,{reload:!0})}},a.submit=function(){return f.validate(a,"application").success(function(){var b;return NProgress.start(),b={id:a.application.id,title:a.application.title,description:a.application.description},e.api.application.updateApplication(b).success(function(){return a.modal.hide()})})},a.updateAppKey=function(){var b;return NProgress.start(),b={id:a.application.id,app_key:!0},e.api.application.updateApplication(b).success(function(b){return a.application.app_key=b.app_key,NProgress.done()})}}]).controller("SettingsUsersController",["$scope","$injector","users",function(a,b,c){var d,e,f,g;return f=b.get("$v"),d=b.get("$state"),e=b.get("$stateParams"),g=b.get("$validator"),a.users=c,a.currentUser=f.user,a.isRoot=1===f.user.permission,a.removeUser=function(a,b){return b.preventDefault(),f.alert.confirm("Do you want to delete the user "+a.name+"<"+a.email+">?",function(b){return b?(NProgress.start(),f.api.user.removeUser(a.id).success(function(){return d.go(d.current,e,{reload:!0})})):void 0})}}]).controller("SettingsNewUserController",["$scope","$injector",function(a,b){var c,d,e;return d=b.get("$v"),e=b.get("$validator"),c=b.get("$state"),a.mode="new",a.user={email:""},a.modal={autoShow:!0,hide:function(){},hiddenCallback:function(){return c.go("v.settings-users",null,{reload:!0})}},a.submit=function(){return e.validate(a,"user").success(function(){return NProgress.start(),d.api.user.inviteUser(a.user.email).success(function(){return a.modal.hide()})})}}]).controller("SettingsUserController",["$scope","$injector","user",function(a,b,c){var d,e,f;return e=b.get("$v"),f=b.get("$validator"),d=b.get("$state"),a.mode="edit",a.user=c,a.modal={autoShow:!0,hide:function(){},hiddenCallback:function(){return d.go("v.settings-users",null,{reload:!0})}},a.submit=function(){return f.validate(a,"user").success(function(){return NProgress.start(),e.api.user.updateUser(a.user).success(function(){return a.modal.hide()})})}}])}.call(this),function(){angular.module("v.directive",[]).directive("vSettingsMenu",["$injector",function(a){var b;return b=a.get("$v"),{restrict:"A",templateUrl:"/views/settings/menu.html",replace:!0,link:function(a,c,d){return a.options=a.$eval(d.vSettingsMenu),a.isRoot=1===b.user.permission}}}]).directive("vFocus",function(){return{restrict:"A",link:function(a,b){return $(b).select()}}}).directive("vModal",function(){return{restrict:"A",scope:{modal:"=vModal"},link:function(a,b){return a.modal.hide=function(){return $(b).modal("hide")},a.modal.hiddenCallback&&$(b).on("hidden.bs.modal",function(b){return a.$apply(function(){return a.$eval(a.modal.hiddenCallback,{$event:b})})}),$(b).on("shown.bs.modal",function(){var a;return a=$(b).find("form .form-control:first"),a.length?a.select():$(b).find("form [type=submit]").focus()}),a.modal.autoShow?$(b).modal("show"):void 0}}}).directive("vConfirm",["$injector",function(a){var b;return b=a.get("$timeout"),{restrict:"A",scope:{modal:"=vConfirm"},replace:!0,templateUrl:"/views/modal/confirm.html",link:function(a,c){var d;return d=!1,a.$watch("modal.isShow",function(a,b){return a!==b&&a?($(c).modal("show"),d=!1):void 0}),a.confirmed=function(){return d=!0,b(function(){return $(c).modal("hide")})},$(c).on("shown.bs.modal",function(){return $(c).find("[type=submit]").focus()}),$(c).on("hidden.bs.modal",function(){return a.$apply(function(){return a.modal.isShow=!1,a.modal.callback(d)})})}}}]).directive("vPager",function(){return{restrict:"A",scope:{pageList:"=vPager",urlTemplate:"@pagerUrlTemplate"},replace:!0,template:'',link:function(a){var b,c,d,e,f;for(a.links={previous:{enable:a.pageList.has_previous_page,url:a.urlTemplate.replace("#{index}",a.pageList.index-1)},numbers:[],next:{enable:a.pageList.has_next_page,url:a.urlTemplate.replace("#{index}",a.pageList.index+1)}},f=[],b=c=d=a.pageList.index-3,e=a.pageList.index+3;e>=c;b=c+=1)f.push(a.links.numbers.push({show:b>=0&&b<=a.pageList.max_index,isCurrent:b===a.pageList.index,pageNumber:b+1,url:a.urlTemplate.replace("#{index}",b)}));return f}}})}.call(this),function(){angular.module("v.initial",[]).config(function(){return $.extend($.easing,{easeOutExpo:function(a,b,c,d,e){return b===e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c}})})}.call(this),function(){angular.module("v",["v.initial","v.router","v.directive","v.validations"])}.call(this),function(){angular.module("v.provider",[]).provider("$v",function(){var a,b,c;b=null,a=null,c=null,this.setupProviders=function(d){return b=d,a=b.get("$http"),c=b.get("$rootScope"),c.$confirmModal={}},this.user=window.user,this.url=window.url,this.alert={saved:function(a){return null==a&&(a="Saved successful."),$.av.pop({title:"Success",message:a,expire:3e3})},confirm:function(a,b){return c.$confirmModal.message=a,c.$confirmModal.callback=b,c.$confirmModal.isShow=!0}},this.http=function(){return function(b){return a(b).error(function(){return $.av.pop({title:"Server Error",message:"Please try again or refresh this page.",template:"error",expire:3e3}),NProgress.done()})}}(this),this.api={settings:{getProfile:function(a){return function(){return a.http({method:"get",url:"/settings/profile"})}}(this),updateProfile:function(a){return function(b){return a.http({method:"put",url:"/settings/profile",data:b})}}(this)},log:{getLogs:function(a){return function(b,c,d){return null==b&&(b=0),null==c&&(c=0),a.http({method:"get",url:"/applications/"+b+"/logs",params:{index:c,keyword:d}})}}(this),getLog:function(a){return function(b,c){return a.http({method:"get",url:"/applications/"+b+"/logs/"+c})}}(this)},user:{getUsers:function(a){return function(b){return null==b&&(b=0),a.http({method:"get",url:"/settings/users",params:{index:b}})}}(this),getUser:function(a){return function(b){return a.http({method:"get",url:"/settings/users/"+b})}}(this),inviteUser:function(a){return function(b){return a.http({method:"post",url:"/settings/users",data:{email:b}})}}(this),removeUser:function(a){return function(b){return a.http({method:"delete",url:"/settings/users/"+b})}}(this),updateUser:function(a){return function(b){return a.http({method:"put",url:"/settings/users/"+b.id,data:b})}}(this)},application:{getApplications:function(a){return function(b,c){return null==b&&(b=0),null==c&&(c=!1),a.http({method:"get",url:"/settings/applications",params:{index:b,all:c}})}}(this),addApplication:function(a){return function(b){return a.http({method:"post",url:"/settings/applications",data:b})}}(this),getApplication:function(a){return function(b){return a.http({method:"get",url:"/settings/applications/"+b})}}(this),updateApplication:function(a){return function(b){return a.http({method:"put",url:"/settings/applications/"+b.id,data:b})}}(this),removeApplication:function(a){return function(b){return a.http({method:"delete",url:"/settings/applications/"+b})}}(this)}},this.$get=["$injector",function(a){return function(b){return a.setupProviders(b),{user:a.user,url:a.url,alert:a.alert,api:a.api}}}(this)]})}.call(this),function(){angular.module("v.router",["v.provider","v.controllers","ui.router"]).config(["$stateProvider","$urlRouterProvider","$locationProvider",function(a,b,c){return c.html5Mode(!0),b.otherwise("/"),a.state("v",{url:"",templateUrl:"/views/shared/layout.html"}),a.state("v.index",{url:"/",controller:"IndexController"}),a.state("v.login",{url:"/login",resolve:{title:function(){return"Login - "}},templateUrl:"/views/login.html",controller:"LoginController"}),a.state("v.log-default",{url:"/applications",resolve:{title:function(){return"Logs - "},applications:["$v",function(a){return a.api.application.getApplications(0,!0).then(function(a){return a.data})}],logs:["$v",function(a){return a.api.log.getLogs().then(function(a){return a.data})}]},templateUrl:"/views/log/list.html",controller:"LogsController"}),a.state("v.log-list",{url:"/applications/:applicationId/logs?index?keyword",resolve:{title:function(){return"Logs - "},applications:["$v",function(a){return a.api.application.getApplications(0,!0).then(function(a){return a.data})}],logs:["$v","$stateParams",function(a,b){return a.api.log.getLogs(b.applicationId,b.index,b.keyword).then(function(a){return a.data})}]},templateUrl:"/views/log/list.html",controller:"LogsController"}),a.state("v.log-detail",{url:"/applications/:applicationId/logs/:logId",resolve:{title:function(){return"Log - "},application:["$v","$stateParams",function(a,b){return a.api.application.getApplication(b.applicationId).then(function(a){return a.data})}],log:["$v","$stateParams",function(a,b){return a.api.log.getLog(b.applicationId,b.logId).then(function(a){return a.data})}]},templateUrl:"/views/log/detail.html",controller:"LogController"}),a.state("v.settings",{url:"/settings",resolve:{title:function(){return"Settings - "}},controller:"SettingsController"}),a.state("v.settings-profile",{url:"/settings/profile",resolve:{title:function(){return"Profile - Settings - "},profile:["$v",function(a){return a.api.settings.getProfile().then(function(a){return a.data})}]},templateUrl:"/views/settings/profile.html",controller:"SettingsProfileController"}),a.state("v.settings-applications",{url:"/settings/applications?index",resolve:{title:function(){return"Applications - Settings - "},applications:["$v","$stateParams",function(a,b){return a.api.application.getApplications(b.index).then(function(a){return a.data})}]},templateUrl:"/views/settings/applications.html",controller:"SettingsApplicationsController"}),a.state("v.settings-applications.new",{url:"/new",resolve:{title:function(){return"Applications - Settings - "}},templateUrl:"/views/modal/application.html",controller:"SettingsNewApplicationController"}),a.state("v.settings-applications.detail",{url:"/:applicationId",resolve:{title:function(){return"Application - Settings - "},application:["$v","$stateParams",function(a,b){return a.api.application.getApplication(b.applicationId).then(function(a){return a.data})}]},templateUrl:"/views/modal/application.html",controller:"SettingsApplicationController"}),a.state("v.settings-users",{url:"/settings/users?index",resolve:{title:function(){return"Users - Settings - "},users:["$v","$stateParams",function(a,b){return a.api.user.getUsers(b.index).then(function(a){return a.data})}]},templateUrl:"/views/settings/users.html",controller:"SettingsUsersController"}),a.state("v.settings-users.new",{url:"/new",resolve:{title:function(){return"Users - Settings - "}},templateUrl:"/views/modal/user.html",controller:"SettingsNewUserController"}),a.state("v.settings-users.detail",{url:"/:userId",resolve:{title:function(){return"Users - Settings - "},user:["$v","$stateParams",function(a,b){return a.api.user.getUser(b.userId).then(function(a){return a.data})}]},templateUrl:"/views/modal/user.html",controller:"SettingsUserController"})}]).run(["$injector",function(a){var b,c,d,e,f,g,h;return b=a.get("$rootScope"),d=a.get("$stateParams"),c=a.get("$state"),e=a.get("$v"),b.$stateParams=d,b.$state=c,NProgress.configure({showSpinner:!1}),f=null,g=null,h=null,b.$on("$stateChangeStart",function(a,b,c,d){return f=window.event,g=d.name,h=b.name,NProgress.start()}),b.$on("$stateChangeSuccess",function(a,b){return NProgress.done(),e.user.is_login||"v.login"===b.name?void 0:c.go("v.login")}),b.$on("$stateChangeError",function(a,b){return NProgress.done(),e.user.is_login||"v.login"===b.name?void 0:c.go("v.login")}),b.$on("$viewContentLoaded",function(){if("popstate"!==(null!=f?f.type:void 0)){if(null!=g&&null!=h){if(0===g.replace(h,"").indexOf("."))return;if(0===h.replace(g,"").indexOf("."))return}return window.scrollTo(0,0)}})}])}.call(this),function(){angular.module("v.validations",["validator"]).config(["$validatorProvider",function(a){return a.register("required",{validator:/.+/,error:"This field is required."}),a.register("email",{validator:/(^$)|(^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$)/,error:"This field should be the email."})}])}.call(this); \ No newline at end of file +},a.showDetail=function(b){return e.go("v.log-detail",{applicationId:a.currentApplication.id,logId:b},{reload:!0})}}]).controller("LogController",["$scope","application","log",function(a,b,c){return a.application=b,a.log=c}])}.call(this),function(){angular.module("v.controllers.navigation",[]).controller("NavigationController",["$scope","$injector",function(a,b){var c;return c=b.get("$v"),a.user=c.user,a.url=c.url}])}.call(this),function(){var a=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};angular.module("v.controllers.settings",[]).controller("SettingsController",["$scope","$injector",function(a,b){var c;return c=b.get("$state"),c.go("v.settings-profile")}]).controller("SettingsProfileController",["$scope","$injector","profile",function(a,b,c){var d,e;return d=b.get("$v"),e=b.get("$validator"),a.profile={model:c,submit:function(b){return b.preventDefault(),e.validate(a,"profile.model").success(function(){return NProgress.start(),d.api.settings.updateProfile({name:a.profile.model.name}).success(function(){return NProgress.done(),d.alert.saved()})})}}}]).controller("SettingsApplicationsController",["$scope","$injector","applications",function(a,b,c){var d,e,f,g;return f=b.get("$v"),d=b.get("$state"),e=b.get("$stateParams"),g=b.get("$validator"),a.applications=c,a.removeApplication=function(a,b){return b.preventDefault(),f.alert.confirm("Do you want to delete the application "+a.title+"?",function(b){return b?(NProgress.start(),f.api.application.removeApplication(a.id).success(function(){return d.go(d.current,e,{reload:!0})})):void 0})}}]).controller("SettingsNewApplicationController",["$scope","$injector",function(a,b){var c,d,e;return d=b.get("$v"),e=b.get("$validator"),c=b.get("$state"),a.mode="new",a.application={title:"",description:""},a.modal={autoShow:!0,hide:function(){},hiddenCallback:function(){return c.go("v.settings-applications",null,{reload:!0})}},a.submit=function(){return e.validate(a,"application").success(function(){return NProgress.start(),d.api.application.addApplication(a.application).success(function(){return a.modal.hide()})})}}]).controller("SettingsApplicationController",["$scope","$injector","application",function(b,c,d){var e,f,g,h,i,j,k,l,m;for(g=c.get("$v"),h=c.get("$validator"),e=c.get("$state"),f=c.get("$timeout"),b.mode="edit",b.application=d,l=d.members,j=0,k=l.length;k>j;j++)i=l[j],i.isRoot=(m=i.id,a.call(d.root_ids,m)>=0);return b.$watch("application.members",function(){var a,c,d,e;for(a=[],e=b.application.members,c=0,d=e.length;d>c;c++)i=e[c],i.isRoot&&a.push(i.id);return b.application.root_ids=a},!0),b.modal={autoShow:!0,hide:function(){},hiddenCallback:function(){return e.go("v.settings-applications",null,{reload:!0})}},b.submit=function(){return h.validate(b,"application").success(function(){var a;return NProgress.start(),a={id:b.application.id,title:b.application.title,description:b.application.description,member_ids:b.application.member_ids,root_ids:b.application.root_ids},g.api.application.updateApplication(a).success(function(){return b.modal.hide()})})},b.memberService={email:"",invite:function(a){return a.preventDefault(),h.validate(b,"memberService").success(function(){return NProgress.start(),g.api.application.addApplicationMember(b.application.id,b.memberService.email).success(function(a){return NProgress.done(),b.application.member_ids.push(a.id),b.application.members.push(a),b.memberService.email="",f(function(){return h.reset(b,"memberService")})})})},removeMember:function(a,c){var d,e,f,g,h,i,j;for(a.preventDefault(),d=e=0,h=b.application.members.length;h>=0?h>e:e>h;d=h>=0?++e:--e)if(b.application.members[d].id===c){b.application.members.splice(d,1);break}for(d=f=0,i=b.application.member_ids.length;i>=0?i>f:f>i;d=i>=0?++f:--f)if(b.application.member_ids[d]===c){b.application.member_ids.splice(d,1);break}for(d=g=0,j=b.application.root_ids.length;j>=0?j>g:g>j;d=j>=0?++g:--g)if(b.application.root_ids[d]===c){b.application.root_ids.splice(d,1);break}}},b.updateAppKey=function(){var a;return NProgress.start(),a={id:b.application.id,app_key:!0},g.api.application.updateApplication(a).success(function(a){return b.application.app_key=a.app_key,NProgress.done()})}}]).controller("SettingsUsersController",["$scope","$injector","users",function(a,b,c){var d,e,f,g;return f=b.get("$v"),d=b.get("$state"),e=b.get("$stateParams"),g=b.get("$validator"),a.users=c,a.currentUser=f.user,a.isRoot=1===f.user.permission,a.removeUser=function(a,b){return b.preventDefault(),f.alert.confirm("Do you want to delete the user "+a.name+"<"+a.email+">?",function(b){return b?(NProgress.start(),f.api.user.removeUser(a.id).success(function(){return d.go(d.current,e,{reload:!0})})):void 0})}}]).controller("SettingsNewUserController",["$scope","$injector",function(a,b){var c,d,e;return d=b.get("$v"),e=b.get("$validator"),c=b.get("$state"),a.mode="new",a.user={email:""},a.modal={autoShow:!0,hide:function(){},hiddenCallback:function(){return c.go("v.settings-users",null,{reload:!0})}},a.submit=function(){return e.validate(a,"user").success(function(){return NProgress.start(),d.api.user.inviteUser(a.user.email).success(function(){return a.modal.hide()})})}}]).controller("SettingsUserController",["$scope","$injector","user",function(a,b,c){var d,e,f;return e=b.get("$v"),f=b.get("$validator"),d=b.get("$state"),a.mode="edit",a.user=c,a.modal={autoShow:!0,hide:function(){},hiddenCallback:function(){return d.go("v.settings-users",null,{reload:!0})}},a.submit=function(){return f.validate(a,"user").success(function(){return NProgress.start(),e.api.user.updateUser(a.user).success(function(){return a.modal.hide()})})}}])}.call(this),function(){angular.module("v.directive",[]).directive("vSettingsMenu",["$injector",function(a){var b;return b=a.get("$v"),{restrict:"A",templateUrl:"/views/settings/menu.html",replace:!0,link:function(a,c,d){return a.options=a.$eval(d.vSettingsMenu),a.isRoot=1===b.user.permission}}}]).directive("vFocus",function(){return{restrict:"A",link:function(a,b){return $(b).select()}}}).directive("vEnter",function(){return{restrict:"A",link:function(a,b,c){return b.bind("keydown keypress",function(b){return 13===b.which?(b.preventDefault(),a.$apply(function(){return a.$eval(c.vEnter,{$event:b})})):void 0})}}}).directive("vModal",function(){return{restrict:"A",scope:{modal:"=vModal"},link:function(a,b){return a.modal.hide=function(){return $(b).modal("hide")},a.modal.hiddenCallback&&$(b).on("hidden.bs.modal",function(b){return a.$apply(function(){return a.$eval(a.modal.hiddenCallback,{$event:b})})}),$(b).on("shown.bs.modal",function(){var a;return a=$(b).find("form .form-control:first"),a.length?a.select():$(b).find("form [type=submit]").focus()}),a.modal.autoShow?$(b).modal("show"):void 0}}}).directive("vConfirm",["$injector",function(a){var b;return b=a.get("$timeout"),{restrict:"A",scope:{modal:"=vConfirm"},replace:!0,templateUrl:"/views/modal/confirm.html",link:function(a,c){var d;return d=!1,a.$watch("modal.isShow",function(a,b){return a!==b&&a?($(c).modal("show"),d=!1):void 0}),a.confirmed=function(){return d=!0,b(function(){return $(c).modal("hide")})},$(c).on("shown.bs.modal",function(){return $(c).find("[type=submit]").focus()}),$(c).on("hidden.bs.modal",function(){return a.$apply(function(){return a.modal.isShow=!1,a.modal.callback(d)})})}}}]).directive("vPager",function(){return{restrict:"A",scope:{pageList:"=vPager",urlTemplate:"@pagerUrlTemplate"},replace:!0,template:'',link:function(a){var b,c,d,e,f;for(a.links={previous:{enable:a.pageList.has_previous_page,url:a.urlTemplate.replace("#{index}",a.pageList.index-1)},numbers:[],next:{enable:a.pageList.has_next_page,url:a.urlTemplate.replace("#{index}",a.pageList.index+1)}},f=[],b=c=d=a.pageList.index-3,e=a.pageList.index+3;e>=c;b=c+=1)f.push(a.links.numbers.push({show:b>=0&&b<=a.pageList.max_index,isCurrent:b===a.pageList.index,pageNumber:b+1,url:a.urlTemplate.replace("#{index}",b)}));return f}}})}.call(this),function(){angular.module("v.initial",[]).config(function(){return $.extend($.easing,{easeOutExpo:function(a,b,c,d,e){return b===e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c}})})}.call(this),function(){angular.module("v",["v.initial","v.router","v.directive","v.validations"])}.call(this),function(){angular.module("v.provider",[]).provider("$v",function(){var a,b,c;b=null,a=null,c=null,this.setupProviders=function(d){return b=d,a=b.get("$http"),c=b.get("$rootScope"),c.$confirmModal={}},this.user=window.user,this.url=window.url,this.alert={saved:function(a){return null==a&&(a="Saved successful."),$.av.pop({title:"Success",message:a,expire:3e3})},confirm:function(a,b){return c.$confirmModal.message=a,c.$confirmModal.callback=b,c.$confirmModal.isShow=!0}},this.http=function(){return function(b){return a(b).error(function(){return $.av.pop({title:"Server Error",message:"Please try again or refresh this page.",template:"error",expire:3e3}),NProgress.done()})}}(this),this.api={settings:{getProfile:function(a){return function(){return a.http({method:"get",url:"/settings/profile"})}}(this),updateProfile:function(a){return function(b){return a.http({method:"put",url:"/settings/profile",data:b})}}(this)},log:{getLogs:function(a){return function(b,c,d){return null==b&&(b=0),null==c&&(c=0),a.http({method:"get",url:"/applications/"+b+"/logs",params:{index:c,keyword:d}})}}(this),getLog:function(a){return function(b,c){return a.http({method:"get",url:"/applications/"+b+"/logs/"+c})}}(this)},user:{getUsers:function(a){return function(b){return null==b&&(b=0),a.http({method:"get",url:"/settings/users",params:{index:b}})}}(this),getUser:function(a){return function(b){return a.http({method:"get",url:"/settings/users/"+b})}}(this),inviteUser:function(a){return function(b){return a.http({method:"post",url:"/settings/users",data:{email:b}})}}(this),removeUser:function(a){return function(b){return a.http({method:"delete",url:"/settings/users/"+b})}}(this),updateUser:function(a){return function(b){return a.http({method:"put",url:"/settings/users/"+b.id,data:b})}}(this)},application:{getApplications:function(a){return function(b,c){return null==b&&(b=0),null==c&&(c=!1),a.http({method:"get",url:"/settings/applications",params:{index:b,all:c}})}}(this),addApplicationMember:function(a){return function(b,c){return a.http({method:"post",url:"/settings/applications/"+b+"/members",data:{email:c}})}}(this),addApplication:function(a){return function(b){return a.http({method:"post",url:"/settings/applications",data:b})}}(this),getApplication:function(a){return function(b){return a.http({method:"get",url:"/settings/applications/"+b})}}(this),updateApplication:function(a){return function(b){return a.http({method:"put",url:"/settings/applications/"+b.id,data:b})}}(this),removeApplication:function(a){return function(b){return a.http({method:"delete",url:"/settings/applications/"+b})}}(this)}},this.$get=["$injector",function(a){return function(b){return a.setupProviders(b),{user:a.user,url:a.url,alert:a.alert,api:a.api}}}(this)]})}.call(this),function(){angular.module("v.router",["v.provider","v.controllers","ui.router"]).config(["$stateProvider","$urlRouterProvider","$locationProvider",function(a,b,c){return c.html5Mode(!0),b.otherwise("/"),a.state("v",{url:"",templateUrl:"/views/shared/layout.html"}),a.state("v.index",{url:"/",controller:"IndexController"}),a.state("v.login",{url:"/login",resolve:{title:function(){return"Login - "}},templateUrl:"/views/login.html",controller:"LoginController"}),a.state("v.log-default",{url:"/applications",resolve:{title:function(){return"Logs - "},applications:["$v",function(a){return a.api.application.getApplications(0,!0).then(function(a){return a.data})}],logs:["$v",function(a){return a.api.log.getLogs().then(function(a){return a.data})}]},templateUrl:"/views/log/list.html",controller:"LogsController"}),a.state("v.log-list",{url:"/applications/:applicationId/logs?index?keyword",resolve:{title:function(){return"Logs - "},applications:["$v",function(a){return a.api.application.getApplications(0,!0).then(function(a){return a.data})}],logs:["$v","$stateParams",function(a,b){return a.api.log.getLogs(b.applicationId,b.index,b.keyword).then(function(a){return a.data})}]},templateUrl:"/views/log/list.html",controller:"LogsController"}),a.state("v.log-detail",{url:"/applications/:applicationId/logs/:logId",resolve:{title:function(){return"Log - "},application:["$v","$stateParams",function(a,b){return a.api.application.getApplication(b.applicationId).then(function(a){return a.data})}],log:["$v","$stateParams",function(a,b){return a.api.log.getLog(b.applicationId,b.logId).then(function(a){return a.data})}]},templateUrl:"/views/log/detail.html",controller:"LogController"}),a.state("v.settings",{url:"/settings",resolve:{title:function(){return"Settings - "}},controller:"SettingsController"}),a.state("v.settings-profile",{url:"/settings/profile",resolve:{title:function(){return"Profile - Settings - "},profile:["$v",function(a){return a.api.settings.getProfile().then(function(a){return a.data})}]},templateUrl:"/views/settings/profile.html",controller:"SettingsProfileController"}),a.state("v.settings-applications",{url:"/settings/applications?index",resolve:{title:function(){return"Applications - Settings - "},applications:["$v","$stateParams",function(a,b){return a.api.application.getApplications(b.index).then(function(a){return a.data})}]},templateUrl:"/views/settings/applications.html",controller:"SettingsApplicationsController"}),a.state("v.settings-applications.new",{url:"/new",resolve:{title:function(){return"Applications - Settings - "}},templateUrl:"/views/modal/application.html",controller:"SettingsNewApplicationController"}),a.state("v.settings-applications.detail",{url:"/:applicationId",resolve:{title:function(){return"Application - Settings - "},application:["$v","$stateParams",function(a,b){return a.api.application.getApplication(b.applicationId).then(function(a){return a.data})}]},templateUrl:"/views/modal/application.html",controller:"SettingsApplicationController"}),a.state("v.settings-users",{url:"/settings/users?index",resolve:{title:function(){return"Users - Settings - "},users:["$v","$stateParams",function(a,b){return a.api.user.getUsers(b.index).then(function(a){return a.data})}]},templateUrl:"/views/settings/users.html",controller:"SettingsUsersController"}),a.state("v.settings-users.new",{url:"/new",resolve:{title:function(){return"Users - Settings - "}},templateUrl:"/views/modal/user.html",controller:"SettingsNewUserController"}),a.state("v.settings-users.detail",{url:"/:userId",resolve:{title:function(){return"Users - Settings - "},user:["$v","$stateParams",function(a,b){return a.api.user.getUser(b.userId).then(function(a){return a.data})}]},templateUrl:"/views/modal/user.html",controller:"SettingsUserController"})}]).run(["$injector",function(a){var b,c,d,e,f,g,h;return b=a.get("$rootScope"),d=a.get("$stateParams"),c=a.get("$state"),e=a.get("$v"),b.$stateParams=d,b.$state=c,NProgress.configure({showSpinner:!1}),f=null,g=null,h=null,b.$on("$stateChangeStart",function(a,b,c,d){return f=window.event,g=d.name,h=b.name,NProgress.start()}),b.$on("$stateChangeSuccess",function(a,b){return NProgress.done(),e.user.is_login||"v.login"===b.name?void 0:c.go("v.login")}),b.$on("$stateChangeError",function(a,b){return NProgress.done(),e.user.is_login||"v.login"===b.name?void 0:c.go("v.login")}),b.$on("$viewContentLoaded",function(){if("popstate"!==(null!=f?f.type:void 0)){if(null!=g&&null!=h){if(0===g.replace(h,"").indexOf("."))return;if(0===h.replace(g,"").indexOf("."))return}return window.scrollTo(0,0)}})}])}.call(this),function(){angular.module("v.validations",["validator"]).config(["$validatorProvider",function(a){return a.register("required",{validator:/.+/,error:"This field is required."}),a.register("email",{validator:/(^$)|(^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$)/,error:"This field should be the email."})}])}.call(this); \ No newline at end of file diff --git a/application/frontend/views/modal/application.html b/application/frontend/views/modal/application.html index 43ba531..9e0b909 100644 --- a/application/frontend/views/modal/application.html +++ b/application/frontend/views/modal/application.html @@ -28,6 +28,41 @@

{{ application.app_key }}

+
+ +
+ + + + + + + + +
{{ member.name }} <{{ member.email }}> + + + +
+ +
+ + + + +
+
+