angular.forEach(["offset","target"],function(a){angular.isDefined(c[a])&&(e[a]=c[a])});varf=d(e);f.trackElement(e.target,b),a.$on("$destroy",function(){f.untrackElement(e.target,b),f.destroy(),e=null,f=null})}}}]).directive("bsScrollspyList",["$rootScope","debounce","dimensions","$scrollspy",function(){return{restrict:"A",compile:function(a){varb=a[0].querySelectorAll("li > a[href]");angular.forEach(b,function(a){varb=angular.element(a);b.parent().attr("bs-scrollspy","").attr("data-target",b.attr("href"))})}}}]),angular.module("mgcrea.ngStrap.select",["mgcrea.ngStrap.tooltip","mgcrea.ngStrap.helpers.parseOptions"]).provider("$select",function(){vara=this.defaults={animation:"am-fade",prefixClass:"select",placement:"bottom-left",template:"select/select.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,multiple:!1,sort:!0,caretHtml:' <span class="caret"></span>',placeholder:"Choose among the following...",maxLength:3,maxLengthHtml:"selected"};this.$get=["$window","$document","$rootScope","$tooltip",function(b,c,d,e){functionf(b,c,d){varf={},h=angular.extend({},a,d);f=e(b,h);vari=d.scope,j=f.$scope;j.$matches=[],j.$activeIndex=0,j.$isMultiple=h.multiple,j.$activate=function(a){j.$$postDigest(function(){f.activate(a)})},j.$select=function(a){j.$$postDigest(function(){f.select(a)})},j.$isVisible=function(){returnf.$isVisible()},j.$isActive=function(a){returnf.$isActive(a)},f.update=function(a){j.$matches=a,f.$updateActiveIndex()},f.activate=function(a){returnh.multiple?(j.$activeIndex.sort(),f.$isActive(a)?j.$activeIndex.splice(j.$activeIndex.indexOf(a),1):j.$activeIndex.push(a),h.sort&&j.$activeIndex.sort()):j.$activeIndex=a,j.$activeIndex},f.select=function(a){vard=j.$matches[a].value;f.activate(a),c.$setViewValue(h.multiple?j.$activeIndex.map(function(a){returnj.$matches[a].value}):d),c.$render(),i&&i.$digest(),h.multiple||("focus"===h.trigger?b[0].blur():f.$isShown&&f.hide()),j.$emit("$select.select",d,a)},f.$updateActiveIndex=function(){c.$modelValue&&j.$matches.length?j.$activeIndex=h.multiple&&angular.isArray(c.$modelValue)?c.$modelValue.map(function(a){returnf.$getIndex(a)}):f.$getIndex(c.$modelValue):j.$activeIndex>=j.$matches.length&&(j.$activeIndex=h.multiple?[]:0)},f.$isVisible=function(){returnh.minLength&&c?j.$matches.length&&c.$viewValue.length>=h.minLength:j.$matches.length},f.$isActive=function(a){returnh.multiple?-1!==j.$activeIndex.indexOf(a):j.$activeIndex===a},f.$getIndex=function(a){varb=j.$matches.length,c=b;if(b){for(c=b;c--&&j.$matches[c].value!==a;);if(!(0>c))returnc}},f.$onMouseDown=function(a){if(a.preventDefault(),a.stopPropagation(),g){varb=angular.element(a.target);b.triggerHandler("click")}},f.$onKeyDown=function(a){if(/(38|40|13)/.test(a.keyCode)){if(a.preventDefault(),a.stopPropagation(),13===a.keyCode)returnf.select(j.$activeIndex);38===a.keyCode&&j.$activeIndex>0?j.$activeIndex--:40===a.keyCode&&j.$activeIndex<j.$matches.length-1?j.$activeIndex++:angular.isUndefined(j.$activeIndex)&&(j.$activeIndex=0),j.$digest()}};vark=f.show;f.show=function(){k(),h.multiple&&f.$element.addClass("select-multiple"),setTimeout(function(){f.$element.on(g?"touchstart":"mousedown",f.$onMouseDown),h.keyboard&&b.on("keydown",f.$onKeyDown)})};varl=f.hide;returnf.hide=function(){f.$element.off(g?"touchstart":"mousedown",f.$onMouseDown),h.keyboard&&b.off("keydown",f.$onKeyDown),l()},f}varg=(angular.element(b.document.body),"createTouch"inb.document);returnf.defaults=a,f}]}).directive("bsSelect",["$window","$parse","$q","$select","$parseOptions",function(a,b,c,d,e){varf=d.defaults;return{restrict:"EAC",require:"ngModel",link:function(a,b,c,g){varh={scope:a};if(angular.forEach(["placement","container","delay","trigger","keyboard","html","animation","template","placeholder","multiple","maxLength","maxLengthHtml"],function(a){angular.isDefined(c[a])&&(h[a]=c[a])}),"select"===b[0].nodeName.toLowerCase()){vari=b;i.css("display","none"),b=angular.element('<button type="button" class="btn btn-default"></button>'),i.after(b)}varj=e(c.ngOptions),k=d(b,g,h),l=j.$match[7].repl