mirror of
https://github.com/gwenhael-le-moine/ledgerrb.git
synced 2025-01-17 18:11:49 +01:00
8 lines
No EOL
37 KiB
JavaScript
8 lines
No EOL
37 KiB
JavaScript
/*!
|
|
* Angular Material Design
|
|
* https://github.com/angular/material
|
|
* @license MIT
|
|
* v0.0.3
|
|
*/
|
|
!function(){function e(e,t){function n(){return[].concat(h)}function a(){return h.length}function i(e){return h.length&&e>-1&&e<h.length}function r(e){return e?i(d(e)+1):!1}function o(e){return e?i(d(e)-1):!1}function l(e){return i(e)?h[e]:null}function c(e,t){function n(e,t){var n=[];return angular.forEach(e,function(a,i){var r=t.apply(null,[a,i,e]);r&&n.push(r)}),n.length?n:null}return n(h,function(n){return n[e]==t?n:null})}function u(e,t){return e?(angular.isDefined(t)||(t=h.length),h.splice(t,0,e),d(e)):-1}function s(e){f(e)&&h.splice(d(e),1)}function d(e){return h.indexOf(e)}function f(e){return e&&d(e)>-1}function m(e,n){if(f(e)){var a=d(e)+1,r=i(a)?h[a]:t?g():null,o=r&&n&&!n(r);return o?m(r,n):r}return null}function p(e,n){if(f(e)){var a=d(e)-1,r=i(a)?h[a]:t?v():null,o=r&&n&&!n(r);return o?p(r,n):r}return null}function g(){return h.length?h[0]:null}function v(){return h.length?h[h.length-1]:null}t=!!t;var h=e||[];return{items:n,count:a,inRange:i,contains:f,indexOf:d,itemAt:l,findBy:c,add:u,remove:s,first:g,last:v,next:m,previous:p,hasPrevious:o,hasNext:r}}function t(e,t,n,a){function i(e){return c?"webkit"+e.charAt(0).toUpperCase()+e.substring(1):e}function r(e,n,i){function r(t){t.target===e[0]&&(e.off(l.TRANSITIONEND_EVENT,r),c.resolve())}var c=a.defer();n.append(e);var u;if(i){var s=i[0].getBoundingClientRect();u=o(s.left-e[0].offsetWidth,s.top-e[0].offsetHeight,0)+" scale(0.2)"}else u="translate3d(0,100%,0) scale(0.5)";return e.css(l.TRANSFORM,u).css("opacity",0),t(function(){t(function(){e.addClass("active").css(l.TRANSFORM,"").css("opacity","").on(l.TRANSITIONEND_EVENT,r)})}),c.promise}function o(e,t,n){return"translate3d("+Math.floor(e)+"px,"+Math.floor(t)+"px,"+Math.floor(n)+"px)"}var l,c=/webkit/i.test(n.vendorPrefix);return l={popIn:r,TRANSITIONEND_EVENT:"transitionend"+(c?" webkitTransitionEnd":""),ANIMATIONEND_EVENT:"animationend"+(c?" webkitAnimationEnd":""),TRANSFORM:i("transform"),TRANSITION:i("transition"),TRANSITION_DURATION:i("transitionDuration"),ANIMATION_PLAY_STATE:i("animationPlayState"),ANIMATION_DURATION:i("animationDuration"),ANIMATION_NAME:i("animationName"),ANIMATION_TIMING:i("animationTimingFunction"),ANIMATION_DIRECTION:i("animationDirection")}}function n(e){return function(t,n,a){"checkbox"==a.inkRipple?e.attachCheckboxBehavior(n):e.attachButtonBehavior(n)}}function a(e,t,n,a){function i(e){return o(e,{mousedown:!0,center:!1,animationDuration:350,mousedownPauseTime:175,animationName:"inkRippleButton",animationTimingFunction:"linear"})}function r(e){return o(e,{mousedown:!0,center:!0,animationDuration:300,mousedownPauseTime:180,animationName:"inkRippleCheckbox",animationTimingFunction:"linear"})}function o(t,i){function r(){return!t.controller("noink")&&!K.isDisabled(t)}function o(){function e(o){function s(){f(),m.css(n.ANIMATION_PLAY_STATE,"running"),t.off(u,s),t.on(c,e)}function d(){m.css(n.ANIMATION_PLAY_STATE,"paused")}function f(){a.cancel(p)}if(r()){var m=l(o),p=a(d,i.mousedownPauseTime,!1);m.on("$destroy",f),t.off(c,e),t.on(u,s)}}t.on(c,e)}function l(e){return e=e.touches?e.touches[0]:e,s(e.pageX,e.pageY,!0)}function s(a,r,o){var l=angular.element('<div class="material-ripple">').css(n.ANIMATION_DURATION,i.animationDuration+"ms").css(n.ANIMATION_NAME,i.animationName).css(n.ANIMATION_TIMING,i.animationTimingFunction).on(n.ANIMATIONEND_EVENT,function(){l.remove()});d||(d=angular.element('<div class="material-ripple-container">'),t.append(d)),d.append(l);var c=d.prop("offsetWidth");if(i.center)a=c/2,r=d.prop("offsetHeight")/2;else if(o){var u=f.getBoundingClientRect();a-=u.left,r-=u.top}var s={"background-color":e.getComputedStyle(l[0]).color||e.getComputedStyle(f).color,"border-radius":c/2+"px",left:a-c/2+"px",width:c+"px",top:r-c/2+"px",height:c+"px"};return s[n.ANIMATION_DURATION]=i.fadeoutDuration+"ms",l.css(s),l}i=angular.extend({mousedown:!0,hover:!0,focus:!0,center:!1,animationDuration:300,mousedownPauseTime:150,animationName:"",animationTimingFunction:"linear"},i||{});var d,f=t[0];i.mousedown&&o()}var l=!!("ontouchend"in document),c=l?"touchstart":"mousedown",u=l?"touchend touchcancel":"mouseup mouseleave";return{attachButtonBehavior:i,attachCheckboxBehavior:r,attach:o}}function i(e,t,n){e[0];return{restrict:"E",compile:function(e,a){var i,r;return a.ngHref||a.href?(i=angular.element("<a>"),r=["ng-href","href","rel","target"]):(i=angular.element("<button>"),r=["type","disabled","ng-disabled","form"]),angular.forEach(r,function(e){var t=K.camelCase(e);a.hasOwnProperty(t)&&i.attr(e,a[t])}),i.addClass("material-button-inner").append(e.contents()).on("focus",function(){e.addClass("focus")}).on("blur",function(){e.removeClass("focus")}),e.append(i).attr("tabIndex",-1).on("focus",function(){i.focus()}),function(e,a){n.expect(a,"aria-label",a.text()),t.attachButtonBehavior(a)}}}}function r(){return{restrict:"E",link:function(){}}}function o(e,t,n){function a(e,t,a,o){function l(e){e.which===G.KEY_CODE.SPACE&&(e.preventDefault(),c(e))}function c(n){t[0].hasAttribute("disabled")||e.$apply(function(){s=!s,o.$setViewValue(s,n&&n.type),o.$render()})}function u(){s=o.$viewValue,t.attr(G.ARIA.PROPERTY.CHECKED,s),s?t.addClass(r):t.removeClass(r)}var s=!1;o=o||{$setViewValue:function(e){this.$viewValue=e},$parsers:[],$formatters:[]},a.type="checkbox",a.tabIndex=0,i.link(e,{on:angular.noop,0:{}},a,[o]),t.attr(G.ARIA.PROPERTY.CHECKED,s),t.attr("role",a.type),t.attr("tabIndex",a.tabIndex),t.on("click",c),t.on("keypress",l),o.$render=u,n.expect(t,G.ARIA.PROPERTY.LABEL,t.text())}var i=e[0],r="material-checked";return{restrict:"E",transclude:!0,require:"?ngModel",template:'<div class="material-container" ink-ripple="checkbox"><div class="material-icon"></div></div><div ng-transclude class="material-label"></div>',link:a}}function l(){return{restrict:"E",controller:angular.noop,link:function(e,t){e.$broadcast("$materialContentLoaded",t)}}}function c(e){return{restrict:"E",link:function(t,n){e(function(){var e=n[0].querySelector(".dialog-content");e&&e.scrollHeight>e.clientHeight&&n.addClass("dialog-content-overflow")})}}}function u(e,t,n,a,i,r,o){function l(l){function s(e){var t=G.ARIA.ROLE;o.update(e,{role:t.DIALOG});var n=e.find(".dialog-content");0===n.length&&(n=e);var a=K.stringFromTextBody(n.text(),3);o.expect(e,"aria-label",a)}return l=angular.extend({appendTo:u,hasBackdrop:!0,clickOutsideToClose:!0,escapeToClose:!0,targetEvent:null,transformTemplate:function(e){return'<div class="material-dialog-container">'+e+"</div>"}},l||{}),l.appendTo=angular.element(l.appendTo),c&&c.then(function(e){e()}),c=t.compile(l).then(function(t){function o(){var e=p[0].querySelector(".dialog-close");if(!e){var t=p[0].querySelectorAll(".dialog-actions button");e=t[t.length-1]}return angular.element(e)}function c(){c.called||(c.called=!0,f&&r.leave(f),l.escapeToClose&&n.off("keyup",u),l.clickOutsideToClose&&p.off("click",d),r.leave(p).then(function(){p.remove(),m.$destroy(),m=null,p=null,null!==g&&g.focus()}))}function u(t){t.keyCode===G.KEY_CODE.ESCAPE&&e(c)}function d(t){t.target===p[0]&&e(c)}t.locals.$hideDialog=c;var f,m=a.$new(!0),p=t.link(m),g=l.targetEvent&&l.targetEvent.target&&angular.element(l.targetEvent.target),v=o();return s(p.find("material-dialog")),l.hasBackdrop&&(f=angular.element('<material-backdrop class="opaque ng-enter">'),r.enter(f,l.appendTo,null)),i.popIn(p,l.appendTo,g).then(function(){l.escapeToClose&&n.on("keyup",u),l.clickOutsideToClose&&p.on("click",d),v.focus()}),c})}var c,u=n.find("body");return u.length||(u=n),l}function s(){return{restrict:"CE",controller:["$element",function(e){this.setFocused=function(t){e.toggleClass("material-input-focused",!!t)},this.setHasValue=function(t){e.toggleClass("material-input-has-value",!!t)}}]}}function d(){return{restrict:"E",replace:!0,template:"<input>",require:["^?materialInputGroup","?ngModel"],link:function(e,t,n,a){var i=a[0],r=a[1];i&&(r&&r.$formatters.push(function(e){return i.setHasValue(!!e),e}),t.on("input",function(){i.setHasValue(!!t.val())}),t.on("focus",function(){i.setFocused(!0)}),t.on("blur",function(){i.setFocused(!1)}),e.$on("$destroy",function(){i.setFocused(!1),i.setHasValue(!1)}))}}}function f(){return{restrict:"E",template:'<object class="material-icon"></object>',compile:function(e,t){var n=angular.element(e[0].children[0]);angular.isDefined(t.icon)&&n.attr("data",t.icon)}}}function m(){return{restrict:"E",link:function(e,t){t.attr({role:G.ARIA.ROLE.LIST})}}}function p(){return{restrict:"E",link:function(e,t){t.attr({role:G.ARIA.ROLE.LIST_ITEM})}}}function g(){function e(e,t,n,a){function i(e){e.which===G.KEY_CODE.LEFT_ARROW?(e.preventDefault(),r.selectPrevious(t)):e.which===G.KEY_CODE.RIGHT_ARROW&&(e.preventDefault(),r.selectNext(t))}var r=a[0],o=a[1]||{$setViewValue:angular.noop};r.init(o),t.attr({role:G.ARIA.ROLE.RADIO_GROUP,tabIndex:"0"}).on("keydown",i)}function t(){this._radioButtonRenderFns=[]}function n(){return{init:function(e){this._ngModelCtrl=e,this._ngModelCtrl.$render=angular.bind(this,this.render)},add:function(e){this._radioButtonRenderFns.push(e)},remove:function(e){var t=this._radioButtonRenderFns.indexOf(e);-1!==t&&this._radioButtonRenderFns.splice(t,1)},render:function(){this._radioButtonRenderFns.forEach(function(e){e()})},setViewValue:function(e,t){this._ngModelCtrl.$setViewValue(e,t),this.render()},getViewValue:function(){return this._ngModelCtrl.$viewValue},selectNext:function(e){return a("next",e)},selectPrevious:function(e){return a("previous",e)}}}function a(e,t,n){n=angular.isUndefined(n)?!0:!!n;var a=K.iterator(i(t),n);if(a.count()){var o=r(t),l=o?"previous"==e?a.previous(o):a.next(o):a.first();l&&angular.element(l).triggerHandler("click")}}function i(e){return Array.prototype.slice.call(e[0].querySelectorAll("material-radio-button"))}function r(e){return e[0].querySelector("material-radio-button.material-checked")}return t.prototype=n(),{restrict:"E",controller:t,require:["materialRadioGroup","?ngModel"],link:e}}function v(e){function t(t,a,i,r){function o(e){a[0].hasAttribute("disabled")||t.$apply(function(){r.setViewValue(i.value,e&&e.type)})}function l(){var e=r.getViewValue()===i.value;e!==c&&(c=e,a.attr(G.ARIA.PROPERTY.CHECKED,e),e?a.addClass(n):a.removeClass(n))}var c;r.add(l),i.$observe("value",l),a.on("click",o).on("$destroy",function(){r.remove(l)}).attr("role",G.ARIA.ROLE.RADIO),e.expect(a,G.ARIA.PROPERTY.LABEL,a.text())}var n="material-checked";return{restrict:"E",require:"^materialRadioGroup",transclude:!0,template:'<div class="material-container" ink-ripple="checkbox"><div class="material-off"></div><div class="material-on"></div></div><div ng-transclude class="material-label"></div>',link:t}}function h(e,t,n,a,i,r){r.register(this,n.componentId),this.isOpen=function(){return!!e.isOpen},this.toggle=function(){e.isOpen=!e.isOpen},this.open=function(){e.isOpen=!0},this.close=function(){e.isOpen=!1}}function $(e){return function(t){var n=e.get(t);return n||e.notFoundError(t),{isOpen:function(){return n?n.isOpen():void 0},toggle:function(){n&&n.toggle()},open:function(){n&&n.open()},close:function(){n&&n.close()}}}}function b(e){return{restrict:"E",scope:{},controller:"$materialSidenavController",link:function(t,n,a,i){function r(e){var t=n.parent();n.toggleClass("open",!!e),e?(t.append(u),u.on(W.CLICK,o),t.on(W.KEY_DOWN,l)):(u.remove(),u.off(W.CLICK,o),t.off(W.KEY_DOWN,l))}function o(){c()}function l(e){e.which===G.KEY_CODE.ESCAPE&&(c(),e.preventDefault(),e.stopPropagation())}function c(){r(!1),e(function(){i.close()})}var u=angular.element('<material-backdrop class="material-sidenav-backdrop">');t.$watch("isOpen",r)}}}function E(){function e(e,t,n,a){var i=a[0]||{$setViewValue:function(e){this.$viewValue=e,this.$viewChangeListeners.forEach(function(e){e()})},$parsers:[],$formatters:[],$viewChangeListeners:[]},r=a[1];r.init(i)}return{scope:{},require:["?ngModel","materialSlider"],controller:["$scope","$element","$attrs","$$rAF","$timeout","$window","$materialEffects","$aria",A],template:'<div class="slider-track-container"><div class="slider-track"></div><div class="slider-track slider-track-fill"></div><div class="slider-track-ticks"></div></div><div class="slider-thumb-container"><div class="slider-thumb"></div><div class="slider-focus-thumb"></div><div class="slider-focus-ring"></div><div class="slider-sign"><span class="slider-thumb-text" ng-bind="modelValue"></span></div><div class="slider-disabled-thumb"></div></div>',link:e}}function A(e,t,n,a,i,r,o,l){this.init=function(i){function c(e){D=parseFloat(e),t.attr("aria-valuemin",e)}function u(e){_=parseFloat(e),t.attr("aria-valuemax",e)}function s(e){P=parseFloat(e),f()}function d(e){t.attr("aria-disabled",!!e)}function f(){if(angular.isDefined(n.discrete)){var e=Math.floor((_-D)/P);B||(B=angular.element('<canvas style="position:absolute;">'),F=B[0].getContext("2d"),F.fillStyle="black",N.append(B));var t=p();B[0].width=t.width,B[0].height=t.height;for(var a,i=0;e>=i;i++)a=Math.floor(t.width*(i/e)),F.fillRect(a-1,0,2,t.height)}}function m(){L=O[0].getBoundingClientRect()}function p(){return M(),L}function g(t){var n;t.which===G.KEY_CODE.LEFT_ARROW?n=-P:t.which===G.KEY_CODE.RIGHT_ARROW&&(n=P),n&&((t.metaKey||t.ctrlKey||t.altKey)&&(n*=4),t.preventDefault(),t.stopPropagation(),e.$evalAsync(function(){v(i.$viewValue+n)}))}function v(e){i.$setViewValue($(b(e)))}function h(){var n=(i.$viewValue-D)/(_-D);e.modelValue=i.$viewValue,t.attr("aria-valuenow",i.$viewValue),E(n)}function $(e){return angular.isNumber(e)?Math.max(D,Math.min(_,e)):void 0}function b(e){return angular.isNumber(e)?Math.round(e/P)*P:void 0}function E(e){y.css("width",100*e+"%"),x.css(o.TRANSFORM,"translate3d("+p().width*e+"px,0,0)"),t.toggleClass("slider-min",0===e)}function A(e){H||e.eventType!==Hammer.INPUT_START||t[0].hasAttribute("disabled")?H&&e.eventType===Hammer.INPUT_END&&(H=!1,t.removeClass("panning active")):(H=!0,t.addClass("active"),t[0].focus(),m(),C(e.center.x))}function T(){H&&t.addClass("panning")}function I(e){H&&(C(e.center.x),e.preventDefault())}function C(t){var n=(t-L.left)/L.width;e.$evalAsync(function(){v(D+n*(_-D))})}var R=angular.element(t[0].querySelector(".slider-thumb")),x=R.parent(),O=angular.element(t[0].querySelector(".slider-track-container")),y=angular.element(t[0].querySelector(".slider-track-fill")),N=angular.element(t[0].querySelector(".slider-track-ticks"));n.min?n.$observe("min",c):c(0),n.max?n.$observe("max",u):u(100),n.step?n.$observe("step",s):s(1);var k=angular.noop;n.ngDisabled?k=e.$parent.$watch(n.ngDisabled,d):d(!!n.disabled),l.expect(t,"aria-label"),t.attr("tabIndex",0),t.attr("role",G.ARIA.ROLE.SLIDER),t.on("keydown",g);var S=new Hammer(t[0],{recognizers:[[Hammer.Pan,{direction:Hammer.DIRECTION_HORIZONTAL}]]});S.on("hammer.input",A),S.on("panstart",T),S.on("pan",I);var w=a.debounce(function(){m(),h(),f()});w(),angular.element(r).on("resize",w),e.$on("$destroy",function(){angular.element(r).off("resize",w),S.destroy(),k()}),i.$render=h,i.$viewChangeListeners.push(h),i.$formatters.push($),i.$formatters.push(b);var D,_,P,B,F,L={},M=K.debounce(m,5e3);m();var H=!1;this._onInput=A,this._onPanStart=T,this._onPan=I}}function T(e,t){function n(e,t){var n=angular.element(e[0].querySelector(".material-switch-thumb"));return n.attr("disabled",t.disabled),n.attr("ngDisabled",t.ngDisabled),function(e,t,i,r){a.link(e,n,i,r)}}var a=e[0],i=t[0];return{restrict:"E",transclude:!0,template:'<div class="material-switch-bar"></div><div class="material-switch-thumb">'+i.template+"</div>",require:"?ngModel",compile:n}}function I(e,t,n,a,i){function r(t){var r=n.selectedElement(),c=r&&r.length&&angular.isDefined(l),u=r&&r.hasClass("pagination-hide"),s={display:"none",width:"0px"},d=0,f=0;!c||u?l.toggleClass("animate",t!==!0).css({display:"none",width:"0px"}):(f=r.prop("offsetWidth"),d=o.prop("offsetLeft")+(e.pagingOffset||0)+r.prop("offsetLeft"),s={display:f>0?"block":"none",width:f+"px"},s[i.TRANSFORM]="translate3d("+d+"px,0,0)",l.toggleClass("animate",t!==!0).css(s));var m=a.defer();return l.one(i.TRANSITIONEND_EVENT,function(){m.resolve({width:f,left:d})}),m.promise}if(!e.nobar){var o=N(".tabs-header-items-container",t),l=N("material-ink-bar",t);return r(!0),r}}function C(e,t,n,a,i){function r(){var n=a.defer(),r=f.children(),c=t.prop("clientWidth")-s,p=c>0&&u*r.length>c,g=p!==m.active;if(0>=c)return a.when();if(m.active=p,p){m.pagesCount=Math.ceil(u*r.length/c),m.itemsPerPage=Math.max(1,Math.floor(r.length/m.pagesCount)),m.tabWidth=c/m.itemsPerPage;var v=l(e.$selIndex),h=m.page!=v;f.css("width",m.tabWidth*r.length+"px"),o(v),h?d.one(i.TRANSITIONEND_EVENT,function(){n.resolve(v)}):n.resolve(v)}else g&&(f.css("width",""),o(0)),n.resolve(0);return n.promise}function o(e){var t=m.pagesCount-1,n=f.children().length-1;0>e&&(e=0),e>t&&(e=t),m.page=e,m.startIndex=m.active?e*m.itemsPerPage:0,m.endIndex=m.active?m.startIndex+m.itemsPerPage-1:n,m.hasPrev=m.active?e>0:!1,m.hasNext=m.active?e+1<m.pagesCount:!1,c(-e*m.itemsPerPage*m.tabWidth)}function l(e){var t=m.pagesCount,n=m.itemsPerPage*m.pagesCount-1,a=m.pagesCount-1;return 1>t?-1:0>e?0:e>n?a:Math.floor(e/m.itemsPerPage)}function c(t){e.pagingOffset!=t&&(isNaN(t)&&(t=0),e.pagingOffset=t,f.css(i.TRANSFORM,"translate3d("+t+"px,0,0)"))}var u=96,s=64,d=N(".tabs-header-items-container",t),f=N(".tabs-header-items",t),m=e.pagination={page:0,next:function(){n.selectAt(m.endIndex+1)},prev:function(){n.selectAt(m.startIndex-1)}};return e.$on(W.FOCUS_CHANGED,function(){}),r}function R(e,t,n){function a(a,r,o,l,c){function u(e,n){function a(){return o.id||i.TAB+"_"+l.$scope.$id+"_"+n.$id}var i=G.ARIA.ROLE;n.ariaId=a(),t.update(e,{id:n.ariaId,role:i.TAB,"aria-selected":!1,"aria-controls":"content_"+n.ariaId})}function s(){var e=a.$watch("disabled",function(e){a.active&&e&&l.next(a)});a.$watch("active",function(e){t.update(r,{"aria-selected":e,tabIndex:e===!0?0:-1})}),a.$on("$destroy",function(){e(),l.remove(a)})}function d(e){var t=e;c(function(e){t.content=[],angular.forEach(e,function(e){z(e)||(U(e,"material-tab-label")?t.label=e.childNodes:t.content.push(e))})});var n=angular.element(r[0].querySelector("material-tab-label"));angular.isDefined(e.label)?(n.append(e.label),delete e.label):(angular.forEach(e.content,function(e){n.append(e)}),delete e.content)}var f={active:!1,disabled:!1,deselected:i,selected:i};e(a,o,{label:"@?",active:"=?",disabled:"=?ngDisabled",deselected:"&onDeselect",selected:"&onSelect"},f),a.$watch("active",function(e){r.toggleClass("active",e)}),n.attachButtonBehavior(r),s(),d(a),u(r,a),r.on("click",function(){a.disabled?l.focusSelected():l.select(a)}).on("keydown",function(e){e.which==G.KEY_CODE.SPACE?l.select(a):e.which===G.KEY_CODE.LEFT_ARROW?l.previous(a):e.which===G.KEY_CODE.RIGHT_ARROW&&l.next(a)}),l.add(a,r)}var i=angular.noop;return{restrict:"E",replace:!1,require:"^materialTabs",transclude:"true",scope:!0,link:a,template:"<material-tab-label></material-tab-label>"}}function x(e){return function(t){var n=e.get(t);return n||e.notFoundError(t),{select:function(e){return n&&n.selectAt(e)}}}}function O(e,t,n,a){function i(){return u(C)}function r(){r.queued||(r.queued=!0,e.$evalAsync(function(){e.$broadcast(W.TABS_CHANGED,C),r.queued=!1}))}function o(){return v("current")}function l(t){var n=v("next",t);return n!=A.indexOf(C)&&e.$broadcast(W.FOCUS_CHANGED,n),n}function c(t){var n=v("previous",t);return n!=A.indexOf(C)&&e.$broadcast(W.FOCUS_CHANGED,n),n}function u(e){return angular.isUndefined(e)&&(e=C),e?I[e.$id]:void 0}function s(e){return A.items().filter(e||angular.identity)}function d(){R.$$hash=A.items().map(function(e){return e.$id}).join(",")}function f(t,n){if(t!=C){var a=E(!0),i=E(!1);return angular.forEach(A.items(),i),null!=t&&(C=a(t.disabled?A.next(t,b):t),e.$selIndex=C?String(C.$index||A.indexOf(C)):-1,n||r()),C}}function m(e,t){if(A.inRange(e)){var n=A.findBy("$index",e),a=n?n[0]:null;a!=C&&(b(a)||(a=h(a)),f(a||A.first(),t))}}function p(t,n){if(angular.isUndefined(t.$index)&&(t.$index=A.count()),I[t.$id]=n,!A.contains(t)){var a=A.add(t,t.$index);e.$selIndex==a||t.active?f(t):r()}return d(),t.$index}function g(e){A.contains(e)&&(f(A.next(e,b)||A.previous(e,b)),A.remove(e),r(),a(function(){delete I[e.$id]},300)),d()}function v(e,t){var n="current"===e?C:"next"===e?A.next(t||C,b):"previous"===e?A.previous(t||C,b):null,a=u(n);return a&&a[0].focus(),A.indexOf(n)}function h(e){return f(A.next(e,b)||e)}function $(e){return f(A.previous(e,b)||e)}function b(e){return e&&!e.disabled}function E(e){return function(t){return t&&e!=t.active?(t.active=e,e?(C=t,t.selected()):(C==t&&(C=null),t.deselected()),t):null}}var A=K.iterator([],!1),T="tabs"+e.$id,I={},C=null,R=this;R.noink=!!e.noink,R.nobar=!!e.nobar,R.scope=e,R.$scope=e,R.$$tabs=s,R.$$hash="",R.add=p,R.remove=g,R.select=f,R.selectAt=m,R.next=h,R.previous=$,R.focusSelected=o,R.focusNext=l,R.focusPrevious=c,R.selectedElement=i,n.register(R,t.componentId||T)}function y(e,t,n,a,i,r,o){function l(){return{pre:function(e,t,n,a){e.noink=angular.isDefined(n.noink),e.nobar=angular.isDefined(n.nobar),e.nostretch=angular.isDefined(n.nostretch),a.noink=e.noink,e.$watch("$selIndex",function(e){a.selectAt(e)});var i=N("material-ink-bar",t);i&&e.nobar&&i.remove()},post:function(l,c,u,s,d){function f(){function e(){return u.id||"tabs_"+l.$id}var t=G.ARIA.ROLE;o.update(c,{id:e(),role:t.TAB_LIST})}function m(){var e=u.tabsAlign||"top",t=N(".tabs-content",c);"bottom"==e&&c.prepend(t)}function p(){var e=s.$$tabs();e.length&&angular.isUndefined(l.$selIndex)&&s.select(e[0])}function g(){d(function(e){var t=N(".tabs-header-items",c),n=angular.element(c[0]);angular.forEach(e,function(e){var a=U(e,"material-tab")||j(e);a?t.append(e):n.prepend(e)})})}function v(){function e(e,t){if(t){var n=angular.bind(e,e.selected),a=angular.bind(e,e.deselected);k(t),e.deselected=function(){a(),e.$$postDigest(function(){t.$disconnect()})},e.selected=function(){t.$reconnect(),n()},e.active||e.$$postDigest(function(){t.$disconnect()})}}function t(e,t){var n=t.tab;e[n.$id]=t,e.length=e.length+1,n.$on("$destroy",function(){angular.element(t.element).remove(),delete e[n.$id],e.length=e.length-1})}function n(){return s.$$hash}function i(e){var t=r(e)?e.content:void 0,n=t&&t.length?angular.element(t[0]).scope():null;return delete e.content,{nodes:t,scope:n}}function r(e){return e.content&&e.content.length}function u(e){var t=!1;return angular.isDefined(e.nodes)&&angular.forEach(e.nodes,function(e){t=t||!z(e)}),t}function d(e){return!h.contains(e)}var f=N(".tabs-content",c),m='<div class="material-view" ng-show="active"></div>';l.$watch(n,function(){function n(e){f.toggleClass("ng-hide",!!e)}function r(e,t){o.update(e,{id:"content_"+t.ariaId,role:G.ARIA.ROLE.TAB_PANEL,"aria-labelledby":t.ariaId})}var l=s.$$tabs(d),c=l.map(i);c.some(u)?(angular.forEach(c,function(n,i){var o=l[i++],c=a(m)(o);r(c,o),e(o,n.scope),n.nodes&&angular.forEach(n.nodes,function(e){z(e)||c.append(e)}),f.append(c),t(h,{tab:o,element:c})}),n()):n(!1)})}var h={length:0,contains:function(e){return!angular.isUndefined(h[e.$id])}},$=0,b=I(l,c,s,e,i)||angular.noop,E=C(l,c,s,e,i),A=function(e){l.$evalAsync(function(){E().then(function(){n(function(){b(),e.name==W.TABS_CHANGED&&$++&&s.focusSelected()},60)}),r(b)})},T=r.debounce(A),R=function(){angular.element(t).off("resize",T)};r(A),angular.element(t).on(W.WINDOW_RESIZE,T),l.$on(W.TABS_CHANGED,A),l.$on(W.SCOPE_DESTROY,R),g(),v(),f(),m(),p()}}}return{restrict:"E",replace:!1,transclude:"true",scope:{$selIndex:"=?selected"},compile:l,controller:["$scope","$attrs","$materialComponentRegistry","$timeout","$$rAF",O],template:'<div class="tabs-header" ng-class="{\'tab-paginating\': pagination.active}"> <div class="tab-paginator prev" ng-if="pagination.active" ng-click="pagination.hasPrev && pagination.prev()" ng-class="{active: pagination.hasPrev}"> </div> <div class="tabs-header-items-container"> <div class="tabs-header-items"></div> </div> <div class="tab-paginator next" ng-if="pagination.active" ng-click="pagination.hasNext && pagination.next()" ng-class="{active: pagination.hasNext}"> </div> <material-ink-bar></material-ink-bar></div><div class="tabs-content ng-hide"></div>'}}function N(e,t){var n=t[0];return angular.element(n.querySelector(e))}function k(e){var t=function(){if(this.$root!==this&&!this.$$destroyed){var e=this.$parent;this.$$disconnected=!0,e.$$childHead===this&&(e.$$childHead=this.$$nextSibling),e.$$childTail===this&&(e.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$$nextSibling=this.$$prevSibling=null}},n=function(){if(this.$root!==this&&this.$$disconnected){var e=this,t=e.$parent;e.$$disconnected=!1,e.$$prevSibling=t.$$childTail,t.$$childHead?(t.$$childTail.$$nextSibling=e,t.$$childTail=e):t.$$childHead=t.$$childTail=e}};return e.$disconnect=angular.bind(e,t),e.$reconnect=angular.bind(e,n),e}function S(){return{restrict:"E"}}function w(e,t,n,a,i){function r(e){return"material-toast-open-"+(e.indexOf("top")>-1?"top":"bottom")}function o(a){return a=angular.extend({duration:3e3,swipeDisabled:!1,position:"bottom left"},a||{}),l&&l.then(function(e){e()}),l=n.compile(a).then(function(n){function o(t){s.addClass(t.type),e(l)}function l(){l.called||(l.called=!0,m.destroy(),c.removeClass(d),e.cancel(f),i.leave(s).then(function(){u.$destroy()}))}n.locals.$hideToast=l;var u=t.$new(),s=n.link(u),d=r(a.position);s.addClass(a.position),c.addClass(d);var f;i.enter(s,c).then(function(){a.duration&&(f=e(l,a.duration))});var m=new Hammer(s[0],{recognizers:[[Hammer.Swipe,{direction:Hammer.DIRECTION_HORIZONTAL}]]});return m.on("swipeleft swiperight",o),l})}var l,c=a.find("body");return c.length||(c=a),o}function D(e,t){return{restrict:"E",controller:angular.noop,link:function(n,a,i){function r(){function r(t,n){K.elementIsSibling(a,n)&&(u&&u.off("scroll",m),n.on("scroll",m),n.attr("scroll-shrink","true"),u=n,e(o))}function o(){c=a.prop("offsetHeight"),u.css("margin-top",-c*f+"px"),l()}function l(e){var n=e?e.target.scrollTop:d;p(),s=Math.min(c/f,Math.max(0,s+n-d)),a.css(t.TRANSFORM,"translate3d(0,"+-s*f+"px,0)"),u.css(t.TRANSFORM,"translate3d(0,"+(c-s)*f+"px,0)"),d=n}var c,u,s=0,d=0,f=i.shrinkSpeedFactor||.5,m=e.debounce(l),p=K.debounce(o,5e3);n.$on("$materialContentLoaded",r)}angular.isDefined(i.scrollShrink)&&r()}}}function _(){}function P(){return{restrict:"E",controller:[_]}}function B(e){return{restrict:"E",template:'<div class="container"><div class="dashed"></div><div class="bar bar1"></div><div class="bar bar2"></div></div>',link:function(t,n,a){var i=angular.element(n[0].querySelector(".bar1")),r=angular.element(n[0].querySelector(".bar2")),o=angular.element(n[0].querySelector(".container"));a.$observe("value",function(e){r.css("width",F(e).toString()+"%")}),a.$observe("secondaryvalue",function(e){i.css("width",F(e).toString()+"%")}),e(function(){o.addClass("ready")})}}}function F(e){return e>100?100:0>e?0:e||0}function L(){function e(e,t){return angular.forEach(t,K.spread(function(t,n){e.attr(n,t)})),e}function t(e,t,n){var a=e[0];if(!a.hasAttribute(t)){var i=angular.isDefined(n);i&&(n=String(n).trim(),e.attr(t,n))}}return{expect:t,update:e}}function M(e,t){var n=/^\s*([@=&])(\??)\s*(\w*)\s*$/;return function(a,i,r,o){function l(e,t,n){if(!angular.isDefined(i[e])){var r=o&&o.hasOwnProperty(t);return a[t]=r?o[t]:n,!0}return!1}angular.forEach(r||{},function(r,o){var c,u,s=r.match(n)||[],d=s[3]||o,f=s[1];switch(f){case"@":i.$observe(d,function(e){a[o]=e}),i.$$observers[d].$$scope=a,l(d,o)||(a[o]=t(i[d])(a));break;case"=":l(d,o)||(a[o]=""===i[d]?!0:a.$eval(i[d]),u=a.$watch(i[d],function(e){a[o]=e}),a.$on("$destroy",u));break;case"&":if(!l(d,o,angular.noop)){if(i[d]&&i[d].match(RegExp(o+"(.*?)")))throw new Error('& expression binding "'+o+'" looks like it will recursively call "'+i[d]+'" and cause a stack overflow! Please choose a different scopeName.');c=e(i[d]),a[o]=function(e){return c(a,e)}}}})}}function H(e,t,n,a,i,r){this.compile=function(o){var l=o.templateUrl,c=o.template||"",u=o.controller,s=o.controllerAs,d=o.resolve||{},f=o.locals||{},m=o.transformTemplate||angular.identity;return angular.forEach(d,function(e,t){d[t]=angular.isString(e)?n.get(e):n.invoke(e)}),angular.extend(d,f),d.$template=l?t.get(l,{cache:r}).then(function(e){return e.data}):e.when(c),e.all(d).then(function(e){var t=m(e.$template),n=angular.element("<div>").html(t).contents(),r=a(n);return{locals:e,element:n,link:function(t){if(e.$scope=t,u){var a=i(u,e);n.data("$ngControllerController",a),n.children().data("$ngControllerController",a),s&&(t[s]=a)}return r(t)}}})}}function V(e){var t=[];return{notFoundError:function(t){e.error("No instance found for handle",t)},getInstances:function(){return t},get:function(e){var n,a,i;for(n=0,a=t.length;a>n;n++)if(i=t[n],i.$$materialHandle===e)return i;return null},register:function(e,n){return e.$$materialHandle=n,t.push(e),function(){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}}}}function q(e,t,n){function a(n,a,d){function f(e,t){function a(){h.push({data:e,done:t})}function i(e,t){if(angular.isFunction(n.throttle)){t=t||angular.noop;try{n.throttle.apply(null,[e,function(e){t.apply(null,[e]),p()}])}catch(a){d(a),p()}}else p()}switch(b!=u&&a(),b){case l:m();break;case c:break;case u:i(e,t);break;case s:g()}}function m(){function e(e){o(e),b=u,angular.forEach(h,function(e){f(e.data,function(t){o(t),angular.isFunction(e.done)&&e.done(t)})}),h=[]}return v.apply(null,[c,n.start]).then(e,d)}function p(){function e(e){o(e),b==s&&(b=l,a())}return v.apply(null,[s,n.end]).then(e,d)}function g(){try{angular.isFunction($)||($=angular.noop),$(),b=l}finally{m()}}function v(e,n){var a=t.defer(),o=angular.isFunction(n),l=o&&n.length<1,c=o?n:r;try{b=e,$=c.apply(null,[l?r(a):o?i(a):a])}catch(u){a.reject(u)}return a.promise}var h=[],$=angular.noop,b=l;return e(function(){m().then(function(){n.throttle||p()})},0,!1),f}function i(e){return function(t){e.resolve.apply(null,[t])}}function r(e){return e=e||t.defer(),e.resolve.apply(null,arguments.length>1?[].slice.call(arguments,1):[]),e.promise}function o(e){angular.isDefined(e)&&n.debug(e)}var l=0,c=1,u=2,s=3;return function(e){return function(t,n){return a(angular.extend({},e),t||angular.noop,n||angular.noop)}}}angular.module("ngMaterial",["ng","ngAnimate","material.services.attrBind","material.services.compiler","material.services.registry","material.services.throttle","material.decorators","material.services.aria","material.components.button","material.components.card","material.components.checkbox","material.components.content","material.components.dialog","material.components.divider","material.components.icon","material.components.linearProgress","material.components.list","material.components.radioButton","material.components.sidenav","material.components.slider","material.components.switch","material.components.tabs","material.components.textField","material.components.toast","material.components.toolbar","material.components.whiteframe"]);var Y=/([\:\-\_]+(.))/g,K={isDisabled:function(e,t){return K.ancestorHasAttribute(e,"disabled",t)},ancestorHasAttribute:function(e,t,n){n=n||4;for(var a=e;n--&&a.length;){if(a[0].hasAttribute&&a[0].hasAttribute(t))return!0;a=a.parent()}return!1},elementIsSibling:function(e,t){return e.parent().length&&e.parent()[0]===t.parent()[0]},camelCase:function(e){return e.replace(Y,function(e,t,n,a){return a?n.toUpperCase():n})},stringFromTextBody:function(e,t){var n=e.trim();return n.split(/\s+/).length>t&&(n=e.split(/\s+/).slice(1,t+1).join(" ")+"..."),n},spread:function(e,t){return function(){var n=Array.prototype.slice.call(arguments,0);e.apply(t,n)}},iterator:e,css:{appendSuffix:function(e){var t="top left right bottom x y width height border-width border-radius borderWidth borderRadiusmargin margin-top margin-bottom margin-left margin-right "+"padding padding-left padding-right padding-top padding-bottom".split(" ");return angular.forEach(e,function(n,a){var i=t.indexOf(a)>-1,r=String(n).indexOf("px")>-1;
|
|
i&&!r&&(e[a]=n+"px")}),e}},debounce:function(e,t,n){var a;return function(){var i=this,r=arguments;clearTimeout(a),a=setTimeout(function(){a=null,n||e.apply(i,r)},t),n&&!a&&e.apply(i,r)}}};angular.element.prototype.focus=angular.element.prototype.focus||function(){return this.length&&this[0].focus(),this};{var G={ARIA:{ROLE:{BUTTON:"button",CHECKBOX:"checkbox",DIALOG:"dialog",LIST:"list",LIST_ITEM:"listitem",RADIO:"radio",RADIO_GROUP:"radiogroup",SLIDER:"slider",TAB_LIST:"tablist",TAB:"tab",TAB_PANEL:"tabpanel"},PROPERTY:{CHECKED:"aria-checked",HIDDEN:"aria-hidden",EXPANDED:"aria-expanded",LABEL:"aria-label",SELECTED:"aria-selected",LABEL_BY:"aria-labelledby"},STATE:{}},KEY_CODE:{ESCAPE:27,SPACE:32,LEFT_ARROW:37,RIGHT_ARROW:39,ENTER:13},EVENTS:{SCOPE_DESTROY:"$destroy",TABS_CHANGED:"$materialTabsChanged",FOCUS_CHANGED:"$materialFocusChanged",WINDOW_RESIZE:"resize",KEY_DOWN:"keydown",CLICK:"click"}},W=G.EVENTS;G.KEY_CODE}angular.module("material.animations",["material.services.throttle"]).service("$materialEffects",["$rootElement","$$rAF","$sniffer","$q",t]),function(){function e(){return function(){return{controller:angular.noop}}}angular.module("material.animations").directive({noink:e(),nobar:e(),nostretch:e()})}(),angular.module("material.animations").directive("inkRipple",["$materialInkRipple",n]).factory("$materialInkRipple",["$window","$$rAF","$materialEffects","$timeout",a]),angular.module("material.components.button",["material.animations","material.services.aria"]).directive("materialButton",["ngHrefDirective","$materialInkRipple","$aria",i]),angular.module("material.components.card",[]).directive("materialCard",[r]),angular.module("material.components.checkbox",["material.animations","material.services.aria"]).directive("materialCheckbox",["inputDirective","$materialInkRipple","$aria",o]),angular.module("material.components.content",["material.services.registry"]).directive("materialContent",[l]),angular.module("material.components.dialog",["material.animations","material.services.compiler","material.services.aria"]).directive("materialDialog",["$$rAF",c]).factory("$materialDialog",["$timeout","$materialCompiler","$rootElement","$rootScope","$materialEffects","$animate","$aria",u]),angular.module("material.components.textField",[]).directive("materialInputGroup",[s]).directive("materialInput",[d]),angular.module("material.components.icon",[]).directive("materialIcon",[f]),angular.module("material.components.list",[]).directive("materialList",[m]).directive("materialItem",[p]),angular.module("material.components.radioButton",["material.animations","material.services.aria"]).directive("materialRadioGroup",[g]).directive("materialRadioButton",["$aria",v]),angular.module("material.components.sidenav",["material.services.registry"]).factory("$materialSidenav",["$materialComponentRegistry",$]).directive("materialSidenav",["$timeout",b]).controller("$materialSidenavController",["$scope","$element","$attrs","$timeout","$materialSidenav","$materialComponentRegistry",h]),angular.module("material.components.slider",["material.animations","material.services.aria"]).directive("materialSlider",[E]),angular.module("material.components.switch",["material.components.checkbox","material.components.radioButton"]).directive("materialSwitch",["materialCheckboxDirective","materialRadioButtonDirective",T]),angular.module("material.components.tabs",["material.animations","material.services.attrBind","material.services.registry"]),angular.module("material.components.tabs").directive("materialTab",["$attrBind","$aria","$materialInkRipple",R]),angular.module("material.components.tabs").factory("$materialTabs",["$materialComponentRegistry",x]).controller("materialTabsController",["$scope","$attrs","$materialComponentRegistry","$timeout",O]),angular.module("material.components.tabs").directive("materialTabs",["$q","$window","$timeout","$compile","$materialEffects","$$rAF","$aria",y]);var U=function(e,t){return e.tagName&&(e.hasAttribute(t)||e.hasAttribute("data-"+t)||e.tagName.toLowerCase()===t||e.tagName.toLowerCase()==="data-"+t)},j=function(e){var t=8;return e.nodeType==t&&e.nodeValue.indexOf("ngRepeat")>-1},z=function(e){var t=3,n=8;return e.nodeType==n||e.nodeType==t&&!(e.nodeValue||"").trim()};angular.module("material.components.toast",["material.services.compiler"]).directive("materialToast",[S]).factory("$materialToast",["$timeout","$rootScope","$materialCompiler","$rootElement","$animate",w]),angular.module("material.components.toolbar",["material.components.content","material.animations"]).directive("materialToolbar",["$$rAF","$materialEffects",D]),angular.module("material.components.whiteframe",[]),angular.module("material.components.divider",["material.animations","material.services.aria"]).directive("materialDivider",P),angular.module("material.components.linearProgress",["material.animations","material.services.aria"]).directive("materialLinearProgress",["$timeout",B]),angular.module("material.decorators",[]).config(["$provide",function(e){function t(e){return e.debounce=function(t){var n,a,i,r;return function(){n=arguments,r=this,i=t,a||(a=!0,e(function(){i.apply(r,n),a=!1}))}},e}e.decorator("$$rAF",["$delegate","$rootScope",t])}]),angular.module("material.services.aria",[]).service("$aria",["$log",L]),angular.module("material.services.attrBind",[]).factory("$attrBind",["$parse","$interpolate",M]),angular.module("material.services.compiler",[]).service("$materialCompiler",["$q","$http","$injector","$compile","$controller","$templateCache",H]),angular.module("material.services.registry",[]).factory("$materialComponentRegistry",["$log",V]),angular.module("material.services.throttle",[]).factory("$throttle",["$timeout","$$q","$log",q])}(); |