angular.module("ui.bootstrap",["ui.bootstrap.alert","ui.bootstrap.transition","ui.bootstrap.dialog","ui.bootstrap.modal","ui.bootstrap.tabs","ui.bootstrap.position","ui.bootstrap.tooltip","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.alert",[]).directive("alert",function(){return{restrict:"EA",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"=",close:"&"},link:function(a,b,c){a.closeable="close"in c}}}),angular.module("ui.bootstrap.transition",[]).factory("$transition",["$q","$timeout","$rootScope",function(a,b,c){function d(a){for(var b in a)if(void 0!==f.style[b])return a[b]}var e=function(d,f,g){g=g||{};var h=a.defer(),i=e[g.animation?"animationEndEventName":"transitionEndEventName"],j=function(){c.$apply(function(){d.unbind(i,j),h.resolve(d)})};return i&&d.bind(i,j),b(function(){angular.isString(f)?d.addClass(f):angular.isFunction(f)?f(d):angular.isObject(f)&&d.css(f),i||h.resolve(d)}),h.promise.cancel=function(){i&&d.unbind(i,j),h.reject("Transition cancelled")},h.promise},f=document.createElement("trans"),g={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"},h={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"};return e.transitionEndEventName=d(g),e.animationEndEventName=d(h),e}]);var dialogModule=angular.module("ui.bootstrap.dialog",["ui.bootstrap.transition"]);dialogModule.controller("MessageBoxController",["$scope","dialog","model",function(a,b,c){a.title=c.title,a.message=c.message,a.buttons=c.buttons,a.close=function(a){b.close(a)}}]),dialogModule.provider("$dialog",function(){var a={backdrop:!0,dialogClass:"modal",backdropClass:"modal-backdrop",transitionClass:"fade",triggerClass:"in",dialogOpenClass:"modal-open",resolve:{},backdropFade:!1,dialogFade:!1,keyboard:!0,backdropClick:!0},b={},c={value:0};this.options=function(a){b=a},this.$get=["$http","$document","$compile","$rootScope","$controller","$templateCache","$q","$transition","$injector",function(d,e,f,g,h,i,j,k,l){function m(a){var b=angular.element("<div>");return b.addClass(a),b}function n(c){var d=this,e=this.options=angular.extend({},a,b,c);this._open=!1,this.backdropEl=m(e.backdropClass),e.backdropFade&&(this.backdropEl.addClass(e.transitionClass),this.backdropEl.removeClass(e.triggerClass)),this.modalEl=m(e.dialogClass),e.dialogFade&&(this.modalEl.addClass(e.transitionClass),this.modalEl.removeClass(e.triggerClass)),this.handledEscapeKey=function(a){27===a.which&&(d.close(),a.preventDefault(),d.$scope.$apply())},this.handleBackDropClick=function(a){d.close(),a.preventDefault(),d.$scope.$apply()},this.handleLocationChange=function(){d.close()}}var o=e.find("body");return n.prototype.isOpen=function(){return this._open},n.prototype.open=function(a,b){var c=this,d=this.options;if(a&&(d.templateUrl=a),b&&(d.controller=b),!d.template&&!d.templateUrl)throw new Error("Dialog.open expected template or templateUrl, neither found. Use options or open method to specify them.");return this._loadResolves().then(function(a){var b=a.$scope=c.$scope=a.$scope?a.$scope:g.$new();if(c.modalEl.html(a.$template),c.options.controller){var d=h(c.options.controller,a);c.modalEl.children().data("ngControllerController",d)}f(c.modalEl)(b),c._addElementsToDom(),o.addClass(c.options.dialogOpenClass),setTimeout(function(){c.options.dialogFade&&c.modalEl.addClass(c.options.triggerClass),c.options.backdropFade&&c.backdropEl.addClass(c.options.triggerClass)}),c._bindEvents()}),this.deferred=j.defer(),this.deferred.promise},n.prototype.close=function(a){function b(a){a.removeClass(d.options.triggerClass)}function c(){d._open&&d._onCloseComplete(a)}var d=this,e=this._getFadingElements();if(o.removeClass(d.options.dialogOpenClass),e.length>0)for(var f=e.length-1;f>=0;f--)k(e[f],b).then(c);else this._onCloseComplete(a)},n.prototype._getFadingElements=function(){var a=[];return this.options.dialogFade&&a.push(this.modalEl),this.options.backdropFade&&a.push(this.backdropEl),a},n.prototype._bindEvents=function(){this.options.keyboard&&o.bind("keydown",this.handledEscapeKey),this.options.backdrop&&this.options.backdropClick&&this.backdropEl.bind("click",this.handleBackDropClick),this.$scope.$on("$locationChangeSuccess",this.handleLocationChange)},n.prototype._unbindEvents=function(){this.options.keyboard&&o.unbind("keydown",this.handledEscapeKey),this.options.backdrop&&this.options.backdropClick&&this.backdropEl.unbind("click",this.handleBackDropClick)},n.prototype._onCloseComplete=function(a){this._removeElementsFromDom(),this._unbindEvents(),this.deferred.resolve(a)},n.prototype._addElementsToDom=function(){o.append(this.modalEl),this.options.backdrop&&(0===c.value&&o.append(this.backdropEl),c.value++),this._open=!0},n.prototype._removeElementsFromDom=function(){this.modalEl.remove(),this.options.backdrop&&(c.value--,0===c.value&&this.backdropEl.remove()),this._open=!1},n.prototype._loadResolves=function(){var a,b=[],c=[],e=this;return this.options.template?a=j.when(this.options.template):this.options.templateUrl&&(a=d.get(this.options.templateUrl,{cache:i}).then(function(a){return a.data})),angular.forEach(this.options.resolve||[],function(a,d){c.push(d),b.push(angular.isString(a)?l.get(a):l.invoke(a))}),c.push("$template"),b.push(a),j.all(b).then(function(a){var b={};return angular.forEach(a,function(a,d){b[c[d]]=a}),b.dialog=e,b})},{dialog:function(a){return new n(a)},messageBox:function(a,b,c){return new n({templateUrl:"template/dialog/message.html",controller:"MessageBoxController",resolve:{model:function(){return{title:a,message:b,buttons:c}}}})}}}]}),angular.module("ui.bootstrap.modal",["ui.bootstrap.dialog"]).directive("modal",["$parse","$dialog",function(a,b){return{restrict:"EA",terminal:!0,link:function(c,d,e){var f,g=angular.extend({},c.$eval(e.uiOptions||e.bsOptions||e.options)),h=e.modal||e.show;g=angular.extend(g,{template:d.html(),resolve:{$scope:function(){return c}}});var i=b.dialog(g);d.remove(),f=e.close?function(){a(e.close)(c)}:function(){angular.isFunction(a(h).assign)&&a(h).assign(c,!1)},c.$watch(h,function(a){a?i.open().then(function(){f()}):i.isOpen()&&i.close()})}}}]),angular.module("ui.bootstrap.tabs",[]).controller("TabsController",["$scope","$element",function(a){var b=a.panes=[];this.select=a.select=function(a){angular.forEach(b,function(a){a.selected=!1}),a.selected=!0},this.addPane=function(c){b.length||a.select(c),b.push(c)},this.removePane=function(c){var d=b.indexOf(c);b.splice(d,1),c.selected&&b.length>0&&a.select(b[d<b.length?d:d-1])}}]).directive("tabs",function(){return{restrict:"EA",transclude:!0,scope:{},controller:"TabsController",templateUrl:"template/tabs/tabs.html",replace:!0}}).directive("pane",["$parse",function(a){return{require:"^tabs",restrict:"EA",transclude:!0,scope:{heading:"@"},link:function(b,c,d,e){var f,g;b.selected=!1,d.active&&(f=a(d.active),g=f.assign,b.$watch(function(){return f(b.$parent)},function(a){b.selected=a}),b.selected=f?f(b.$parent):!1),b.$watch("selected",function(a){a&&e.select(b),g&&g(b.$parent,a)}),e.addPane(b),b.$on("$destroy",function(){e.removePane(b)})},templateUrl:"template/tabs/pane.html",replace:!0}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(a,b){function c(a,c){return a.currentStyle?a.currentStyle[c]:b.getComputedStyle?b.getComputedStyle(a)[c]:a.style[c]}function d(a){return"static"===(c(a,"position")||"static")}var e=function(b){for(var c=a[0],e=b.offsetParent||c;e&&e!==c&&d(e);)e=e.offsetParent;return e||c};return{position:function(b){var c=this.offset(b),d={top:0,left:0},f=e(b[0]);return f!=a[0]&&(d=this.offset(angular.element(f)),d.top+=f.clientTop,d.left+=f.clientLeft),{width:b.prop("offsetWidth"),height:b.prop("offsetHeight"),top:c.top-d.top,left:c.left-d.left}},offset:function(c){var d=c[0].getBoundingClientRect();return{width:c.prop("offsetWidth"),height:c.prop("offsetHeight"),top:d.top+(b.pageYOffset||a[0].body.scrollTop),left:d.left+(b.pageXOffset||a[0].body.scrollLeft)}}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position"]).provider("$tooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",animation:!0,popupDelay:0},c={mouseenter:"mouseleave",click:"click",focus:"blur"},d={};this.options=function(a){angular.extend(d,a)},this.$get=["$window","$compile","$timeout","$parse","$document","$position",function(e,f,g,h,i,j){return function(e,k,l){function m(a){var b,d;return b=a||n.trigger||l,d=angular.isDefined(n.trigger)?c[n.trigger]||b:c[b]||b,{show:b,hide:d}}var n=angular.extend({},b,d),o=a(e),p=m(void 0),q="<"+o+"-popup "+'title="{{tt_title}}" '+'content="{{tt_content}}" '+'placement="{{tt_placement}}" '+'animation="tt_animation()" '+'is-open="tt_isOpen"'+">"+"</"+o+"-popup>";return{restrict:"EA",scope:!0,link:function(a,b,c){function d(){a.tt_isOpen?o():l()}function l(){a.tt_popupDelay?u=g(r,a.tt_popupDelay):a.$apply(r)}function o(){a.$apply(function(){s()})}function r(){var c,d,e,f;if(a.tt_content){switch(t&&g.cancel(t),w.css({top:0,left:0,display:"block"}),n.appendToBody?(v=v||i.find("body"),v.append(w)):b.after(w),c=j.position(b),d=w.prop("offsetWidth"),e=w.prop("offsetHeight"),a.tt_placement){case"right":f={top:c.top+c.height/2-e/2+"px",left:c.left+c.width+"px"};break;case"bottom":f={top:c.top+c.height+"px",left:c.left+c.width/2-d/2+"px"};break;case"left":f={top:c.top+c.height/2-e/2+"px",left:c.left-d+"px"};break;default:f={top:c.top-e+"px",left:c.left+c.width/2-d/2+"px"}}w.css(f),a.tt_isOpen=!0}}function s(){a.tt_isOpen=!1,g.cancel(u),angular.isDefined(a.tt_animation)&&a.tt_animation()?t=g(function(){w.remove()},500):w.remove()}var t,u,v,w=f(q)(a);a.tt_isOpen=!1,c.$observe(e,function(b){a.tt_content=b}),c.$observe(k+"Title",function(b){a.tt_title=b}),c.$observe(k+"Placement",function(b){a.tt_placement=angular.isDefined(b)?b:n.placement}),c.$observe(k+"Animation",function(b){a.tt_animation=angular.isDefined(b)?h(b):function(){return n.animation}}),c.$observe(k+"PopupDelay",function(b){var c=parseInt(b,10);a.tt_popupDelay=isNaN(c)?n.popupDelay:c}),c.$observe(k+"Trigger",function(a){b.unbind(p.show),b.unbind(p.hide),p=m(a),p.show===p.hide?b.bind(p.show,d):(b.bind(p.show,l),b.bind(p.hide,o))})}}}}]}).directive("tooltipPopup",function(){return{restrict:"E",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function(a){return a("tooltip","tooltip","mouseenter")}]).directive("tooltipHtmlUnsafePopup",function(){return{restrict:"E",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}}).directive("tooltipHtmlUnsafe",["$tooltip",function(a){return a("tooltipHtmlUnsafe","tooltip","mouseenter")}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position"]).factory("typeaheadParser",["$parse",function(a){var b=/^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error("Expected typeahead specification in form of '_modelValue_ (as _label_)? for _item_ in _collection_' but got '"+c+"'.");return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$document","$position","typeaheadParser",function(a,b,c,d,e,f){var g=[9,13,27,38,40];return{require:"ngModel",link:function(h,i,j,k){var l,m=h.$eval(j.typeaheadMinLength)||1,n=f.parse(j.typeahead),o=h.$eval(j.typeaheadEditable)!==!1,p=b(j.typeaheadLoading).assign||angular.noop,q=angular.element("<typeahead-popup matches='matches' active='activeIdx' select='select(activeIdx)' query='query' position='position'></typeahead-popup>"),r=h.$new();h.$on("$destroy",function(){r.$destroy()});var s=function(){r.matches=[],r.activeIdx=-1},t=function(a){var b={$viewValue:a};p(h,!0),c.when(n.source(r,b)).then(function(c){if(a===k.$viewValue){if(c.length>0){r.activeIdx=0,r.matches.length=0;for(var d=0;d<c.length;d++)b[n.itemName]=c[d],r.matches.push({label:n.viewMapper(r,b),model:c[d]});r.query=a,r.position=e.position(i),r.position.top=r.position.top+i.prop("offsetHeight")}else s();p(h,!1)}},function(){s(),p(h,!1)})};s(),r.query=void 0,k.$parsers.push(function(a){return s(),l?a:(a&&a.length>=m&&t(a),o?a:void 0)}),k.$render=function(){var a={};a[n.itemName]=l||k.$viewValue,i.val(n.viewMapper(r,a)||k.$viewValue),l=void 0},r.select=function(a){var b={};b[n.itemName]=l=r.matches[a].model,k.$setViewValue(n.modelMapper(r,b)),k.$render()},i.bind("keydown",function(a){0!==r.matches.length&&-1!==g.indexOf(a.which)&&(a.preventDefault(),40===a.which?(r.activeIdx=(r.activeIdx+1)%r.matches.length,r.$digest()):38===a.which?(r.activeIdx=(r.activeIdx?r.activeIdx:r.matches.length)-1,r.$digest()):13===a.which||9===a.which?r.$apply(function(){r.select(r.activeIdx)}):27===a.which&&(a.stopPropagation(),s(),r.$digest()))}),d.bind("click",function(){s(),r.$digest()}),i.after(a(q)(r))}}}]).directive("typeaheadPopup",function(){return{restrict:"E",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead.html",link:function(a){a.isOpen=function(){return a.matches.length>0},a.isActive=function(b){return a.active==b},a.selectActive=function(b){a.active=b},a.selectMatch=function(b){a.select({activeIdx:b})}}}}).filter("typeaheadHighlight",function(){function a(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(b,c){return c?b.replace(new RegExp(a(c),"gi"),"<strong>$&</strong>"):c}});