/*!
 * AngularJS Material Design
 * https://github.com/angular/material
 * @license MIT
 * v1.1.9-master-41c9d00
 */
!function(e,t,n){"use strict";function r(e,r,i,o,l,a,d,c){function u(c,u){var p=t.element("<md-select-value><span></span></md-select-value>");p.append('<span class="md-select-icon" aria-hidden="true"></span>'),p.addClass("md-select-value"),p[0].hasAttribute("id")||p.attr("id","select_value_label_"+r.nextUid());var f=c.find("md-content");if(f.length||c.append(t.element("<md-content>").append(c.contents())),f.attr("role","presentation"),u.mdOnOpen&&(c.find("md-content").prepend(t.element('<div> <md-progress-circular md-mode="indeterminate" ng-if="$$loadingAsyncDone === false" md-diameter="25px"></md-progress-circular></div>')),c.find("md-option").attr("ng-show","$$loadingAsyncDone")),u.name){var m=t.element('<select class="md-visually-hidden"></select>');m.attr({name:u.name,"aria-hidden":"true",tabindex:"-1"});var h=c.find("md-option");t.forEach(h,function(e){var n=t.element("<option>"+e.innerHTML+"</option>");e.hasAttribute("ng-value")?n.attr("ng-value",e.getAttribute("ng-value")):e.hasAttribute("value")&&n.attr("value",e.getAttribute("value")),m.append(n)}),m.append('<option ng-value="'+u.ngModel+'" selected></option>'),c.parent().append(m)}var g=r.parseAttributeBoolean(u.multiple),v=g?"multiple":"",b='<div class="md-select-menu-container" aria-hidden="true" role="presentation"><md-select-menu role="presentation" {0}>{1}</md-select-menu></div>';return b=r.supplant(b,[v,c.html()]),c.empty().append(p),c.append(b),u.tabindex||u.$set("tabindex",0),function(c,u,p,f){function m(){var e=u.attr("aria-label")||u.attr("placeholder");!e&&S&&S.label&&(e=S.label.text()),k=e,l.expect(u,"aria-label",e)}function h(){V&&(P=P||V.find("md-select-menu").controller("mdSelectMenu"),x.setLabelText(P.selectedLabels()))}function v(){if(k){var e=P.selectedLabels({mode:"aria"});u.attr("aria-label",e.length?k+": "+e:k)}}function b(){S&&S.setHasValue(P.selectedLabels().length>0||(u[0].validity||{}).badInput)}function $(){if(V=t.element(u[0].querySelector(".md-select-menu-container")),B=c,p.mdContainerClass){var e=V[0].getAttribute("class")+" "+p.mdContainerClass;V[0].setAttribute("class",e)}P=V.find("md-select-menu").controller("mdSelectMenu"),P.init(A,p.ngModel),u.on("$destroy",function(){V.remove()})}function y(e){if(i.isNavigationKey(e))e.preventDefault(),w(e);else if(s(e,i)){e.preventDefault();var n=P.optNodeForKeyboardSearch(e);if(!n||n.hasAttribute("disabled"))return;var r=t.element(n).controller("mdOption");P.isMultiple||P.deselect(Object.keys(P.selected)[0]),P.select(r.hashKey,r.value),P.refreshViewValue()}}function w(){B._mdSelectIsOpen=!0,u.attr("aria-expanded","true"),e.show({scope:B,preserveScope:!0,skipCompile:!0,element:V,target:u[0],selectCtrl:x,preserveElement:!0,hasBackdrop:!0,loadingAsync:!!p.mdOnOpen&&(c.$eval(p.mdOnOpen)||!0)})["finally"](function(){B._mdSelectIsOpen=!1,u.focus(),u.attr("aria-expanded","false"),A.$setTouched()})}var C,k,M=!0,S=f[0],x=f[1],A=f[2],O=f[3],E=u.find("md-select-value"),T=t.isDefined(p.readonly),D=r.parseAttributeBoolean(p.mdNoAsterisk);if(D&&u.addClass("md-no-asterisk"),S){var R=S.isErrorGetter||function(){return A.$invalid&&(A.$touched||O&&O.$submitted)};if(S.input&&u.find("md-select-header").find("input")[0]!==S.input[0])throw new Error("<md-input-container> can only have *one* child <input>, <textarea> or <select> element!");S.input=u,S.label||l.expect(u,"aria-label",u.attr("placeholder")),c.$watch(R,S.setInvalid)}var V,B,P;$(),o(u),O&&t.isDefined(p.multiple)&&r.nextTick(function(){var e=A.$modelValue||A.$viewValue;e&&O.$setPristine()});var L=A.$render;A.$render=function(){L(),h(),v(),b()},p.$observe("placeholder",A.$render),S&&S.label&&p.$observe("required",function(e){S.label.toggleClass("md-required",e&&!D)}),x.setLabelText=function(e){x.setIsPlaceholder(!e);var t=!1;if(p.mdSelectedText&&p.mdSelectedHtml)throw Error("md-select cannot have both `md-selected-text` and `md-selected-html`");if(p.mdSelectedText||p.mdSelectedHtml)e=a(p.mdSelectedText||p.mdSelectedHtml)(c),t=!0;else if(!e){var n=p.placeholder||(S&&S.label?S.label.text():"");e=n||"",t=!0}var r=E.children().eq(0);p.mdSelectedHtml?r.html(d.getTrustedHtml(e)):t?r.text(e):r.html(e)},x.setIsPlaceholder=function(e){e?(E.addClass("md-select-placeholder"),S&&S.label&&S.label.addClass("md-placeholder")):(E.removeClass("md-select-placeholder"),S&&S.label&&S.label.removeClass("md-placeholder"))},T||(u.on("focus",function(e){S&&S.setFocused(!0)}),u.on("blur",function(e){M&&(M=!1,B._mdSelectIsOpen&&e.stopImmediatePropagation()),B._mdSelectIsOpen||(S&&S.setFocused(!1),b())})),x.triggerClose=function(){a(p.mdOnClose)(c)},c.$$postDigest(function(){m(),h(),v()}),c.$watch(function(){return P.selectedLabels()},h);var N;p.$observe("ngMultiple",function(e){N&&N();var t=a(e);N=c.$watch(function(){return t(c)},function(e,t){e===n&&t===n||(e?u.attr("multiple","multiple"):u.removeAttr("multiple"),u.attr("aria-multiselectable",e?"true":"false"),V&&(P.setMultiple(e),L=A.$render,A.$render=function(){L(),h(),v(),b()},A.$render()))})}),p.$observe("disabled",function(e){t.isString(e)&&(e=!0),C!==n&&C===e||(C=e,e?u.attr({"aria-disabled":"true"}).removeAttr("tabindex").off("click",w).off("keydown",y):u.attr({tabindex:p.tabindex,"aria-disabled":"false"}).on("click",w).on("keydown",y))}),p.hasOwnProperty("disabled")||p.hasOwnProperty("ngDisabled")||(u.attr({"aria-disabled":"false"}),u.on("click",w),u.on("keydown",y));var _={role:"listbox","aria-expanded":"false","aria-multiselectable":g&&!p.ngMultiple?"true":"false"};u[0].hasAttribute("id")||(_.id="select_"+r.nextUid());var H="select_container_"+r.nextUid();V.attr("id",H),u.find("md-select-menu").length||(_["aria-owns"]=H),u.attr(_),c.$on("$destroy",function(){e.destroy()["finally"](function(){S&&(S.setFocused(!1),S.setHasValue(!1),S.input=null),A.$setTouched()})})}}var p=i.KEY_CODE;[p.SPACE,p.ENTER,p.UP_ARROW,p.DOWN_ARROW];return{restrict:"E",require:["^?mdInputContainer","mdSelect","ngModel","?^form"],compile:u,controller:function(){}}}function i(e,r,i,o){function l(e,n,i,l){function a(e){13!=e.keyCode&&32!=e.keyCode||d(e)}function d(n){var i=r.getClosest(n.target,"md-option"),o=i&&t.element(i).data("$mdOptionController");if(i&&o){if(i.hasAttribute("disabled"))return n.stopImmediatePropagation(),!1;var l=s.hashGetter(o.value),a=t.isDefined(s.selected[l]);e.$apply(function(){s.isMultiple?a?s.deselect(l):s.select(l,o.value):a||(s.deselect(Object.keys(s.selected)[0]),s.select(l,o.value)),s.refreshViewValue()})}}var s=l[0];n.addClass("_md"),o(n),n.on("click",d),n.on("keypress",a)}function a(i,o,l){function a(){var e=s.ngModel.$modelValue||s.ngModel.$viewValue||[];if(t.isArray(e)){var n=Object.keys(s.selected),r=e.map(s.hashGetter),i=n.filter(function(e){return r.indexOf(e)===-1});i.forEach(s.deselect),r.forEach(function(t,n){s.select(t,e[n])})}}function d(){var e=s.ngModel.$viewValue||s.ngModel.$modelValue;Object.keys(s.selected).forEach(s.deselect),s.select(s.hashGetter(e),e)}var s=this;s.isMultiple=t.isDefined(o.multiple),s.selected={},s.options={},i.$watchCollection(function(){return s.options},function(){s.ngModel.$render()});var c,p;s.setMultiple=function(e){function n(e,n){return t.isArray(e||n||[])}var r=s.ngModel;p=p||r.$isEmpty,s.isMultiple=e,c&&c(),s.isMultiple?(r.$validators["md-multiple"]=n,r.$render=a,i.$watchCollection(s.modelBinding,function(e){n(e)&&a(e)}),r.$isEmpty=function(e){return!e||0===e.length}):(delete r.$validators["md-multiple"],r.$render=d)};var f,m,h,g="",v=300;s.optNodeForKeyboardSearch=function(e){f&&clearTimeout(f),f=setTimeout(function(){f=n,g="",h=n,m=n},v),g+=e.key;var r=new RegExp("^"+g,"i");m||(m=l.find("md-option"),h=new Array(m.length),t.forEach(m,function(e,t){h[t]=e.textContent.trim()}));for(var i=0;i<h.length;++i)if(r.test(h[i]))return m[i]},s.init=function(n,o){s.ngModel=n,s.modelBinding=o,s.ngModel.$isEmpty=function(e){return!s.options[s.hashGetter(e)]};var l=r.getModelOption(n,"trackBy");if(l){var a={},d=e(l);s.hashGetter=function(e,t){return a.$value=e,d(t||i,a)}}else s.hashGetter=function(e){return t.isObject(e)?"object_"+(e.$$mdSelectId||(e.$$mdSelectId=++u)):e};s.setMultiple(s.isMultiple)},s.selectedLabels=function(e){e=e||{};var t=e.mode||"html",n=r.nodesToArray(l[0].querySelectorAll("md-option[selected]"));if(n.length){var i;return"html"==t?i=function(e){if(e.hasAttribute("md-option-empty"))return"";var t=e.innerHTML,n=e.querySelector(".md-ripple-container");n&&(t=t.replace(n.outerHTML,""));var r=e.querySelector(".md-container");return r&&(t=t.replace(r.outerHTML,"")),t}:"aria"==t&&(i=function(e){return e.hasAttribute("aria-label")?e.getAttribute("aria-label"):e.textContent}),r.uniq(n.map(i)).join(", ")}return""},s.select=function(e,t){var n=s.options[e];n&&n.setSelected(!0),s.selected[e]=t},s.deselect=function(e){var t=s.options[e];t&&t.setSelected(!1),delete s.selected[e]},s.addOption=function(e,n){if(t.isDefined(s.options[e]))throw new Error('Duplicate md-option values are not allowed in a select. Duplicate value "'+n.value+'" found.');s.options[e]=n,t.isDefined(s.selected[e])&&(s.select(e,n.value),t.isDefined(s.ngModel.$modelValue)&&s.hashGetter(s.ngModel.$modelValue)===e&&s.ngModel.$validate(),s.refreshViewValue())},s.removeOption=function(e){delete s.options[e]},s.refreshViewValue=function(){var e,n=[];for(var i in s.selected)(e=s.options[i])?n.push(e.value):n.push(s.selected[i]);var o=r.getModelOption(s.ngModel,"trackBy"),l=s.isMultiple?n:n[0],a=s.ngModel.$modelValue;(o?t.equals(a,l):a+""===l)||(s.ngModel.$setViewValue(l),s.ngModel.$render())}}return a.$inject=["$scope","$attrs","$element"],{restrict:"E",require:["mdSelectMenu"],scope:!1,controller:a,link:{pre:l}}}function o(e,n,r){function i(e,n){return e.append(t.element('<div class="md-text">').append(e.contents())),e.attr("tabindex",n.tabindex||"0"),o(n)||e.attr("md-option-empty",""),l}function o(e){var t=e.value,n=e.ngValue;return t||n}function l(i,o,l,a){function d(e,t,n){if(!u.hashGetter)return void(n||i.$$postDigest(function(){d(e,t,!0)}));var r=u.hashGetter(t,i),o=u.hashGetter(e,i);c.hashKey=o,c.value=e,u.removeOption(r,c),u.addOption(o,c)}function s(){var e={role:"option","aria-selected":"false"};o[0].hasAttribute("id")||(e.id="select_option_"+n.nextUid()),o.attr(e)}var c=a[0],u=a[1];r(o),u.isMultiple&&(o.addClass("md-checkbox-enabled"),o.prepend(p.clone())),t.isDefined(l.ngValue)?i.$watch(l.ngValue,d):t.isDefined(l.value)?d(l.value):i.$watch(function(){return o.text().trim()},d),l.$observe("disabled",function(e){e?o.attr("tabindex","-1"):o.attr("tabindex","0")}),i.$$postDigest(function(){l.$observe("selected",function(e){t.isDefined(e)&&("string"==typeof e&&(e=!0),e?(u.isMultiple||u.deselect(Object.keys(u.selected)[0]),u.select(c.hashKey,c.value)):u.deselect(c.hashKey),u.refreshViewValue())})}),e.attach(i,o),s(),i.$on("$destroy",function(){u.removeOption(c.hashKey,c)})}function a(e){this.selected=!1,this.setSelected=function(t){t&&!this.selected?e.attr({selected:"selected","aria-selected":"true"}):!t&&this.selected&&(e.removeAttr("selected"),e.attr("aria-selected","false")),this.selected=t}}return a.$inject=["$element"],{restrict:"E",require:["mdOption","^^mdSelectMenu"],controller:a,compile:i}}function l(){function e(e,n){function r(){return e.parent().find("md-select-header").length}function i(){var r=e.find("label");r.length||(r=t.element("<label>"),e.prepend(r)),r.addClass("md-container-ignore"),r.attr("aria-hidden","true"),n.label&&r.text(n.label)}r()||i()}return{restrict:"E",compile:e}}function a(){return{restrict:"E"}}function d(r){function i(r,i,u,p,f,m,h,g,v){function b(e,t,n){function r(){return o=h(t,{addClass:"md-leave"}),o.start()}function i(){l(),t.removeClass("md-active").attr("aria-hidden","true").css("display","none"),t.parent().find("md-select-value").removeAttr("aria-hidden"),y(n),!n.$destroy&&n.restoreFocus&&n.target.focus()}var o=null,l=e.$on("$destroy",function(){o.end()});return n=n||{},n.cleanupInteraction(),n.cleanupResizing(),n.hideBackdrop(),n.$destroy===!0?i():r().then(i)}function $(e,o,l){function a(e,t,n){return n.parent!==t.parent()&&t.parent().attr("aria-owns",t.attr("id")),t.parent().find("md-select-value").attr("aria-hidden","true"),n.parent.append(t),f(function(e,n){try{h(t,{removeClass:"md-leave",duration:0}).start().then(d).then(e)}catch(r){n(r)}})}function d(){return f(function(t){if(l.isRemoved)return f.reject(!1);var n=w(e,o,l);n.container.element.css(k.toCss(n.container.styles)),n.dropDown.element.css(k.toCss(n.dropDown.styles)),m(function(){o.addClass("md-active"),n.dropDown.element.css(k.toCss({transform:""})),t()})})}function c(e,t,n){return n.disableParentScroll&&!u.getClosest(n.target,"MD-DIALOG")?n.restoreScroll=u.disableScrollAround(n.element,n.parent):n.disableParentScroll=!1,n.hasBackdrop&&(n.backdrop=u.createBackdrop(e,"md-select-backdrop md-click-catcher"),g.enter(n.backdrop,v[0].body,null,{duration:0})),function(){n.backdrop&&n.backdrop.remove(),n.disableParentScroll&&n.restoreScroll(),delete n.restoreScroll}}function b(e){e&&!e.hasAttribute("disabled")&&e.focus()}function $(e,n){var r=o.find("md-select-menu");if(!n.target)throw new Error(u.supplant(C,[n.target]));t.extend(n,{isRemoved:!1,target:t.element(n.target),parent:t.element(n.parent),selectEl:r,contentEl:o.find("md-content"),optionNodes:r[0].getElementsByTagName("md-option")})}function y(){var n=function(e,t,n){return function(){if(!n.isRemoved){var r=w(e,t,n),i=r.container,o=r.dropDown;i.element.css(k.toCss(i.styles)),o.element.css(k.toCss(o.styles))}}}(e,o,l),r=t.element(p);return r.on("resize",n),r.on("orientationchange",n),function(){r.off("resize",n),r.off("orientationchange",n)}}function S(){l.loadingAsync&&!l.isRemoved&&(e.$$loadingAsyncDone=!1,f.when(l.loadingAsync).then(function(){e.$$loadingAsyncDone=!0,delete l.loadingAsync}).then(function(){m(d)}))}function x(){function e(e){e.preventDefault(),e.stopPropagation(),l.restoreFocus=!1,u.nextTick(r.hide,!0)}function t(e){switch(e.preventDefault(),e.stopPropagation(),e.keyCode){case M.UP_ARROW:return c();case M.DOWN_ARROW:return d();case M.SPACE:case M.ENTER:var t=u.getClosest(e.target,"md-option");t&&(f.triggerHandler({type:"click",target:t}),e.preventDefault()),p(e);break;case M.TAB:case M.ESCAPE:e.stopPropagation(),e.preventDefault(),l.restoreFocus=!0,u.nextTick(r.hide,!0);break;default:if(s(e,i)){var n=f.controller("mdSelectMenu").optNodeForKeyboardSearch(e);l.focusedNode=n||l.focusedNode,n&&n.focus()}}}function a(e){var t,r=u.nodesToArray(l.optionNodes),i=r.indexOf(l.focusedNode);do i===-1?i=0:"next"===e&&i<r.length-1?i++:"prev"===e&&i>0&&i--,t=r[i],t.hasAttribute("disabled")&&(t=n);while(!t&&i<r.length-1&&i>0);t&&t.focus(),l.focusedNode=t}function d(){a("next")}function c(){a("prev")}function p(e){function t(){var t=!1;if(e&&e.currentTarget.children.length>0){var n=e.currentTarget.children[0],r=n.scrollHeight>n.clientHeight;if(r&&n.children.length>0){var i=e.pageX-e.currentTarget.getBoundingClientRect().left;i>n.querySelector("md-option").offsetWidth&&(t=!0)}}return t}if(!(e&&"click"==e.type&&e.currentTarget!=f[0]||t())){var n=u.getClosest(e.target,"md-option");n&&n.hasAttribute&&!n.hasAttribute("disabled")&&(e.preventDefault(),e.stopPropagation(),m.isMultiple||(l.restoreFocus=!0,u.nextTick(function(){r.hide(m.ngModel.$viewValue)},!0)))}}if(!l.isRemoved){var f=l.selectEl,m=f.controller("mdSelectMenu")||{};return o.addClass("md-clickable"),l.backdrop&&l.backdrop.on("click",e),f.on("keydown",t),f.on("click",p),function(){l.backdrop&&l.backdrop.off("click",e),f.off("keydown",t),f.off("click",p),o.removeClass("md-clickable"),l.isRemoved=!0}}}return S(),$(e,l),l.hideBackdrop=c(e,o,l),a(e,o,l).then(function(e){return o.attr("aria-hidden","false"),l.alreadyOpen=!0,l.cleanupInteraction=x(),l.cleanupResizing=y(),b(l.focusedNode),e},l.hideBackdrop)}function y(e){var t=e.selectCtrl;if(t){var n=e.selectEl.controller("mdSelectMenu");t.setLabelText(n?n.selectedLabels():""),t.triggerClose()}}function w(n,r,i){var s,f=r[0],m=i.target[0].children[0],h=v[0].body,g=i.selectEl[0],b=i.contentEl[0],$=h.getBoundingClientRect(),y=m.getBoundingClientRect(),w=!1,C={left:$.left+c,top:c,bottom:$.height-c,right:$.width-c-(u.floatingScrollbars()?16:0)},k={top:y.top-C.top,left:y.left-C.left,right:C.right-(y.left+y.width),bottom:C.bottom-(y.top+y.height)},M=$.width-2*c,S=g.querySelector("md-option[selected]"),x=g.getElementsByTagName("md-option"),A=g.getElementsByTagName("md-optgroup"),O=d(r,b),E=o(i.loadingAsync);s=E?b.firstElementChild||b:S?S:A.length?A[0]:x.length?x[0]:b.firstElementChild||b,b.offsetWidth>M?b.style["max-width"]=M+"px":b.style.maxWidth=null,w&&(b.style["min-width"]=y.width+"px"),O&&g.classList.add("md-overflow");var T=s;"MD-OPTGROUP"===(T.tagName||"").toUpperCase()&&(T=x[0]||b.firstElementChild||b,s=T),i.focusedNode=T,f.style.display="block";var D=g.getBoundingClientRect(),R=a(s);if(s){var V=p.getComputedStyle(s);R.paddingLeft=parseInt(V.paddingLeft,10)||0,R.paddingRight=parseInt(V.paddingRight,10)||0}if(O){var B=b.offsetHeight/2;b.scrollTop=R.top+R.height/2-B,k.top<B?b.scrollTop=Math.min(R.top,b.scrollTop+B-k.top):k.bottom<B&&(b.scrollTop=Math.max(R.top+R.height-D.height,b.scrollTop-B+k.bottom))}var P,L,N,_,H;w?(P=y.left,L=y.top+y.height,N="50% 0",L+D.height>C.bottom&&(L=y.top-D.height,N="50% 100%")):(P=y.left+R.left-R.paddingLeft+2,L=Math.floor(y.top+y.height/2-R.height/2-R.top+b.scrollTop)+2,N=R.left+y.width/2+"px "+(R.top+R.height/2-b.scrollTop)+"px 0px",_=Math.min(y.width+R.paddingLeft+R.paddingRight,M),H=e.getComputedStyle(m)["font-size"]);var I=f.getBoundingClientRect(),j=Math.round(100*Math.min(y.width/D.width,1))/100,q=Math.round(100*Math.min(y.height/D.height,1))/100;return{container:{element:t.element(f),styles:{left:Math.floor(l(C.left,P,C.right-I.width)),top:Math.floor(l(C.top,L,C.bottom-I.height)),"min-width":_,"font-size":H}},dropDown:{element:t.element(g),styles:{transformOrigin:N,transform:i.alreadyOpen?"":u.supplant("scale({0},{1})",[j,q])}}}}var C="$mdSelect.show() expected a target element in options.target but got '{0}'!",k=u.dom.animator,M=i.KEY_CODE;return{parent:"body",themable:!0,onShow:$,onRemove:b,hasBackdrop:!0,disableParentScroll:!0}}function o(e){return e&&t.isFunction(e.then)}function l(e,t,n){return Math.max(e,Math.min(t,n))}function a(e){return e?{left:e.offsetLeft,top:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}:{left:0,top:0,width:0,height:0}}function d(e,t){var n=!1;try{var r=e[0].style.display;e[0].style.display="block",n=t.scrollHeight>t.offsetHeight,e[0].style.display=r}finally{}return n}return i.$inject=["$mdSelect","$mdConstant","$mdUtil","$window","$q","$$rAF","$animateCss","$animate","$document"],r("$mdSelect").setDefaults({methods:["target"],options:i})}function s(e,t){var n=String.fromCharCode(e.keyCode),r=e.keyCode<=31;return n&&n.length&&!r&&!t.isMetaKey(e)&&!t.isFnLockKey(e)&&!t.hasModifierKey(e)}r.$inject=["$mdSelect","$mdUtil","$mdConstant","$mdTheming","$mdAria","$parse","$sce","$injector"],i.$inject=["$parse","$mdUtil","$mdConstant","$mdTheming"],o.$inject=["$mdButtonInkRipple","$mdUtil","$mdTheming"],d.$inject=["$$interimElementProvider"];var c=8,u=0,p=t.element('<div class="md-container"><div class="md-icon"></div></div>');t.module("material.components.select",["material.core","material.components.backdrop"]).directive("mdSelect",r).directive("mdSelectMenu",i).directive("mdOption",o).directive("mdOptgroup",l).directive("mdSelectHeader",a).provider("$mdSelect",d)}(window,window.angular);