md-crud
Version:
Angular material directive to create customizable CRUD forms.
8 lines • 119 kB
JavaScript
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.1.2-master-a9ba340
*/
!function(e,t,n){"use strict";function o(e,t){if(t.has("$swipe")){var n="You are using the ngTouch module. \nAngular Material already has mobile click, tap, and swipe support... \nngTouch is not supported with Angular Material!";e.warn(n)}}function r(e,t){e.decorator("$$rAF",["$delegate",d]),e.decorator("$q",["$delegate",a]),t.theme("default").primaryPalette("indigo").accentPalette("pink").warnPalette("deep-orange").backgroundPalette("grey")}function d(e){return e.throttle=function(t){var n,o,r,d;return function(){n=arguments,d=this,r=t,o||(o=!0,e(function(){r.apply(d,Array.prototype.slice.call(n)),o=!1}))}},e}function a(e){return e.resolve||(e.resolve=e.when),e}function i(e){function n(n,o,r){function d(e){t.isUndefined(e)&&(e=!0),o.toggleClass("md-autofocus",!!e)}var a=r.mdAutoFocus||r.mdAutofocus||r.mdSidenavFocus;d(e(a)(n)),a&&n.$watch(a,d)}return{restrict:"A",link:{pre:n}}}function m(){function e(e){var t="#"===e[0]?e.substr(1):e,n=t.length/3,o=t.substr(0,n),r=t.substr(n,n),d=t.substr(2*n);return 1===n&&(o+=o,r+=r,d+=d),"rgba("+parseInt(o,16)+","+parseInt(r,16)+","+parseInt(d,16)+",0.1)"}function t(e){e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);var t=e&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):"";return t.toUpperCase()}function n(e){return e.replace(")",", 0.1)").replace("(","a(")}function o(e){return e?e.replace("rgba","rgb").replace(/,[^\),]+\)/,")"):"rgb(0,0,0)"}return{rgbaToHex:t,hexToRgba:e,rgbToRgba:n,rgbaToRgb:o}}function c(){function e(e){var t=a+"-"+e,r=o(t),i=r.charAt(0).toLowerCase()+r.substring(1);return n(d,e)?e:n(d,r)?r:n(d,i)?i:e}function n(e,n){return t.isDefined(e.style[n])}function o(e){return e.replace(m,function(e,t,n,o){return o?n.toUpperCase():n})}function r(e){var t,n,o=/^(Moz|webkit|ms)(?=[A-Z])/;for(t in e.style)if(n=o.exec(t))return n[0]}var d=document.createElement("div"),a=r(d),i=/webkit/i.test(a),m=/([:\-_]+(.))/g,c={isInputKey:function(e){return e.keyCode>=31&&e.keyCode<=90},isNumPadKey:function(e){return 3===e.location&&e.keyCode>=97&&e.keyCode<=105},isNavigationKey:function(e){var t=c.KEY_CODE,n=[t.SPACE,t.ENTER,t.UP_ARROW,t.DOWN_ARROW];return n.indexOf(e.keyCode)!=-1},ELEMENT_MAX_PIXELS:1533917,BEFORE_NG_ARIA:210,KEY_CODE:{COMMA:188,SEMICOLON:186,ENTER:13,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,TAB:9,BACKSPACE:8,DELETE:46},CSS:{TRANSITIONEND:"transitionend"+(i?" webkitTransitionEnd":""),ANIMATIONEND:"animationend"+(i?" webkitAnimationEnd":""),TRANSFORM:e("transform"),TRANSFORM_ORIGIN:e("transformOrigin"),TRANSITION:e("transition"),TRANSITION_DURATION:e("transitionDuration"),ANIMATION_PLAY_STATE:e("animationPlayState"),ANIMATION_DURATION:e("animationDuration"),ANIMATION_NAME:e("animationName"),ANIMATION_TIMING:e("animationTimingFunction"),ANIMATION_DIRECTION:e("animationDirection")},MEDIA:{xs:"(max-width: 599px)","gt-xs":"(min-width: 600px)",sm:"(min-width: 600px) and (max-width: 959px)","gt-sm":"(min-width: 960px)",md:"(min-width: 960px) and (max-width: 1279px)","gt-md":"(min-width: 1280px)",lg:"(min-width: 1280px) and (max-width: 1919px)","gt-lg":"(min-width: 1920px)",xl:"(min-width: 1920px)",landscape:"(orientation: landscape)",portrait:"(orientation: portrait)",print:"print"},MEDIA_PRIORITY:["xl","gt-lg","lg","gt-md","md","gt-sm","sm","gt-xs","xs","landscape","portrait","print"]};return c}function l(e,n){function o(){return[].concat(M)}function r(){return M.length}function d(e){return M.length&&e>-1&&e<M.length}function a(e){return!!e&&d(u(e)+1)}function i(e){return!!e&&d(u(e)-1)}function m(e){return d(e)?M[e]:null}function c(e,t){return M.filter(function(n){return n[e]===t})}function l(e,n){return e?(t.isNumber(n)||(n=M.length),M.splice(n,0,e),u(e)):-1}function s(e){p(e)&&M.splice(u(e),1)}function u(e){return M.indexOf(e)}function p(e){return e&&u(e)>-1}function h(){return M.length?M[0]:null}function E(){return M.length?M[M.length-1]:null}function f(e,o,r,a){r=r||b;for(var i=u(o);;){if(!d(i))return null;var m=i+(e?-1:1),c=null;if(d(m)?c=M[m]:n&&(c=e?E():h(),m=u(c)),null===c||m===a)return null;if(r(c))return c;t.isUndefined(a)&&(a=m),i=m}}var b=function(){return!0};e&&!t.isArray(e)&&(e=Array.prototype.slice.call(e)),n=!!n;var M=e||[];return{items:o,count:r,inRange:d,contains:p,indexOf:u,itemAt:m,findBy:c,add:l,remove:s,first:h,last:E,next:t.bind(null,f,!1),previous:t.bind(null,f,!0),hasPrevious:i,hasNext:a}}function s(e,n,o){function r(e){var n=u[e];t.isUndefined(n)&&(n=u[e]=d(e));var o=h[n];return t.isUndefined(o)&&(o=a(n)),o}function d(t){return e.MEDIA[t]||("("!==t.charAt(0)?"("+t+")":t)}function a(e){var t=p[e];return t||(t=p[e]=o.matchMedia(e)),t.addListener(i),h[t.media]=!!t.matches}function i(e){n.$evalAsync(function(){h[e.media]=!!e.matches})}function m(e){return p[e]}function c(t,n){for(var o=0;o<e.MEDIA_PRIORITY.length;o++){var r=e.MEDIA_PRIORITY[o];if(p[u[r]].matches){var d=s(t,n+"-"+r);if(t[d])return t[d]}}return t[s(t,n)]}function l(n,o,r){var d=[];return n.forEach(function(n){var a=s(o,n);t.isDefined(o[a])&&d.push(o.$observe(a,t.bind(void 0,r,null)));for(var i in e.MEDIA)a=s(o,n+"-"+i),t.isDefined(o[a])&&d.push(o.$observe(a,t.bind(void 0,r,i)))}),function(){d.forEach(function(e){e()})}}function s(e,t){return E[t]||(E[t]=e.$normalize(t))}var u={},p={},h={},E={};return r.getResponsiveAttribute=c,r.getQuery=m,r.watchResponsiveAttributes=l,r}function u(e,n){function o(e){return e=t.isArray(e)?e:[e],e.forEach(function(t){m.forEach(function(n){e.push(n+"-"+t)})}),e}function r(e){return e=t.isArray(e)?e:[e],o(e).map(function(e){return"["+e+"]"}).join(",")}function d(e,t){if(e=i(e),!e)return!1;for(var n=o(t),r=0;r<n.length;r++)if(e.hasAttribute(n[r]))return!0;return!1}function a(e,t){e=i(e),e&&o(t).forEach(function(t){e.removeAttribute(t)})}function i(e){if(e=e[0]||e,e.nodeType)return e}var m=["data","x"];return e?n?r(e):o(e):{buildList:o,buildSelector:r,hasAttribute:d,removeAttribute:a}}function p(o,r,d,a,i,m,c,l,s,u){function p(e){return e?h(e)||E(e)?e:e+"px":"0"}function h(e){return String(e).indexOf("px")>-1}function E(e){return String(e).indexOf("%")>-1}function f(e){return e[0]||e}var b=m.startSymbol(),M=m.endSymbol(),g="{{"===b&&"}}"===M,A=function(e,n,o){var r=!1;if(e&&e.length){var d=s.getComputedStyle(e[0]);r=t.isDefined(d[n])&&(!o||d[n]==o)}return r},T={dom:{},now:e.performance&&e.performance.now?t.bind(e.performance,e.performance.now):Date.now||function(){return(new Date).getTime()},getModelOption:function(e,t){if(e.$options){var n=e.$options;return n.getOption?n.getOption(t):n[t]}},bidi:function(e,n,r,d){var a=!("rtl"==o[0].dir||"rtl"==o[0].body.dir);if(0==arguments.length)return a?"ltr":"rtl";var i=t.element(e);a&&t.isDefined(r)?i.css(n,p(r)):!a&&t.isDefined(d)&&i.css(n,p(d))},bidiProperty:function(e,n,r,d){var a=!("rtl"==o[0].dir||"rtl"==o[0].body.dir),i=t.element(e);a&&t.isDefined(n)?(i.css(n,p(d)),i.css(r,"")):!a&&t.isDefined(r)&&(i.css(r,p(d)),i.css(n,""))},clientRect:function(e,t,n){var o=f(e);t=f(t||o.offsetParent||document.body);var r=o.getBoundingClientRect(),d=n?t.getBoundingClientRect():{left:0,top:0,width:0,height:0};return{left:r.left-d.left,top:r.top-d.top,width:r.width,height:r.height}},offsetRect:function(e,t){return T.clientRect(e,t,!0)},nodesToArray:function(e){e=e||[];for(var t=[],n=0;n<e.length;++n)t.push(e.item(n));return t},getViewportTop:function(){return e.scrollY||e.pageYOffset||0},findFocusTarget:function(e,n){function o(e,n){var o,r=e[0].querySelectorAll(n);return r&&r.length&&r.length&&t.forEach(r,function(e){e=t.element(e);var n=e.hasClass("md-autofocus");n&&(o=e)}),o}var r,d=this.prefixer("md-autofocus",!0);return r=o(e,n||d),r||n==d||(r=o(e,this.prefixer("md-auto-focus",!0)),r||(r=o(e,d))),r},disableScrollAround:function(e,n,r){function d(e){function n(e){e.preventDefault()}e=t.element(e||i);var o;return r.disableScrollMask?o=e:(o=t.element('<div class="md-scroll-mask"> <div class="md-scroll-mask-bar"></div></div>'),e.append(o)),o.on("wheel",n),o.on("touchmove",n),function(){o.off("wheel"),o.off("touchmove"),r.disableScrollMask||o[0].parentNode.removeChild(o[0])}}function a(){var e=o[0].documentElement,n=e.style.cssText||"",r=i.style.cssText||"",d=T.getViewportTop(),a=i.clientWidth,m=i.scrollHeight>i.clientHeight+1;return m&&t.element(i).css({position:"fixed",width:"100%",top:-d+"px"}),i.clientWidth<a&&(i.style.overflow="hidden"),m&&(e.style.overflowY="scroll"),function(){i.style.cssText=r,e.style.cssText=n,i.scrollTop=d}}if(r=r||{},T.disableScrollAround._count=Math.max(0,T.disableScrollAround._count||0),T.disableScrollAround._count++,T.disableScrollAround._restoreScroll)return T.disableScrollAround._restoreScroll;var i=o[0].body,m=a(),c=d(n);return T.disableScrollAround._restoreScroll=function(){--T.disableScrollAround._count<=0&&(m(),c(),delete T.disableScrollAround._restoreScroll)}},enableScrolling:function(){var e=this.disableScrollAround._restoreScroll;e&&e()},floatingScrollbars:function(){if(this.floatingScrollbars.cached===n){var e=t.element("<div><div></div></div>").css({width:"100%","z-index":-1,position:"absolute",height:"35px","overflow-y":"scroll"});e.children().css("height","60px"),o[0].body.appendChild(e[0]),this.floatingScrollbars.cached=e[0].offsetWidth==e[0].childNodes[0].offsetWidth,e.remove()}return this.floatingScrollbars.cached},forceFocus:function(t){var n=t[0]||t;document.addEventListener("click",function r(e){e.target===n&&e.$focus&&(n.focus(),e.stopImmediatePropagation(),e.preventDefault(),n.removeEventListener("click",r))},!0);var o=document.createEvent("MouseEvents");o.initMouseEvent("click",!1,!0,e,{},0,0,0,0,!1,!1,!1,!1,0,null),o.$material=!0,o.$focus=!0,n.dispatchEvent(o)},createBackdrop:function(e,t){return d(T.supplant('<md-backdrop class="{0}">',[t]))(e)},supplant:function(e,t,n){return n=n||/\{([^\{\}]*)\}/g,e.replace(n,function(e,n){var o=n.split("."),r=t;try{for(var d in o)o.hasOwnProperty(d)&&(r=r[o[d]])}catch(a){r=e}return"string"==typeof r||"number"==typeof r?r:e})},fakeNgModel:function(){return{$fake:!0,$setTouched:t.noop,$setViewValue:function(e){this.$viewValue=e,this.$render(e),this.$viewChangeListeners.forEach(function(e){e()})},$isEmpty:function(e){return 0===(""+e).length},$parsers:[],$formatters:[],$viewChangeListeners:[],$render:t.noop}},debounce:function(e,t,o,d){var a;return function(){var i=o,m=Array.prototype.slice.call(arguments);r.cancel(a),a=r(function(){a=n,e.apply(i,m)},t||10,d)}},throttle:function(e,t){var n;return function(){var o=this,r=arguments,d=T.now();(!n||d-n>t)&&(e.apply(o,r),n=d)}},time:function(e){var t=T.now();return e(),T.now()-t},valueOnUse:function(e,t,n){var o=null,r=Array.prototype.slice.call(arguments),d=r.length>3?r.slice(3):[];Object.defineProperty(e,t,{get:function(){return null===o&&(o=n.apply(e,d)),o}})},nextUid:function(){return""+P++},disconnectScope:function(e){if(e&&e.$root!==e&&!e.$$destroyed){var t=e.$parent;e.$$disconnected=!0,t.$$childHead===e&&(t.$$childHead=e.$$nextSibling),t.$$childTail===e&&(t.$$childTail=e.$$prevSibling),e.$$prevSibling&&(e.$$prevSibling.$$nextSibling=e.$$nextSibling),e.$$nextSibling&&(e.$$nextSibling.$$prevSibling=e.$$prevSibling),e.$$nextSibling=e.$$prevSibling=null}},reconnectScope:function(e){if(e&&e.$root!==e&&e.$$disconnected){var t=e,n=t.$parent;t.$$disconnected=!1,t.$$prevSibling=n.$$childTail,n.$$childHead?(n.$$childTail.$$nextSibling=t,n.$$childTail=t):n.$$childHead=n.$$childTail=t}},getClosest:function(e,n,o){if(t.isString(n)){var r=n.toUpperCase();n=function(e){return e.nodeName.toUpperCase()===r}}if(e instanceof t.element&&(e=e[0]),o&&(e=e.parentNode),!e)return null;do if(n(e))return e;while(e=e.parentNode);return null},elementContains:function(n,o){var r=e.Node&&e.Node.prototype&&Node.prototype.contains,d=r?t.bind(n,n.contains):t.bind(n,function(e){return n===o||!!(16&this.compareDocumentPosition(e))});return d(o)},extractElementByName:function(e,n,o,r){function d(e){return a(e)||(o?i(e):null)}function a(e){if(e)for(var t=0,o=e.length;t<o;t++)if(e[t].nodeName.toLowerCase()===n)return e[t];return null}function i(e){var t;if(e)for(var n=0,o=e.length;n<o;n++){var r=e[n];if(!t)for(var a=0,i=r.childNodes.length;a<i;a++)t=t||d([r.childNodes[a]])}return t}var m=d(e);return!m&&r&&c.warn(T.supplant("Unable to find node '{0}' in element '{1}'.",[n,e[0].outerHTML])),t.element(m||e)},initOptionalProperties:function(e,n,o){o=o||{},t.forEach(e.$$isolateBindings,function(r,d){if(r.optional&&t.isUndefined(e[d])){var a=t.isDefined(n[r.attrName]);e[d]=t.isDefined(o[d])?o[d]:a}})},nextTick:function(e,t,n){function o(){var e=d.queue,t=d.digest;d.queue=[],d.timeout=null,d.digest=!1,e.forEach(function(e){var t=e.scope&&e.scope.$$destroyed;t||e.callback()}),t&&a.$digest()}var d=T.nextTick,i=d.timeout,m=d.queue||[];return m.push({scope:n,callback:e}),null==t&&(t=!0),d.digest=d.digest||t,d.queue=m,i||(d.timeout=r(o,0,!1))},processTemplate:function(e){return g?e:e&&t.isString(e)?e.replace(/\{\{/g,b).replace(/}}/g,M):e},getParentWithPointerEvents:function(e){for(var t=e.parent();A(t,"pointer-events","none");)t=t.parent();return t},getNearestContentElement:function(e){for(var t=e.parent()[0];t&&t!==l[0]&&t!==document.body&&"MD-CONTENT"!==t.nodeName.toUpperCase();)t=t.parentNode;return t},checkStickySupport:function(){var e,n=t.element("<div>");o[0].body.appendChild(n[0]);for(var r=["sticky","-webkit-sticky"],d=0;d<r.length;++d)if(n.css({position:r[d],top:0,"z-index":2}),n.css("position")==r[d]){e=r[d];break}return n.remove(),e},parseAttributeBoolean:function(e,t){return""===e||!!e&&(t===!1||"false"!==e&&"0"!==e)},hasComputedStyle:A,isParentFormSubmitted:function(e){var n=T.getClosest(e,"form"),o=n?t.element(n).controller("form"):null;return!!o&&o.$submitted},animateScrollTo:function(e,t,n){function o(){var n=r();e.scrollTop=n,(m?n<t:n>t)&&u(o)}function r(){var e=n||1e3,t=T.now()-c;return d(t,a,i,e)}function d(e,t,n,o){if(e>o)return t+n;var r=(e/=o)*e,d=r*e;return t+n*(-2*d+3*r)}var a=e.scrollTop,i=t-a,m=a<t,c=T.now();u(o)},uniq:function(e){if(e)return e.filter(function(e,t,n){return n.indexOf(e)===t})}};return T.dom.animator=i(T),T}function h(){function e(){t.showWarnings=!1}var t={showWarnings:!0};return{disableWarnings:e,$get:["$$rAF","$log","$window","$interpolate",function(e,n,o,r){return E.apply(t,arguments)}]}}function E(e,n,o,r){function d(e,o,r){var d=t.element(e)[0]||e;!d||d.hasAttribute(o)&&0!==d.getAttribute(o).length||l(d,o)||(r=t.isString(r)?r.trim():"",r.length?e.attr(o,r):s&&n.warn('ARIA: Attribute "',o,'", required for accessibility, is missing on node:',d))}function a(t,n,o){e(function(){d(t,n,o())})}function i(e,t){var n=c(e)||"",o=n.indexOf(r.startSymbol())>-1;o?a(e,t,function(){return c(e)}):d(e,t,n)}function m(e,t){var n=c(e),o=n.indexOf(r.startSymbol())>-1;o||n||d(e,t,n)}function c(e){function t(t){for(;t.parentNode&&(t=t.parentNode)!==e;)if(t.getAttribute&&"true"===t.getAttribute("aria-hidden"))return!0}e=e[0]||e;for(var n,o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),r="";n=o.nextNode();)t(n)||(r+=n.textContent);return r.trim()||""}function l(e,t){function n(e){var t=e.currentStyle?e.currentStyle:o.getComputedStyle(e);return"none"===t.display}var r=e.hasChildNodes(),d=!1;if(r)for(var a=e.childNodes,i=0;i<a.length;i++){var m=a[i];1===m.nodeType&&m.hasAttribute(t)&&(n(m)||(d=!0))}return d}var s=this.showWarnings;return{expect:d,expectAsync:a,expectWithText:i,expectWithoutText:m,getText:c}}function f(e,t,n,o,r){this.$q=e,this.$templateRequest=t,this.$injector=n,this.$compile=o,this.$controller=r}function b(){}function M(n,o,r){function d(e){return function(t,n){n.distance<this.state.options.maxDistance&&this.dispatchEvent(t,e,n)}}function a(e,t,n){var o=U[t.replace(/^\$md./,"")];if(!o)throw new Error("Failed to register element with handler "+t+". Available handlers: "+Object.keys(U).join(", "));return o.registerElement(e,n)}function i(e,o){var r=new n(e);return t.extend(r,o),U[e]=r,h}function m(){for(var e=document.createElement("div"),n=["","webkit","Moz","MS","ms","o"],o=0;o<n.length;o++){var r=n[o],d=r?r+"TouchAction":"touchAction";if(t.isDefined(e.style[d]))return d}}var c=navigator.userAgent||navigator.vendor||e.opera,l=c.match(/ipad|iphone|ipod/i),s=c.match(/android/i),u=m(),p="undefined"!=typeof e.jQuery&&t.element===e.jQuery,h={handler:i,register:a,isHijackingClicks:(l||s)&&!p&&!F};if(h.isHijackingClicks){var E=6;h.handler("click",{options:{maxDistance:E},onEnd:d("click")}),h.handler("focus",{options:{maxDistance:E},onEnd:function(e,t){function n(e){var t=["INPUT","SELECT","BUTTON","TEXTAREA","VIDEO","AUDIO"];return"-1"!=e.getAttribute("tabindex")&&!e.hasAttribute("DISABLED")&&(e.hasAttribute("tabindex")||e.hasAttribute("href")||e.isContentEditable||t.indexOf(e.nodeName)!=-1)}t.distance<this.state.options.maxDistance&&n(e.target)&&(this.dispatchEvent(e,"focus",t),e.target.focus())}}),h.handler("mouseup",{options:{maxDistance:E},onEnd:d("mouseup")}),h.handler("mousedown",{onStart:function(e){this.dispatchEvent(e,"mousedown")}})}return h.handler("press",{onStart:function(e,t){this.dispatchEvent(e,"$md.pressdown")},onEnd:function(e,t){this.dispatchEvent(e,"$md.pressup")}}).handler("hold",{options:{maxDistance:6,delay:500},onCancel:function(){r.cancel(this.state.timeout)},onStart:function(e,n){return this.state.registeredParent?(this.state.pos={x:n.x,y:n.y},void(this.state.timeout=r(t.bind(this,function(){this.dispatchEvent(e,"$md.hold"),this.cancel()}),this.state.options.delay,!1))):this.cancel()},onMove:function(e,t){u||"touchmove"!==e.type||e.preventDefault();var n=this.state.pos.x-t.x,o=this.state.pos.y-t.y;Math.sqrt(n*n+o*o)>this.options.maxDistance&&this.cancel()},onEnd:function(){this.onCancel()}}).handler("drag",{options:{minDistance:6,horizontal:!0,cancelMultiplier:1.5},onSetup:function(e,t){u&&(this.oldTouchAction=e[0].style[u],e[0].style[u]=t.horizontal===!1?"pan-y":"pan-x")},onCleanup:function(e){this.oldTouchAction&&(e[0].style[u]=this.oldTouchAction)},onStart:function(e){this.state.registeredParent||this.cancel()},onMove:function(e,t){var n,o;u||"touchmove"!==e.type||e.preventDefault(),this.state.dragPointer?this.dispatchDragMove(e):(this.state.options.horizontal?(n=Math.abs(t.distanceX)>this.state.options.minDistance,o=Math.abs(t.distanceY)>this.state.options.minDistance*this.state.options.cancelMultiplier):(n=Math.abs(t.distanceY)>this.state.options.minDistance,o=Math.abs(t.distanceX)>this.state.options.minDistance*this.state.options.cancelMultiplier),n?(this.state.dragPointer=v(e),k(e,this.state.dragPointer),this.dispatchEvent(e,"$md.dragstart",this.state.dragPointer)):o&&this.cancel())},dispatchDragMove:o.throttle(function(e){this.state.isRunning&&(k(e,this.state.dragPointer),this.dispatchEvent(e,"$md.drag",this.state.dragPointer))}),onEnd:function(e,t){this.state.dragPointer&&(k(e,this.state.dragPointer),this.dispatchEvent(e,"$md.dragend",this.state.dragPointer))}}).handler("swipe",{options:{minVelocity:.65,minDistance:10},onEnd:function(e,t){var n;Math.abs(t.velocityX)>this.state.options.minVelocity&&Math.abs(t.distanceX)>this.state.options.minDistance?(n="left"==t.directionX?"$md.swipeleft":"$md.swiperight",this.dispatchEvent(e,n)):Math.abs(t.velocityY)>this.state.options.minVelocity&&Math.abs(t.distanceY)>this.state.options.minDistance&&(n="up"==t.directionY?"$md.swipeup":"$md.swipedown",this.dispatchEvent(e,n))}})}function g(e){this.name=e,this.state={}}function A(){function n(e,n,o){o=o||L;var r=new t.element.Event(n);r.$material=!0,r.pointer=o,r.srcEvent=e,t.extend(r,{clientX:o.x,clientY:o.y,screenX:o.x,screenY:o.y,pageX:o.x,pageY:o.y,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey}),t.element(o.target).trigger(r)}function o(t,n,o){o=o||L;var r;"click"===n||"mouseup"==n||"mousedown"==n?(r=document.createEvent("MouseEvents"),r.initMouseEvent(n,!0,!0,e,t.detail,o.x,o.y,o.x,o.y,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget||null)):(r=document.createEvent("CustomEvent"),r.initCustomEvent(n,!0,!0,{})),r.$material=!0,r.pointer=o,r.srcEvent=t,o.target.dispatchEvent(r)}var r="undefined"!=typeof e.jQuery&&t.element===e.jQuery;return g.prototype={options:{},dispatchEvent:r?n:o,onSetup:t.noop,onCleanup:t.noop,onStart:t.noop,onMove:t.noop,onEnd:t.noop,onCancel:t.noop,start:function(e,n){if(!this.state.isRunning){var o=this.getNearestParent(e.target),r=o&&o.$mdGesture[this.name]||{};this.state={isRunning:!0,options:t.extend({},this.options,r),registeredParent:o},this.onStart(e,n)}},move:function(e,t){this.state.isRunning&&this.onMove(e,t)},end:function(e,t){this.state.isRunning&&(this.onEnd(e,t),this.state.isRunning=!1)},cancel:function(e,t){this.onCancel(e,t),this.state={}},getNearestParent:function(e){for(var t=e;t;){if((t.$mdGesture||{})[this.name])return t;t=t.parentNode}return null},registerElement:function(e,t){function n(){delete e[0].$mdGesture[o.name],e.off("$destroy",n),o.onCleanup(e,t||{})}var o=this;return e[0].$mdGesture=e[0].$mdGesture||{},e[0].$mdGesture[this.name]=t||{},e.on("$destroy",n),o.onSetup(e,t||{}),n}},g}function T(e,n){function o(e){var t=!e.clientX&&!e.clientY;t||e.$material||e.isIonicTap||N(e)||(e.preventDefault(),e.stopPropagation())}function r(e){var t=0===e.clientX&&0===e.clientY;t||e.$material||e.isIonicTap||N(e)?(Y=null,"label"==e.target.tagName.toLowerCase()&&(Y={x:e.x,y:e.y})):(e.preventDefault(),e.stopPropagation(),Y=null)}function d(e,t){var o;for(var r in U)o=U[r],o instanceof n&&("start"===e&&o.cancel(),o[e](t,L))}function a(e){if(!L){var t=+Date.now();j&&!_(e,j)&&t-j.endTime<1500||(L=v(e),d("start",e))}}function i(e){L&&_(e,L)&&(k(e,L),d("move",e))}function m(e){L&&_(e,L)&&(k(e,L),L.endTime=+Date.now(),d("end",e),j=L,L=null)}document.contains||(document.contains=function(e){return document.body.contains(e)}),!W&&e.isHijackingClicks&&(document.addEventListener("click",r,!0),document.addEventListener("mouseup",o,!0),document.addEventListener("mousedown",o,!0),document.addEventListener("focus",o,!0),W=!0);var c="mousedown touchstart pointerdown",l="mousemove touchmove pointermove",s="mouseup mouseleave touchend touchcancel pointerup pointercancel";t.element(document).on(c,a).on(l,i).on(s,m).on("$$mdGestureReset",function(){j=L=null})}function v(e){var t=y(e),n={startTime:+Date.now(),target:e.target,type:e.type.charAt(0)};return n.startX=n.x=t.pageX,n.startY=n.y=t.pageY,n}function _(e,t){return e&&t&&e.type.charAt(0)===t.type}function N(e){return Y&&Y.x==e.x&&Y.y==e.y}function k(e,t){var n=y(e),o=t.x=n.pageX,r=t.y=n.pageY;t.distanceX=o-t.startX,t.distanceY=r-t.startY,t.distance=Math.sqrt(t.distanceX*t.distanceX+t.distanceY*t.distanceY),t.directionX=t.distanceX>0?"right":t.distanceX<0?"left":"",t.directionY=t.distanceY>0?"down":t.distanceY<0?"up":"",t.duration=+Date.now()-t.startTime,t.velocityX=t.distanceX/t.duration,t.velocityY=t.distanceY/t.duration}function y(e){return e=e.originalEvent||e,e.touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0]||e}function H(e,n){this.$timeout=e,this.$mdUtil=n,this.bodyElement=t.element(document.body),this.isBuffering=!1,this.bufferTimeout=null,this.lastInteractionType=null,this.lastInteractionTime=null,this.inputEventMap={keydown:"keyboard",mousedown:"mouse",mouseenter:"mouse",touchstart:"touch",pointerdown:"pointer",MSPointerDown:"pointer"},this.iePointerMap={2:"touch",3:"touch",4:"mouse"},this.initializeEvents()}function w(){function e(e){function n(e){return m.optionsFactory=e.options,m.methods=(e.methods||[]).concat(a),c}function o(e,t){return i[e]=t,c}function r(t,n){if(n=n||{},n.methods=n.methods||[],n.options=n.options||function(){return{}},/^cancel|hide|show$/.test(t))throw new Error("Preset '"+t+"' in "+e+" is reserved!");if(n.methods.indexOf("_options")>-1)throw new Error("Method '_options' in "+e+" is reserved!");return m.presets[t]={methods:n.methods.concat(a),optionsFactory:n.options,argOption:n.argOption},c}function d(n,o){function r(e){return e=e||{},e._options&&(e=e._options),s.show(t.extend({},l,e))}function d(e){return s.destroy(e)}function a(t,n){var r={};return r[e]=u,o.invoke(t||function(){return n},{},r)}var c,l,s=n(),u={hide:s.hide,cancel:s.cancel,show:r,destroy:d};return c=m.methods||[],l=a(m.optionsFactory,{}),t.forEach(i,function(e,t){u[t]=e}),t.forEach(m.presets,function(e,n){function o(e){this._options=t.extend({},r,e)}var r=a(e.optionsFactory,{}),d=(e.methods||[]).concat(c);if(t.extend(r,{$type:n}),t.forEach(d,function(e){o.prototype[e]=function(t){return this._options[e]=t,this}}),e.argOption){var i="show"+n.charAt(0).toUpperCase()+n.slice(1);u[i]=function(e){var t=u[n](e);return u.show(t)}}u[n]=function(n){return arguments.length&&e.argOption&&!t.isObject(n)&&!t.isArray(n)?(new o)[e.argOption](n):new o(n)}}),u}d.$inject=["$$interimElement","$injector"];var a=["onHide","onShow","onRemove"],i={},m={presets:{}},c={setDefaults:n,addPreset:r,addMethod:o,$get:d};return c.addPreset("build",{methods:["controller","controllerAs","resolve","multiple","template","templateUrl","themable","transformTemplate","parent","contentElement"]}),c}function o(e,o,r,d,a,i,m,c,l,s,u){return function(){function p(e){e=e||{};var t=new M(e||{}),n=e.multiple?o.resolve():o.all(T);e.multiple||(n=n.then(function(){var e=v.concat(_.map(g.cancel));return o.all(e)}));var r=n.then(function(){return t.show()["catch"](function(e){return e})["finally"](function(){T.splice(T.indexOf(r),1),_.push(t)})});return T.push(r),t.deferred.promise["catch"](function(e){return e instanceof Error&&u(e),e}),t.deferred.promise}function h(e,t){function r(n){var o=n.remove(e,!1,t||{})["catch"](function(e){return e})["finally"](function(){v.splice(v.indexOf(o),1)});return _.splice(_.indexOf(n),1),v.push(o),n.deferred.promise}return t=t||{},t.closeAll?o.all(_.slice().reverse().map(r)):t.closeTo!==n?o.all(_.slice(t.closeTo).map(r)):r(_[_.length-1])}function E(e,n){var r=_.pop();if(!r)return o.when(e);var d=r.remove(e,!0,n||{})["catch"](function(e){return e})["finally"](function(){v.splice(v.indexOf(d),1)});return v.push(d),r.deferred.promise["catch"](t.noop)}function f(e){return function(){var t=arguments;return _.length?e.apply(g,t):T.length?T[0]["finally"](function(){return e.apply(g,t)}):o.when("No interim elements currently showing up.")}}function b(e){var n=e?null:_.shift(),r=t.element(e).length&&t.element(e)[0].parentNode;if(r){var d=_.filter(function(e){return e.options.element[0]===r});d.length&&(n=d[0],_.splice(_.indexOf(n),1))}return n?n.remove(A,!1,{$destroy:!0}):o.when(A)}function M(s){function u(){return o(function(e,t){function n(e){v.deferred.reject(e),t(e)}s.onCompiling&&s.onCompiling(s),E(s).then(function(t){_=f(t,s),s.cleanupElement=t.cleanup,N=A(_,s,t.controller).then(e,n)})["catch"](n)})}function p(e,n,r){function d(e){v.deferred.resolve(e)}function a(e){v.deferred.reject(e)}return _?(s=t.extend(s||{},r||{}),s.cancelAutoHide&&s.cancelAutoHide(),s.element.triggerHandler("$mdInterimElementRemove"),s.$destroy===!0?T(s.element,s).then(function(){n&&a(e)||d(e)}):(o.when(N)["finally"](function(){T(s.element,s).then(function(){n?a(e):d(e)},a)}),v.deferred.promise)):o.when(!1)}function h(e){return e=e||{},e.template&&(e.template=m.processTemplate(e.template)),t.extend({preserveScope:!1,cancelAutoHide:t.noop,scope:e.scope||r.$new(e.isolateScope),onShow:function(e,t,n){return i.enter(t,n.parent)},onRemove:function(e,t){return t&&i.leave(t)||o.when()}},e)}function E(e){var t=e.skipCompile?null:c.compile(e);return t||o(function(t){t({locals:{},link:function(){return e.element}})})}function f(e,n){t.extend(e.locals,n);var o=e.link(n.scope);return n.element=o,n.parent=b(o,n),n.themable&&l(o),o}function b(n,o){var r=o.parent;if(r=t.isFunction(r)?r(o.scope,n,o):t.isString(r)?t.element(e[0].querySelector(r)):t.element(r),!(r||{}).length){var d;return a[0]&&a[0].querySelector&&(d=a[0].querySelector(":not(svg) > body")),d||(d=a[0]),"#comment"==d.nodeName&&(d=e[0].body),t.element(d)}return r}function M(){var e,o=t.noop;s.hideDelay&&(e=d(g.hide,s.hideDelay),o=function(){d.cancel(e)}),s.cancelAutoHide=function(){o(),s.cancelAutoHide=n}}function A(e,n,r){var d=n.onShowing||t.noop,a=n.onComplete||t.noop;try{d(n.scope,e,n,r)}catch(i){return o.reject(i)}return o(function(t,d){try{o.when(n.onShow(n.scope,e,n,r)).then(function(){a(n.scope,e,n),M(),t(e)},d)}catch(i){d(i.message)}})}function T(e,n){var r=n.onRemoving||t.noop;return o(function(t,d){try{var a=o.when(n.onRemove(n.scope,e,n)||!0);r(e,a),n.$destroy?(t(e),!n.preserveScope&&n.scope&&a.then(function(){n.scope.$destroy()})):a.then(function(){!n.preserveScope&&n.scope&&n.scope.$destroy(),t(e)},d)}catch(i){d(i.message)}})}var v,_,N=o.when(!0);return s=h(s),v={options:s,deferred:o.defer(),show:u,remove:p}}var g,A=!1,T=[],v=[],_=[];return g={show:p,hide:f(h),cancel:f(E),destroy:b,$injector_:s}}}return o.$inject=["$document","$q","$rootScope","$timeout","$rootElement","$animate","$mdUtil","$mdCompiler","$mdTheming","$injector","$exceptionHandler"],e.$get=o,e}function $(e){this._$timeout=e,this._liveElement=this._createLiveElement(),this._announceTimeout=100}function x(e,o){function r(e){return e&&""!==e}var d,a=[],i={};return d={notFoundError:function(t,n){e.error((n||"")+"No instance found for handle",t)},getInstances:function(){return a},get:function(e){if(!r(e))return null;var t,n,o;for(t=0,n=a.length;t<n;t++)if(o=a[t],o.$$mdHandle===e)return o;return null},register:function(e,n){function o(){var t=a.indexOf(e);t!==-1&&a.splice(t,1)}function r(){var t=i[n];t&&(t.forEach(function(t){t.resolve(e)}),delete i[n])}return n?(e.$$mdHandle=n,a.push(e),r(),o):t.noop},when:function(e){if(r(e)){var t=o.defer(),a=d.get(e);return a?t.resolve(a):(i[e]===n&&(i[e]=[]),i[e].push(t)),t.promise}return o.reject("Invalid `md-component-id` value.")}}}function C(e,n){return{controller:t.noop,link:function(t,o,r){r.hasOwnProperty("mdInkRippleCheckbox")?n.attach(t,o):e.attach(t,o)}}}function S(){function e(){n=!0}var n=!1;return{disableInkRipple:e,$get:["$injector",function(e){function o(o,r,d){return n||r.controller("mdNoInk")?t.noop:e.instantiate(D,{$scope:o,$element:r,rippleOptions:d})}return{attach:o}}]}}function D(e,n,o,r,d,a,i){this.$window=r,this.$timeout=d,this.$mdUtil=a,this.$mdColorUtil=i,this.$scope=e,this.$element=n,this.options=o,this.mousedown=!1,this.ripples=[],this.timeout=null,this.lastRipple=null,a.valueOnUse(this,"container",this.createContainer),this.$element.addClass("md-ink-ripple"),(n.controller("mdInkRipple")||{}).createRipple=t.bind(this,this.createRipple),(n.controller("mdInkRipple")||{}).setColor=t.bind(this,this.color),this.bindEvents()}function R(e,n){(e.mousedown||e.lastRipple)&&(e.mousedown=!1,e.$mdUtil.nextTick(t.bind(e,n),!1))}function O(){return{controller:t.noop}}function I(n,o,r,d,a){var i;return i={translate3d:function(e,t,n,o){function r(n){return a(e,{to:n||t,addClass:o.transitionOutClass,removeClass:o.transitionInClass,duration:o.duration}).start()}return a(e,{from:t,to:n,addClass:o.transitionInClass,removeClass:o.transitionOutClass,duration:o.duration}).start().then(function(){return r})},waitTransitionEnd:function(t,n){var a=3e3;return o(function(o,i){function m(e){e&&e.target!==t[0]||(e&&r.cancel(l),t.off(d.CSS.TRANSITIONEND,m),o())}function c(n){return n=n||e.getComputedStyle(t[0]),"0s"==n.transitionDuration||!n.transition&&!n.transitionProperty}n=n||{},c(n.cachedTransitionStyles)&&(a=0);var l=r(m,n.timeout||a);t.on(d.CSS.TRANSITIONEND,m)})},calculateTransformValues:function(e,t){function n(){var t=e?e.parent():null,n=t?t.parent():null;return n?i.clientRect(n):null}var o=t.element,r=t.bounds;if(o||r){var d=o?i.clientRect(o)||n():i.copyRect(r),a=i.copyRect(e[0].getBoundingClientRect()),m=i.centerPointFor(a),c=i.centerPointFor(d);return{centerX:c.x-m.x,centerY:c.y-m.y,scaleX:Math.round(100*Math.min(.5,d.width/a.width))/100,scaleY:Math.round(100*Math.min(.5,d.height/a.height))/100}}return{centerX:0,centerY:0,scaleX:.5,scaleY:.5}},calculateZoomToOrigin:function(e,o){
var r="translate3d( {centerX}px, {centerY}px, 0 ) scale( {scaleX}, {scaleY} )",d=t.bind(null,n.supplant,r);return d(i.calculateTransformValues(e,o))},calculateSlideToOrigin:function(e,o){var r="translate3d( {centerX}px, {centerY}px, 0 )",d=t.bind(null,n.supplant,r);return d(i.calculateTransformValues(e,o))},toCss:function(e){function n(e,n,r){t.forEach(n.split(" "),function(e){o[e]=r})}var o={},r="left top right bottom width height x y min-width min-height max-width max-height";return t.forEach(e,function(e,a){if(!t.isUndefined(e))if(r.indexOf(a)>=0)o[a]=e+"px";else switch(a){case"transition":n(a,d.CSS.TRANSITION,e);break;case"transform":n(a,d.CSS.TRANSFORM,e);break;case"transformOrigin":n(a,d.CSS.TRANSFORM_ORIGIN,e);break;case"font-size":o["font-size"]=e}}),o},toTransformCss:function(e,n,o){var r={};return t.forEach(d.CSS.TRANSFORM.split(" "),function(t){r[t]=e}),n&&(o=o||"all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important",r.transition=o),r},copyRect:function(e,n){return e?(n=n||{},t.forEach("left top right bottom width height".split(" "),function(t){n[t]=Math.round(e[t])}),n.width=n.width||n.right-n.left,n.height=n.height||n.bottom-n.top,n):null},clientRect:function(e){var n=t.element(e)[0].getBoundingClientRect(),o=function(e){return e&&e.width>0&&e.height>0};return o(n)?i.copyRect(n):null},centerPointFor:function(e){return e?{x:Math.round(e.left+e.width/2),y:Math.round(e.top+e.height/2)}:{x:0,y:0}}}}o.$inject=["$log","$injector"],r.$inject=["$provide","$mdThemingProvider"],d.$inject=["$delegate"],a.$inject=["$delegate"],t.module("material.core",["ngAnimate","material.core.animate","material.core.layout","material.core.interaction","material.core.gestures","material.core.theming"]).config(r).run(o),i.$inject=["$parse"],t.module("material.core").directive("mdAutofocus",i).directive("mdAutoFocus",i).directive("mdSidenavFocus",i),t.module("material.core").factory("$mdColorUtil",m),t.module("material.core").factory("$mdConstant",c),t.module("material.core").config(["$provide",function(e){e.decorator("$mdUtil",["$delegate",function(e){return e.iterator=l,e}])}]),s.$inject=["$mdConstant","$rootScope","$window"],t.module("material.core").factory("$mdMedia",s),t.module("material.core").config(["$provide",function(e){e.decorator("$mdUtil",["$delegate",function(e){return e.prefixer=u,e}])}]),p.$inject=["$document","$timeout","$compile","$rootScope","$$mdAnimate","$interpolate","$log","$rootElement","$window","$$rAF"];var P=0;t.module("material.core").factory("$mdUtil",p),t.element.prototype.focus=t.element.prototype.focus||function(){return this.length&&this[0].focus(),this},t.element.prototype.blur=t.element.prototype.blur||function(){return this.length&&this[0].blur(),this},E.$inject=["$$rAF","$log","$window","$interpolate"],t.module("material.core").provider("$mdAria",h),f.$inject=["$q","$templateRequest","$injector","$compile","$controller"],t.module("material.core").service("$mdCompiler",f),f.prototype.compile=function(e){return e.contentElement?this._prepareContentElement(e):this._compileTemplate(e)},f.prototype._prepareContentElement=function(e){var t=this._fetchContentElement(e);return this.$q.resolve({element:t.element,cleanup:t.restore,locals:{},link:function(){return t.element}})},f.prototype._compileTemplate=function(e){var n=this,o=e.templateUrl,r=e.template||"",d=t.extend({},e.resolve),a=t.extend({},e.locals),i=e.transformTemplate||t.identity;return t.forEach(d,function(e,o){t.isString(e)?d[o]=n.$injector.get(e):d[o]=n.$injector.invoke(e)}),t.extend(d,a),o?d.$$ngTemplate=this.$templateRequest(o):d.$$ngTemplate=this.$q.when(r),this.$q.all(d).then(function(o){var r=i(o.$$ngTemplate,e),d=e.element||t.element("<div>").html(r.trim()).contents();return n._compileElement(o,d,e)})},f.prototype._compileElement=function(e,n,o){function r(r){if(e.$scope=r,o.controller){var m=t.extend(e,{$element:n}),c=d.$controller(o.controller,m,!0,o.controllerAs);o.bindToController&&t.extend(c.instance,e);var l=c();n.data("$ngControllerController",l),n.children().data("$ngControllerController",l),i.controller=l}return a(r)}var d=this,a=this.$compile(n),i={element:n,cleanup:n.remove.bind(n),locals:e,link:r};return i},f.prototype._fetchContentElement=function(e){function n(e){var t=e.parentNode,n=e.nextElementSibling;return function(){n?t.insertBefore(e,n):t.appendChild(e)}}var o=e.contentElement,r=null;return t.isString(o)?(o=document.querySelector(o),r=n(o)):(o=o[0]||o,r=document.contains(o)?n(o):function(){o.parentNode&&o.parentNode.removeChild(o)}),{element:t.element(o),restore:r}},M.$inject=["$$MdGestureHandler","$$rAF","$timeout"],T.$inject=["$mdGesture","$$MdGestureHandler"];var L,j,U={},F=!1,Y=null,W=!1;t.module("material.core.gestures",[]).provider("$mdGesture",b).factory("$$MdGestureHandler",A).run(T),b.prototype={skipClickHijack:function(){return F=!0},$get:["$$MdGestureHandler","$$rAF","$timeout",function(e,t,n){return new M(e,t,n)}]},H.$inject=["$timeout","$mdUtil"],t.module("material.core.interaction",[]).service("$mdInteraction",H),H.prototype.initializeEvents=function(){var t="MSPointerEvent"in e?"MSPointerDown":"PointerEvent"in e?"pointerdown":null;this.bodyElement.on("keydown mousedown",this.onInputEvent.bind(this)),"ontouchstart"in document.documentElement&&this.bodyElement.on("touchstart",this.onBufferInputEvent.bind(this)),t&&this.bodyElement.on(t,this.onInputEvent.bind(this))},H.prototype.onInputEvent=function(e){if(!this.isBuffering){var t=this.inputEventMap[e.type];"pointer"===t&&(t=this.iePointerMap[e.pointerType]||e.pointerType),this.lastInteractionType=t,this.lastInteractionTime=this.$mdUtil.now()}},H.prototype.onBufferInputEvent=function(e){this.$timeout.cancel(this.bufferTimeout),this.onInputEvent(e),this.isBuffering=!0,this.bufferTimeout=this.$timeout(function(){this.isBuffering=!1}.bind(this),650,!1)},H.prototype.getLastInteractionType=function(){return this.lastInteractionType},H.prototype.isUserInvoked=function(e){var n=t.isNumber(e)?e:15;return this.lastInteractionTime>=this.$mdUtil.now()-n},t.module("material.core").provider("$$interimElement",w),function(){function e(e){function i(e){return e.replace(s,"").replace(u,function(e,t,n,o){return o?n.toUpperCase():n})}var s=/^((?:x|data)[\:\-_])/i,u=/([\:\-\_]+(.))/g,p=["","xs","gt-xs","sm","gt-sm","md","gt-md","lg","gt-lg","xl","print"],h=["layout","flex","flex-order","flex-offset","layout-align"],E=["show","hide","layout-padding","layout-margin"];t.forEach(p,function(n){t.forEach(h,function(t){var o=n?t+"-"+n:t;e.directive(i(o),d(o))}),t.forEach(E,function(t){var o=n?t+"-"+n:t;e.directive(i(o),a(o))})}),e.provider("$$mdLayout",function(){return{$get:t.noop,validateAttributeValue:l,validateAttributeUsage:c,disableLayouts:function(e){k.enabled=e!==!0}}}).directive("mdLayoutCss",o).directive("ngCloak",r("ng-cloak")).directive("layoutWrap",a("layout-wrap")).directive("layoutNowrap",a("layout-nowrap")).directive("layoutNoWrap",a("layout-no-wrap")).directive("layoutFill",a("layout-fill")).directive("layoutLtMd",m("layout-lt-md",!0)).directive("layoutLtLg",m("layout-lt-lg",!0)).directive("flexLtMd",m("flex-lt-md",!0)).directive("flexLtLg",m("flex-lt-lg",!0)).directive("layoutAlignLtMd",m("layout-align-lt-md")).directive("layoutAlignLtLg",m("layout-align-lt-lg")).directive("flexOrderLtMd",m("flex-order-lt-md")).directive("flexOrderLtLg",m("flex-order-lt-lg")).directive("offsetLtMd",m("flex-offset-lt-md")).directive("offsetLtLg",m("flex-offset-lt-lg")).directive("hideLtMd",m("hide-lt-md")).directive("hideLtLg",m("hide-lt-lg")).directive("showLtMd",m("show-lt-md")).directive("showLtLg",m("show-lt-lg")).config(n)}function n(){var e=!!document.querySelector("[md-layouts-disabled]");k.enabled=!e}function o(){return k.enabled=!1,{restrict:"A",priority:"900"}}function r(e){return["$timeout",function(n){return{restrict:"A",priority:-10,compile:function(o){return k.enabled?(o.addClass(e),function(t,o){n(function(){o.removeClass(e)},10,!1)}):t.noop}}}]}function d(e){function n(t,n,o){var r=i(n,e,o),d=o.$observe(o.$normalize(e),r);r(p(e,o,"")),t.$on("$destroy",function(){d()})}return["$mdUtil","$interpolate","$log",function(o,r,d){return f=o,b=r,M=d,{restrict:"A",compile:function(o,r){var d;return k.enabled&&(c(e,r,o,M),l(e,p(e,r,""),s(o,e,r)),d=n),d||t.noop}}}]}function a(e){function n(t,n){n.addClass(e)}return["$mdUtil","$interpolate","$log",function(o,r,d){return f=o,b=r,M=d,{restrict:"A",compile:function(o,r){var d;return k.enabled&&(l(e,p(e,r,""),s(o,e,r)),n(null,o),d=n),d||t.noop}}}]}function i(e,n){var o;return function(r){var d=l(n,r||"");t.isDefined(d)&&(o&&e.removeClass(o),o=d?n+"-"+d.replace(A,"-"):n,e.addClass(o))}}function m(e){var n=e.split("-");return["$log",function(o){return o.warn(e+"has been deprecated. Please use a `"+n[0]+"-gt-<xxx>` variant."),t.noop}]}function c(e,t,n,o){var r,d,a,i=n[0].nodeName.toLowerCase();switch(e.replace(g,"")){case"flex":"md-button"!=i&&"fieldset"!=i||(d="<"+i+" "+e+"></"+i+">",a="https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers",r="Markup '{0}' may not work as expected in IE Browsers. Consult '{1}' for details.",o.warn(f.supplant(r,[d,a])))}}function l(e,n,o){var r=n;if(!u(n)){switch(e.replace(g,"")){case"layout":h(n,v)||(n=v[0]);break;case"flex":h(n,T)||isNaN(n)&&(n="");break;case"flex-offset":case"flex-order":n&&!isNaN(+n)||(n="0");break;case"layout-align":var d=E(n);n=f.supplant("{main}-{cross}",d);break;case"layout-padding":case"layout-margin":case"layout-fill":case"layout-wrap":case"layout-nowrap":case"layout-nowrap":n=""}n!=r&&(o||t.noop)(n)}return n}function s(e,t,n){return function(e){u(e)||(n[n.$normalize(t)]=e)}}function u(e){return(e||"").indexOf(b.startSymbol())>-1}function p(e,t,n){var o=t.$normalize(e);return t[o]?t[o].replace(A,"-"):n||null}function h(e,t,n){e=n&&e?e.replace(A,n):e;var o=!1;return e&&t.forEach(function(t){t=n?t.replace(A,n):t,o=o||t===e}),o}function E(e){var t,n={main:"start",cross:"stretch"};return e=e||"",0!==e.indexOf("-")&&0!==e.indexOf(" ")||(e="none"+e),t=e.toLowerCase().trim().replace(A,"-").split("-"),t.length&&"space"===t[0]&&(t=[t[0]+"-"+t[1],t[2]]),t.length>0&&(n.main=t[0]||n.main),t.length>1&&(n.cross=t[1]||n.cross),_.indexOf(n.main)<0&&(n.main="start"),N.indexOf(n.cross)<0&&(n.cross="stretch"),n}var f,b,M,g=/(-gt)?-(sm|md|lg|print)/g,A=/\s+/g,T=["grow","initial","auto","none","noshrink","nogrow"],v=["row","column"],_=["","start","center","end","stretch","space-around","space-between"],N=["","start","center","end","stretch"],k={enabled:!0,breakpoints:[]};e(t.module("material.core.layout",["ng"]))}(),$.$inject=["$timeout"],t.module("material.core").service("$mdLiveAnnouncer",$),$.prototype.announce=function(e,t){t||(t="polite");var n=this;n._liveElement.textContent="",n._liveElement.setAttribute("aria-live",t),n._$timeout(function(){n._liveElement.textContent=e},n._announceTimeout,!1)},$.prototype._createLiveElement=function(){var e=document.createElement("div");return e.classList.add("md-visually-hidden"),e.setAttribute("role","status"),e.setAttribute("aria-atomic","true"),e.setAttribute("aria-live","polite"),document.body.appendChild(e),e},t.module("material.core.meta",[]).provider("$$mdMeta",function(){function e(e){if(d[e])return!0;var n=document.getElementsByName(e)[0];return!!n&&(d[e]=t.element(n),!0)}function n(n,o){if(e(n),d[n])d[n].attr("content",o);else{var a=t.element('<meta name="'+n+'" content="'+o+'"/>');r.append(a),d[n]=a}return function(){d[n].attr("content",""),d[n].remove(),delete d[n]}}function o(t){if(!e(t))throw Error("$$mdMeta: could not find a meta tag with the name '"+t+"'");return d[t].attr("content")}var r=t.element(document.head),d={},a={setMeta:n,getMeta:o};return t.extend({},a,{$get:function(){return a}})}),x.$inject=["$log","$q"],t.module("material.core").factory("$mdComponentRegistry",x),function(){function e(e){function n(e){return e.hasClass("md-icon-button")?{isMenuItem:e.hasClass("md-menu-item"),fitRipple:!0,center:!0}:{isMenuItem:e.hasClass("md-menu-item"),dimBackground:!0}}return{attach:function(o,r,d){return d=t.extend(n(r),d),e.attach(o,r,d)}}}e.$inject=["$mdInkRipple"],t.module("material.core").factory("$mdButtonInkRipple",e)}(),function(){function e(e){function n(n,o,r){return e.attach(n,o,t.extend({center:!0,dimBackground:!1,fitRipple:!0},r))}return{attach:n}}e.$inject=["$mdInkRipple"],t.module("material.core").factory("$mdCheckboxInkRipple",e)}(),function(){function e(e){function n(n,o,r){return e.attach(n,o,t.extend({center:!1,dimBackground:!0,outline:!1,rippleSize:"full"},r))}return{attach:n}}e.$inject=["$mdInkRipple"],t.module("material.core").factory("$mdListInkRipple",e)}(),D.$inject=["$scope","$element","rippleOptions","$window","$timeout","$mdUtil","$mdColorUtil"],C.$inject=["$mdButtonInkRipple","$mdCheckboxInkRipple"],t.module("material.core").provider("$mdInkRipple",S).directive("mdInkRipple",C).directive("mdNoInk",O).directive("mdNoBar",O).directive("mdNoStretch",O);var B=450;D.prototype.color=function(e){function n(){var e=o.options&&o.options.colorElement?o.options.colorElement:[],t=e.length?e[0]:o.$element[0];return t?o.$window.getComputedStyle(t).color:"rgb(0,0,0)"}var o=this;return t.isDefined(e)&&(o._color=o._parseColor(e)),o._color||o._parseColor(o.inkRipple())||o._parseColor(n())},D.prototype.calculateColor=function(){return this.color()},D.prototype._parseColor=function(e,t){t=t||1;var n=this.$mdColorUtil;if(e)return 0===e.indexOf("rgba")?e.replace(/\d?\.?\d*\s*\)\s*$/,(.1*t).toString()+")"):0===e.indexOf("rgb")?n.rgbToRgba(e):0===e.indexOf("#")?n.hexToRgba(e):void 0},D.prototype.bindEvents=function(){this.$element.on("mousedown",t.bind(this,this.handleMousedown)),this.$element.on("mouseup touchend",t.bind(this,this.handleMouseup)),this.$element.on("mouseleave",t.bind(this,this.handleMouseup)),this.$element.on("touchmove",t.bind(this,this.handleTouchmove))},D.prototype.handleMousedown=function(e){if(!this.mousedown)if(e.hasOwnProperty("originalEvent")&&(e=e.originalEvent),this.mousedown=!0,this.options.center)this.createRipple(this.container.prop("clientWidth")/2,this.container.prop("clientWidth")/2);else if(e.srcElement!==this.$element[0]){var t=this.$element[0].getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top;this.createRipple(n,o)}else this.createRipple(e.offsetX,e.offsetY)},D.prototype.handleMouseup=function(){R(this,this.clearRipples)},D.prototype.handleTouchmove=function(){R(this,this.deleteRipples)},D.prototype.deleteRipples=function(){for(var e=0;e<this.ripples.length;e++)this.ripples[e].remove()},D.prototype.clearRipples=function(){for(var e=0;e<this.ripples.length;e++)this.fadeInComplete(this.ripples[e])},D.prototype.createContainer=function(){var e=t.element('<div class="md-ripple-container"></div>');return this.$element.append(e),e},D.prototype.clearTimeout=function(){this.timeout&&(this.$timeout.cancel(this.timeout),this.timeout=null)},D.prototype.isRippleAllowed=function(){var e=this.$element[0];do{if(!e.tagName||"BODY"===e.tagName)break;if(e&&t.isFunction(e.hasAttribute)){if(e.hasAttribute("disabled"))return!1;if("false"===this.inkRipple()||"0"===this.inkRipple())return!1}}while(e=e.parentNode);return!0},D.prototype.inkRipple=function(){return this.$element.attr("md-ink-ripple")},D.prototype.createRipple=function(e,n){function o(e,t,n){return e?Math.max(t,n):Math.sqrt(Math.pow(t,2)+Math.pow(n,2))}if(this.isRippleAllowed()){var r=this,d=r.$mdColorUtil,a=t.element('<div class="md-ripple"></div>'),i=this.$element.prop("clientWidth"),m=this.$element.prop("clientHeight"),c=2*Math.max(Math.abs(i-e),e),l=2*Math.max(Math.abs(m-n),n),s=o(this.options.fitRipple,c,l),u=this.calculateColor();a.css({left:e+"px",top:n+"px",background:"black",width:s+"px",height:s+"px",backgroundColor:d.rgbaToRgb(u),borderColor:d.rgbaToRgb(u)}),this.lastRipple=a,this.clearTimeout(),this.timeout=this.$timeout(function(){r.clearTimeout(),r.mousedown||r.fadeInComplete(a)},.35*B,!1),this.options.dimBackground&&this.container.css({backgroundColor:u}),this.container.append(a),this.ripples.push(a),a.addClass("md-ripple-placed"),this.$mdUtil.nextTick(function(){a.addClass("md-ripple-scaled md-ripple-active"),r.$timeout(function(){r.clearRipples()},B,!1)},!1)}},D.prototype.fadeInComplete=function(e){this.lastRipple===e?this.timeout||this.mousedown||this.removeRipple(e):this.removeRipple(e)},D.prototype.removeRipple=function(e){var t=this,n=this.ripples.indexOf(e);n<0||(this.ripples.splice(this.ripples.indexOf(e),1),e.removeClass("md-ripple-active"),e.addClass("md-ripple-remove"),0===this.ripples.length&&this.container.css({backgroundColor:""}),this.$timeout(function(){t.fadeOutComplete(e)},B,!1))},D.prototype.fadeOutComplete=function(e){e.remove(),this.lastRipple=null},function(){function e(e){function n(n,o,r){return e.attach(n,o,t.extend({center:!1,dimBackground:!0,outline:!1,rippleSize:"full"},r))}return{attach:n}}e.$inject=["$mdInkRipple"],t.module("material.core").factory("$mdTabInkRipple",e)}(),t.module("material.core.theming.palette",[]).constant("$mdColorPalette",{red:{50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 300 A100",contrastStrongLightColors:"400 500 600 700 A200 A400 A700"},pink:{50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"500 600 A200 A400 A700"},purple:{50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"