/* * angular-ui-bootstrap * http://angular-ui.github.io/bootstrap/ * Version: 0.14.3 - 2015-10-23 * License: MIT * * Modules: Pagination, Modal */ angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.modal","ui.bootstrap.stackedMap","ui.bootstrap.pagination"]),angular.module("ui.bootstrap.tpls",["template/modal/backdrop.html","template/modal/window.html","template/pagination/pager.html","template/pagination/pagination.html"]),angular.module("ui.bootstrap.modal",["ui.bootstrap.stackedMap"]).factory("$$multiMap",function(){return{createNew:function(){var e={};return{entries:function(){return Object.keys(e).map(function(a){return{key:a,value:e[a]}})},get:function(a){return e[a]},hasKey:function(a){return!!e[a]},keys:function(){return Object.keys(e)},put:function(a,n){e[a]||(e[a]=[]),e[a].push(n)},remove:function(a,n){var t=e[a];if(t){var i=t.indexOf(n);-1!==i&&t.splice(i,1),t.length||delete e[a]}}}}}}).directive("uibModalBackdrop",["$animate","$injector","$uibModalStack",function(e,a,n){function t(a,t,o){t.addClass("modal-backdrop"),o.modalInClass&&(i?i(t,{addClass:o.modalInClass}).start():e.addClass(t,o.modalInClass),a.$on(n.NOW_CLOSING_EVENT,function(a,n){var r=n();i?i(t,{removeClass:o.modalInClass}).start().then(r):e.removeClass(t,o.modalInClass).then(r)}))}var i=null;return a.has("$animateCss")&&(i=a.get("$animateCss")),{replace:!0,templateUrl:"template/modal/backdrop.html",compile:function(e,a){return e.addClass(a.backdropClass),t}}}]).directive("uibModalWindow",["$uibModalStack","$q","$animate","$injector",function(e,a,n,t){var i=null;return t.has("$animateCss")&&(i=t.get("$animateCss")),{scope:{index:"@"},replace:!0,transclude:!0,templateUrl:function(e,a){return a.templateUrl||"template/modal/window.html"},link:function(t,o,r){o.addClass(r.windowClass||""),o.addClass(r.windowTopClass||""),t.size=r.size,t.close=function(a){var n=e.getTop();n&&n.value.backdrop&&"static"!==n.value.backdrop&&a.target===a.currentTarget&&(a.preventDefault(),a.stopPropagation(),e.dismiss(n.key,"backdrop click"))},o.on("click",t.close),t.$isRendered=!0;var l=a.defer();r.$observe("modalRender",function(e){"true"==e&&l.resolve()}),l.promise.then(function(){var l=null;r.modalInClass&&(l=i?i(o,{addClass:r.modalInClass}).start():n.addClass(o,r.modalInClass),t.$on(e.NOW_CLOSING_EVENT,function(e,a){var t=a();i?i(o,{removeClass:r.modalInClass}).start().then(t):n.removeClass(o,r.modalInClass).then(t)})),a.when(l).then(function(){var e=o[0].querySelector("[autofocus]");e?e.focus():o[0].focus()});var s=e.getTop();s&&e.modalRendered(s.key)})}}}]).directive("uibModalAnimationClass",function(){return{compile:function(e,a){a.modalAnimation&&e.addClass(a.uibModalAnimationClass)}}}).directive("uibModalTransclude",function(){return{link:function(e,a,n,t,i){i(e.$parent,function(e){a.empty(),a.append(e)})}}}).factory("$uibModalStack",["$animate","$timeout","$document","$compile","$rootScope","$q","$injector","$$multiMap","$$stackedMap",function(e,a,n,t,i,o,r,l,s){function u(){for(var e=-1,a=C.keys(),n=0;n0&&(a=C.top().value,a.modalDomEl.toggleClass(a.windowTopClass||"",e))}function p(){if(v&&-1==u()){var e=$;m(v,$,function(){e=null}),v=void 0,$=void 0}}function m(a,n,t){function i(){i.done||(i.done=!0,f?f(a,{event:"leave"}).start().then(function(){a.remove()}):e.leave(a),n.$destroy(),t&&t())}var r,l=null,s=function(){return r||(r=o.defer(),l=r.promise),function(){r.resolve()}};return n.$broadcast(w.NOW_CLOSING_EVENT,s),o.when(l).then(i)}function g(e,a,n){return!e.value.modalScope.$broadcast("modal.closing",a,n).defaultPrevented}var f=null;r.has("$animateCss")&&(f=r.get("$animateCss"));var v,$,b,h="modal-open",C=s.createNew(),k=l.createNew(),w={NOW_CLOSING_EVENT:"modal.stack.now-closing"},P=0,x="a[href], area[href], input:not([disabled]), button:not([disabled]),select:not([disabled]), textarea:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable=true]";return i.$watch(u,function(e){$&&($.index=e)}),n.bind("keydown",function(e){if(e.isDefaultPrevented())return e;var a=C.top();if(a&&a.value.keyboard)switch(e.which){case 27:e.preventDefault(),i.$apply(function(){w.dismiss(a.key,"escape key press")});break;case 9:w.loadFocusElementList(a);var n=!1;e.shiftKey?w.isFocusInFirstItem(e)&&(n=w.focusLastFocusableElement()):w.isFocusInLastItem(e)&&(n=w.focusFirstFocusableElement()),n&&(e.preventDefault(),e.stopPropagation())}}),w.open=function(e,a){var o=n[0].activeElement,r=a.openedClass||h;c(!1),C.add(e,{deferred:a.deferred,renderDeferred:a.renderDeferred,modalScope:a.scope,backdrop:a.backdrop,keyboard:a.keyboard,openedClass:a.openedClass,windowTopClass:a.windowTopClass}),k.put(r,e);var l=n.find("body").eq(0),s=u();if(s>=0&&!v){$=i.$new(!0),$.index=s;var d=angular.element('
');d.attr("backdrop-class",a.backdropClass),a.animation&&d.attr("modal-animation","true"),v=t(d)($),l.append(v)}var p=angular.element('
');p.attr({"template-url":a.windowTemplateUrl,"window-class":a.windowClass,"window-top-class":a.windowTopClass,size:a.size,index:C.length()-1,animate:"animate"}).html(a.content),a.animation&&p.attr("modal-animation","true");var m=t(p)(a.scope);C.top().value.modalDomEl=m,C.top().value.modalOpener=o,l.append(m),l.addClass(r),w.clearFocusListCache()},w.close=function(e,a){var n=C.get(e);return n&&g(n,a,!0)?(n.value.modalScope.$$uibDestructionScheduled=!0,n.value.deferred.resolve(a),d(e,n.value.modalOpener),!0):!n},w.dismiss=function(e,a){var n=C.get(e);return n&&g(n,a,!1)?(n.value.modalScope.$$uibDestructionScheduled=!0,n.value.deferred.reject(a),d(e,n.value.modalOpener),!0):!n},w.dismissAll=function(e){for(var a=this.getTop();a&&this.dismiss(a.key,e);)a=this.getTop()},w.getTop=function(){return C.top()},w.modalRendered=function(e){var a=C.get(e);a&&a.value.renderDeferred.resolve()},w.focusFirstFocusableElement=function(){return b.length>0?(b[0].focus(),!0):!1},w.focusLastFocusableElement=function(){return b.length>0?(b[b.length-1].focus(),!0):!1},w.isFocusInFirstItem=function(e){return b.length>0?(e.target||e.srcElement)==b[0]:!1},w.isFocusInLastItem=function(e){return b.length>0?(e.target||e.srcElement)==b[b.length-1]:!1},w.clearFocusListCache=function(){b=[],P=0},w.loadFocusElementList=function(e){if((void 0===b||!b.length)&&e){var a=e.value.modalDomEl;a&&a.length&&(b=a[0].querySelectorAll(x))}},w}]).provider("$uibModal",function(){var e={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$templateRequest","$controller","$uibModalStack","$modalSuppressWarning","$log",function(a,n,t,i,o,r,l,s){function u(e){return e.template?t.when(e.template):i(angular.isFunction(e.templateUrl)?e.templateUrl():e.templateUrl)}function d(e){var n=[];return angular.forEach(e,function(e){n.push(angular.isFunction(e)||angular.isArray(e)?t.when(a.invoke(e)):angular.isString(e)?t.when(a.get(e)):t.when(e))}),n}var c={},p=null;return c.getPromiseChain=function(){return p},c.open=function(a){function i(){return $}var c=t.defer(),m=t.defer(),g=t.defer(),f={result:c.promise,opened:m.promise,rendered:g.promise,close:function(e){return r.close(f,e)},dismiss:function(e){return r.dismiss(f,e)}};if(a=angular.extend({},e.options,a),a.resolve=a.resolve||{},!a.template&&!a.templateUrl)throw new Error("One of template or templateUrl options is required.");var v,$=t.all([u(a)].concat(d(a.resolve)));return v=p=t.all([p]).then(i,i).then(function(e){var t=(a.scope||n).$new();t.$close=f.close,t.$dismiss=f.dismiss,t.$on("$destroy",function(){t.$$uibDestructionScheduled||t.$dismiss("$uibUnscheduledDestruction")});var i,u={},d=1;a.controller&&(u.$scope=t,u.$uibModalInstance=f,Object.defineProperty(u,"$modalInstance",{get:function(){return l||s.warn("$modalInstance is now deprecated. Use $uibModalInstance instead."),f}}),angular.forEach(a.resolve,function(a,n){u[n]=e[d++]}),i=o(a.controller,u),a.controllerAs&&(a.bindToController&&angular.extend(i,t),t[a.controllerAs]=i)),r.open(f,{scope:t,deferred:c,renderDeferred:g,content:e[0],animation:a.animation,backdrop:a.backdrop,keyboard:a.keyboard,backdropClass:a.backdropClass,windowTopClass:a.windowTopClass,windowClass:a.windowClass,windowTemplateUrl:a.windowTemplateUrl,size:a.size,openedClass:a.openedClass}),m.resolve(!0)},function(e){m.reject(e),c.reject(e)}).finally(function(){p===v&&(p=null)}),f},c}]};return e}),angular.module("ui.bootstrap.modal").value("$modalSuppressWarning",!1).directive("modalBackdrop",["$animate","$injector","$modalStack","$log","$modalSuppressWarning",function(e,a,n,t,i){function o(a,o,l){i||t.warn("modal-backdrop is now deprecated. Use uib-modal-backdrop instead."),o.addClass("modal-backdrop"),l.modalInClass&&(r?r(o,{addClass:l.modalInClass}).start():e.addClass(o,l.modalInClass),a.$on(n.NOW_CLOSING_EVENT,function(a,n){var t=n();r?r(o,{removeClass:l.modalInClass}).start().then(t):e.removeClass(o,l.modalInClass).then(t)}))}var r=null;return a.has("$animateCss")&&(r=a.get("$animateCss")),{replace:!0,templateUrl:"template/modal/backdrop.html",compile:function(e,a){return e.addClass(a.backdropClass),o}}}]).directive("modalWindow",["$modalStack","$q","$animate","$injector","$log","$modalSuppressWarning",function(e,a,n,t,i,o){var r=null;return t.has("$animateCss")&&(r=t.get("$animateCss")),{scope:{index:"@"},replace:!0,transclude:!0,templateUrl:function(e,a){return a.templateUrl||"template/modal/window.html"},link:function(t,l,s){o||i.warn("modal-window is now deprecated. Use uib-modal-window instead."),l.addClass(s.windowClass||""),l.addClass(s.windowTopClass||""),t.size=s.size,t.close=function(a){var n=e.getTop();n&&n.value.backdrop&&"static"!==n.value.backdrop&&a.target===a.currentTarget&&(a.preventDefault(),a.stopPropagation(),e.dismiss(n.key,"backdrop click"))},l.on("click",t.close),t.$isRendered=!0;var u=a.defer();s.$observe("modalRender",function(e){"true"==e&&u.resolve()}),u.promise.then(function(){var i=null;s.modalInClass&&(i=r?r(l,{addClass:s.modalInClass}).start():n.addClass(l,s.modalInClass),t.$on(e.NOW_CLOSING_EVENT,function(e,a){var t=a();r?r(l,{removeClass:s.modalInClass}).start().then(t):n.removeClass(l,s.modalInClass).then(t)})),a.when(i).then(function(){var e=l[0].querySelector("[autofocus]");e?e.focus():l[0].focus()});var o=e.getTop();o&&e.modalRendered(o.key)})}}}]).directive("modalAnimationClass",["$log","$modalSuppressWarning",function(e,a){return{compile:function(n,t){a||e.warn("modal-animation-class is now deprecated. Use uib-modal-animation-class instead."),t.modalAnimation&&n.addClass(t.modalAnimationClass)}}}]).directive("modalTransclude",["$log","$modalSuppressWarning",function(e,a){return{link:function(n,t,i,o,r){a||e.warn("modal-transclude is now deprecated. Use uib-modal-transclude instead."),r(n.$parent,function(e){t.empty(),t.append(e)})}}}]).service("$modalStack",["$animate","$timeout","$document","$compile","$rootScope","$q","$injector","$$multiMap","$$stackedMap","$uibModalStack","$log","$modalSuppressWarning",function(e,a,n,t,i,o,r,l,s,u,d,c){c||d.warn("$modalStack is now deprecated. Use $uibModalStack instead."),angular.extend(this,u)}]).provider("$modal",["$uibModalProvider",function(e){angular.extend(this,e),this.$get=["$injector","$log","$modalSuppressWarning",function(a,n,t){return t||n.warn("$modal is now deprecated. Use $uibModal instead."),a.invoke(e.$get)}]}]),angular.module("ui.bootstrap.stackedMap",[]).factory("$$stackedMap",function(){return{createNew:function(){var e=[];return{add:function(a,n){e.push({key:a,value:n})},get:function(a){for(var n=0;na?e.selectPage(a):i.$render()})},this.calculateTotalPages=function(){var a=this.itemsPerPage<1?1:Math.ceil(e.totalItems/this.itemsPerPage);return Math.max(a||0,1)},this.render=function(){e.page=parseInt(i.$viewValue,10)||1},e.selectPage=function(a,n){n&&n.preventDefault();var t=!e.ngDisabled||!n;t&&e.page!==a&&a>0&&a<=e.totalPages&&(n&&n.target&&n.target.blur(),i.$setViewValue(a),i.$render())},e.getText=function(a){return e[a+"Text"]||t.config[a+"Text"]},e.noPrevious=function(){return 1===e.page},e.noNext=function(){return e.page===e.totalPages}}]).constant("uibPaginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("uibPagination",["$parse","uibPaginationConfig",function(e,a){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["uibPagination","?ngModel"],controller:"UibPaginationController",controllerAs:"pagination",templateUrl:function(e,a){return a.templateUrl||"template/pagination/pagination.html"},replace:!0,link:function(n,t,i,o){function r(e,a,n){return{number:e,text:a,active:n}}function l(e,a){var n=[],t=1,i=a,o=angular.isDefined(d)&&a>d;o&&(c?(t=Math.max(e-Math.floor(d/2),1),i=t+d-1,i>a&&(i=a,t=i-d+1)):(t=(Math.ceil(e/d)-1)*d+1,i=Math.min(t+d-1,a)));for(var l=t;i>=l;l++){var s=r(l,l,l===e);n.push(s)}if(o&&!c){if(t>1){var u=r(t-1,"...",!1);n.unshift(u)}if(a>i){var p=r(i+1,"...",!1);n.push(p)}}return n}var s=o[0],u=o[1];if(u){var d=angular.isDefined(i.maxSize)?n.$parent.$eval(i.maxSize):a.maxSize,c=angular.isDefined(i.rotate)?n.$parent.$eval(i.rotate):a.rotate;n.boundaryLinks=angular.isDefined(i.boundaryLinks)?n.$parent.$eval(i.boundaryLinks):a.boundaryLinks,n.directionLinks=angular.isDefined(i.directionLinks)?n.$parent.$eval(i.directionLinks):a.directionLinks,s.init(u,a),i.maxSize&&n.$parent.$watch(e(i.maxSize),function(e){d=parseInt(e,10),s.render()});var p=s.render;s.render=function(){p(),n.page>0&&n.page<=n.totalPages&&(n.pages=l(n.page,n.totalPages))}}}}}]).constant("uibPagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("uibPager",["uibPagerConfig",function(e){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["uibPager","?ngModel"],controller:"UibPaginationController",controllerAs:"pagination",templateUrl:function(e,a){return a.templateUrl||"template/pagination/pager.html"},replace:!0,link:function(a,n,t,i){var o=i[0],r=i[1];r&&(a.align=angular.isDefined(t.align)?a.$parent.$eval(t.align):e.align,o.init(r,e))}}}]),angular.module("ui.bootstrap.pagination").value("$paginationSuppressWarning",!1).controller("PaginationController",["$scope","$attrs","$parse","$log","$paginationSuppressWarning",function(e,a,n,t,i){i||t.warn("PaginationController is now deprecated. Use UibPaginationController instead.");var o=this,r={$setViewValue:angular.noop},l=a.numPages?n(a.numPages).assign:angular.noop;this.init=function(t,i){r=t,this.config=i,r.$render=function(){o.render()},a.itemsPerPage?e.$parent.$watch(n(a.itemsPerPage),function(a){o.itemsPerPage=parseInt(a,10),e.totalPages=o.calculateTotalPages()}):this.itemsPerPage=i.itemsPerPage,e.$watch("totalItems",function(){e.totalPages=o.calculateTotalPages()}),e.$watch("totalPages",function(a){l(e.$parent,a),e.page>a?e.selectPage(a):r.$render()})},this.calculateTotalPages=function(){var a=this.itemsPerPage<1?1:Math.ceil(e.totalItems/this.itemsPerPage);return Math.max(a||0,1)},this.render=function(){e.page=parseInt(r.$viewValue,10)||1},e.selectPage=function(a,n){n&&n.preventDefault();var t=!e.ngDisabled||!n;t&&e.page!==a&&a>0&&a<=e.totalPages&&(n&&n.target&&n.target.blur(),r.$setViewValue(a),r.$render())},e.getText=function(a){return e[a+"Text"]||o.config[a+"Text"]},e.noPrevious=function(){return 1===e.page},e.noNext=function(){return e.page===e.totalPages}}]).directive("pagination",["$parse","uibPaginationConfig","$log","$paginationSuppressWarning",function(e,a,n,t){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["pagination","?ngModel"],controller:"PaginationController",controllerAs:"pagination",templateUrl:function(e,a){return a.templateUrl||"template/pagination/pagination.html"},replace:!0,link:function(i,o,r,l){function s(e,a,n){return{number:e,text:a,active:n}}function u(e,a){var n=[],t=1,i=a,o=angular.isDefined(p)&&a>p;o&&(m?(t=Math.max(e-Math.floor(p/2),1),i=t+p-1,i>a&&(i=a,t=i-p+1)):(t=(Math.ceil(e/p)-1)*p+1,i=Math.min(t+p-1,a)));for(var r=t;i>=r;r++){var l=s(r,r,r===e);n.push(l)}if(o&&!m){if(t>1){var u=s(t-1,"...",!1);n.unshift(u)}if(a>i){var d=s(i+1,"...",!1);n.push(d)}}return n}t||n.warn("pagination is now deprecated. Use uib-pagination instead.");var d=l[0],c=l[1];if(c){var p=angular.isDefined(r.maxSize)?i.$parent.$eval(r.maxSize):a.maxSize,m=angular.isDefined(r.rotate)?i.$parent.$eval(r.rotate):a.rotate;i.boundaryLinks=angular.isDefined(r.boundaryLinks)?i.$parent.$eval(r.boundaryLinks):a.boundaryLinks,i.directionLinks=angular.isDefined(r.directionLinks)?i.$parent.$eval(r.directionLinks):a.directionLinks,d.init(c,a),r.maxSize&&i.$parent.$watch(e(r.maxSize),function(e){p=parseInt(e,10),d.render()});var g=d.render;d.render=function(){g(),i.page>0&&i.page<=i.totalPages&&(i.pages=u(i.page,i.totalPages))}}}}}]).directive("pager",["uibPagerConfig","$log","$paginationSuppressWarning",function(e,a,n){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["pager","?ngModel"],controller:"PaginationController",controllerAs:"pagination",templateUrl:function(e,a){return a.templateUrl||"template/pagination/pager.html"},replace:!0,link:function(t,i,o,r){n||a.warn("pager is now deprecated. Use uib-pager instead.");var l=r[0],s=r[1];s&&(t.align=angular.isDefined(o.align)?t.$parent.$eval(o.align):e.align,l.init(s,e))}}}]),angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function(e){e.put("template/modal/backdrop.html",'
\n')}]),angular.module("template/modal/window.html",[]).run(["$templateCache",function(e){e.put("template/modal/window.html",'\n')}]),angular.module("template/pagination/pager.html",[]).run(["$templateCache",function(e){e.put("template/pagination/pager.html",'\n')}]),angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function(e){e.put("template/pagination/pagination.html",'\n')}]);