1 angular.module(
"ui.bootstrap",[
"ui.bootstrap.tpls",
"ui.bootstrap.transition",
"ui.bootstrap.collapse",
"ui.bootstrap.accordion",
"ui.bootstrap.alert",
"ui.bootstrap.bindHtml",
"ui.bootstrap.buttons",
"ui.bootstrap.carousel",
"ui.bootstrap.position",
"ui.bootstrap.datepicker",
"ui.bootstrap.dropdownToggle",
"ui.bootstrap.modal",
"ui.bootstrap.pagination",
"ui.bootstrap.tooltip",
"ui.bootstrap.popover",
"ui.bootstrap.progressbar",
"ui.bootstrap.rating",
"ui.bootstrap.tabs",
"ui.bootstrap.timepicker",
"ui.bootstrap.typeahead"]),angular.module(
"ui.bootstrap.tpls",[
"template/accordion/accordion-group.html",
"template/accordion/accordion.html",
"template/alert/alert.html",
"template/carousel/carousel.html",
"template/carousel/slide.html",
"template/datepicker/datepicker.html",
"template/datepicker/popup.html",
"template/modal/backdrop.html",
"template/modal/window.html",
"template/pagination/pager.html",
"template/pagination/pagination.html",
"template/tooltip/tooltip-html-unsafe-popup.html",
"template/tooltip/tooltip-popup.html",
"template/popover/popover.html",
"template/progressbar/bar.html",
"template/progressbar/progress.html",
"template/rating/rating.html",
"template/tabs/tab.html",
"template/tabs/tabset-titles.html",
"template/tabs/tabset.html",
"template/timepicker/timepicker.html",
"template/typeahead/typeahead-match.html",
"template/typeahead/typeahead-popup.html"]),angular.module(
"ui.bootstrap.transition",[]).factory(
"$transition",[
"$q",
"$timeout",
"$rootScope",
function(a,b,c){
function d(a){
for(var b in a)
if(
void 0!==
f.style[b])
return a[b]}var
e=
function(
d,
f,
g){
g=
g||{};var
h=a.defer(),i=e[
g.animation?
"animationEndEventName":
"transitionEndEventName"],j=
function(){c.$apply(
function(){
d.unbind(i,j),h.resolve(
d)})};
return i&&
d.bind(i,j),b(
function(){angular.isString(f)?
d.addClass(f):angular.isFunction(f)?
f(
d):angular.isObject(f)&&
d.css(f),i||h.resolve(
d)}),h.promise.cancel=
function(){i&&
d.unbind(i,j),h.reject(
"Transition cancelled")},h.promise},f=document.createElement(
"trans"),
g={WebkitTransition:
"webkitTransitionEnd",MozTransition:
"transitionend",OTransition:
"oTransitionEnd",
transition:
"transitionend"},
h={WebkitTransition:
"webkitAnimationEnd",MozTransition:
"animationend",OTransition:
"oAnimationEnd",
transition:
"animationend"};
return e.transitionEndEventName=
d(
g),e.animationEndEventName=
d(
h),e}]),angular.module(
"ui.bootstrap.collapse",[
"ui.bootstrap.transition"]).directive(
"collapse",[
"$transition",
function(a){var b=
function(a,b,c){b.removeClass(
"collapse"),b.css({
height:c});b[0].offsetWidth;b.addClass(
"collapse")};
return{link:
function(c,
d,
e){var
f,
g=!0;c.$watch(
e.collapse,
function(a){a?k():j()});var
h,i=
function(b){
return h&&h.cancel(),h=a(d,b),h.then(
function(){h=
void 0},
function(){h=
void 0}),h},j=
function(){g?(g=!1,f||(b(c,d,
"auto"),d.addClass(
"in"))):i({
height:d[0].scrollHeight+
"px"}).then(
function(){f||(b(c,d,
"auto"),d.addClass(
"in"))}),f=!1},k=
function(){f=!0,d.removeClass(
"in"),g?(g=!1,b(c,d,0)):(b(c,d,d[0].scrollHeight+
"px"),i({
height:
"0"}))}}}}]),angular.module(
"ui.bootstrap.accordion",[
"ui.bootstrap.collapse"]).constant(
"accordionConfig",{closeOthers:!0}).
controller(
"AccordionController",[
"$scope",
"$attrs",
"accordionConfig",
function(a,b,c){this.groups=[],this.scope=a,this.closeOthers=
function(
d){var
e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,
function(a){a!==
d&&(a.isOpen=!1)})},this.addGroup=
function(a){var b=
this;this.groups.push(a),a.$on(
"$destroy",
function(){b.removeGroup(a)})},this.removeGroup=
function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(this.groups.indexOf(a),1)}}]).directive(
"accordion",
function(){
return{restrict:
"EA",
controller:
"AccordionController",transclude:!0,replace:!1,templateUrl:
"template/accordion/accordion.html"}}).
directive(
"accordionGroup",[
"$parse",
"$transition",
"$timeout",
function(a){
return{require:
"^accordion",restrict:
"EA",transclude:!0,replace:!0,templateUrl:
"template/accordion/accordion-group.html",scope:{heading:
"@"},
controller:[
"$scope",
function(){this.setHeading=
function(a){this.heading=a}}],link:
function(b,c,
d,
e){var
f,
g;
e.addGroup(b),b.isOpen=!1,d.isOpen&&(f=a(d.isOpen),g=f.assign,
e.scope.$watch(f,
function(a){b.isOpen=!!a})),b.$watch(
"isOpen",
function(a){a&&
e.closeOthers(b),g&&
g(
e.scope,a)})}}}]).directive(
"accordionHeading",
function(){
return{restrict:
"EA",transclude:!0,
template:
"",replace:!0,require:
"^accordionGroup",compile:
function(a,b,c){
return function(a,b,
d,
e){
e.setHeading(c(a,
function(){}))}}}}).
directive(
"accordionTransclude",
function(){
return{require:
"^accordionGroup",link:
function(a,b,c,
d){a.$watch(
function(){
return d[c.accordionTransclude]},
function(a){a&&(b.html(
""),b.append(a))})}}}),angular.module(
"ui.bootstrap.alert",[]).directive(
"alert",
function(){
return{restrict:
"EA",templateUrl:
"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:
"=",close:
"&"},link:
function(a,b,c){a.closeable=
"close"in c}}}),angular.module(
"ui.bootstrap.bindHtml",[]).directive(
"bindHtmlUnsafe",
function(){
return function(a,b,c){b.addClass(
"ng-binding").data(
"$binding",c.bindHtmlUnsafe),a.$watch(c.bindHtmlUnsafe,
function(a){b.html(a||
"")})}}),angular.module(
"ui.bootstrap.buttons",[]).constant(
"buttonConfig",{activeClass:
"active",toggleEvent:
"click"}).
directive(
"btnRadio",[
"buttonConfig",
function(a){var b=a.activeClass||
"active",c=a.toggleEvent||
"click";
return{require:
"ngModel",link:
function(a,
d,
e,
f){
f.$render=
function(){d.toggleClass(b,angular.equals(
f.$modelValue,a.$eval(e.btnRadio)))},d.bind(c,
function(){d.hasClass(b)||a.$apply(
function(){
f.$setViewValue(a.$eval(e.btnRadio)),
f.$render()})})}}}]).
directive(
"btnCheckbox",[
"buttonConfig",
function(a){var b=a.activeClass||
"active",c=a.toggleEvent||
"click";
return{require:
"ngModel",link:
function(a,
d,
e,
f){
function g(){var b=a.$eval(e.btnCheckboxTrue);
return angular.isDefined(b)?b:!0}
function h(){var b=a.$eval(e.btnCheckboxFalse);
return angular.isDefined(b)?b:!1}
f.$render=
function(){d.toggleClass(b,angular.equals(
f.$modelValue,
g()))},d.bind(c,
function(){a.$apply(function(){f.$setViewValue(d.hasClass(b)?h():g()),f.$render()})})}}}]),angular.module(
"ui.bootstrap.carousel",[
"ui.bootstrap.transition"]).controller(
"CarouselController",[
"$scope",
"$timeout",
"$transition",
"$q",
function(a,b,c){
function d(){
function c(){
f?(a.next(),
d()):a.pause()}
e&&b.cancel(
e);var
g=+a.interval;!isNaN(g)&&g>=0&&(
e=b(c,g))}var
e,
f,
g=
this,
h=
g.slides=[],i=-1;
g.currentSlide=null,
g.select=
function(e,
f){
function j(){
if(
g.currentSlide&&angular.isString(
f)&&!a.noTransition&&e.$element){e.$element.addClass(
f);{e.$element[0].offsetWidth}angular.forEach(
h,
function(a){angular.extend(a,{direction:
"",entering:!1,leaving:!1,active:!1})}),angular.extend(e,{direction:
f,active:!0,entering:!0}),angular.extend(
g.currentSlide||{},{direction:f,leaving:!0}),a.$currentTransition=c(e.$element,{}),
function(b,c){a.$currentTransition.then(
function(){k(b,c)},
function(){k(b,c)})}(e,
g.currentSlide)}
else k(e,
g.currentSlide);
g.currentSlide=
e,i=l,
d()}
function k(b,c){angular.extend(b,{direction:
"",active:!0,leaving:!1,entering:!1}),angular.extend(c||{},{direction:
"",active:!1,leaving:!1,entering:!1}),a.$currentTransition=null}var l=
h.indexOf(e);
void 0===
f&&(
f=l>i?
"next":
"prev"),e&&e!==
g.currentSlide&&(a.$currentTransition?(a.$currentTransition.cancel(),b(j)):j())},
g.indexOfSlide=
function(a){
return h.indexOf(a)},a.next=
function(){var b=(i+1)%
h.length;
return a.$currentTransition?
void 0:
g.select(
h[b],
"next")},a.prev=
function(){var b=0>i-1?
h.length-1:i-1;
return a.$currentTransition?
void 0:
g.select(
h[b],
"prev")},a.select=
function(a){
g.select(a)},a.isActive=
function(a){
return g.currentSlide===a},a.slides=
function(){
return h},a.$watch(
"interval",
d),a.play=
function(){
f||(
f=!0,
d())},a.pause=
function(){a.noPause||(
f=!1,e&&b.cancel(e))},
g.addSlide=
function(b,c){b.$element=c,
h.push(b),1===
h.length||b.active?(
g.select(
h[
h.length-1]),1==
h.length&&a.play()):b.active=!1},
g.removeSlide=
function(a){var b=
h.indexOf(a);
h.splice(b,1),
h.length>0&&a.active?b>=
h.length?
g.select(
h[b-1]):
g.select(
h[b]):i>b&&i--}}]).
directive(
"carousel",[
function(){
return{restrict:
"EA",transclude:!0,replace:!0,
controller:
"CarouselController",require:
"carousel",templateUrl:
"template/carousel/carousel.html",scope:{
interval:
"=",noTransition:
"=",noPause:
"="}}}]).
directive(
"slide",[
"$parse",
function(a){
return{require:
"^carousel",restrict:
"EA",transclude:!0,replace:!0,templateUrl:
"template/carousel/slide.html",scope:{},link:
function(b,c,
d,
e){
if(d.active){var
f=a(d.active),
g=f.assign,
h=b.active=
f(b.$parent);b.$watch(
function(){var a=
f(b.$parent);
return a!==b.active&&(a!==
h?
h=b.active=a:
g(b.$parent,a=h=b.active)),a})}
e.addSlide(b,c),b.$on(
"$destroy",
function(){
e.removeSlide(b)}),b.$watch(
"active",
function(a){a&&e.select(b)})}}}]),angular.module(
"ui.bootstrap.position",[]).factory(
"$position",[
"$document",
"$window",
function(a,b){
function c(a,c){
return a.currentStyle?a.currentStyle[c]:b.getComputedStyle?b.getComputedStyle(a)[c]:a.style[c]}
function d(a){
return"static"===(c(a,
"position")||
"static")}var
e=
function(b){
for(var c=a[0],
e=b.offsetParent||c;
e&&
e!==c&&
d(
e);)
e=
e.offsetParent;
return e||c};
return{position:
function(b){var c=this.
offset(b),
d={top:0,left:0},
f=
e(b[0]);
f!=a[0]&&(
d=this.
offset(angular.element(
f)),d.top+=
f.clientTop-
f.scrollTop,d.left+=
f.clientLeft-
f.scrollLeft);var
g=b[0].getBoundingClientRect();
return{
width:g.width||b.prop(
"offsetWidth"),
height:g.height||b.prop(
"offsetHeight"),top:c.top-d.top,left:c.left-d.left}},
offset:
function(c){var
d=c[0].getBoundingClientRect();
return{
width:d.width||c.prop(
"offsetWidth"),
height:d.height||c.prop(
"offsetHeight"),top:d.top+(b.pageYOffset||a[0].body.scrollTop||a[0].documentElement.scrollTop),left:d.left+(b.pageXOffset||a[0].body.scrollLeft||a[0].documentElement.scrollLeft)}}}}]),angular.module(
"ui.bootstrap.datepicker",[
"ui.bootstrap.position"]).constant(
"datepickerConfig",{dayFormat:
"dd",monthFormat:
"MMMM",yearFormat:
"yyyy",dayHeaderFormat:
"EEE",dayTitleFormat:
"MMMM yyyy",monthTitleFormat:
"yyyy",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null}).
controller(
"DatepickerController",[
"$scope",
"$attrs",
"dateFilter",
"datepickerConfig",
function(a,b,c,
d){
function e(b,c){
return angular.isDefined(b)?a.$parent.$eval(b):c}
function f(a,b){
return new Date(a,b,0).getDate()}
function g(a,b){
for(var c=
new Array(b),
d=a,
e=0;b>
e;)c[e++]=
new Date(
d),
d.setDate(
d.getDate()+1);
return c}
function h(a,b,
d,
e){
return{date:a,label:c(a,b),selected:!!
d,secondary:!!
e}}var i={day:
e(b.dayFormat,
d.dayFormat),month:
e(b.monthFormat,
d.monthFormat),year:
e(b.yearFormat,
d.yearFormat),dayHeader:
e(b.dayHeaderFormat,
d.dayHeaderFormat),dayTitle:
e(b.dayTitleFormat,
d.dayTitleFormat),monthTitle:
e(b.monthTitleFormat,
d.monthTitleFormat)},j=
e(b.startingDay,
d.startingDay),k=
e(b.yearRange,
d.yearRange);this.minDate=
d.minDate?
new Date(
d.minDate):null,this.maxDate=
d.maxDate?
new Date(
d.maxDate):null,this.modes=[{
name:
"day",getVisibleDates:
function(a,b){var
d=a.getFullYear(),
e=a.getMonth(),k=
new Date(d,
e,1),l=j-k.getDay(),m=l>0?7-l:-l,n=
new Date(k),o=0;m>0&&(n.setDate(-m+1),o+=m),o+=
f(d,
e+1),o+=(7-o%7)%7;
for(var p=
g(n,o),q=
new Array(7),r=0;o>r;r++){var
s=
new Date(p[r]);p[r]=
h(s,i.day,b&&b.getDate()===s.getDate()&&b.getMonth()===s.getMonth()&&b.getFullYear()===s.getFullYear(),s.getMonth()!==
e)}
for(var t=0;7>t;t++)q[t]=c(p[t].date,i.dayHeader);
return{
objects:p,title:c(a,i.dayTitle),labels:q}},compare:
function(a,b){
return new Date(a.getFullYear(),a.getMonth(),a.getDate())-
new Date(b.getFullYear(),b.getMonth(),b.getDate())},split:7,
step:{months:1}},{
name:
"month",getVisibleDates:
function(a,b){
for(var
d=
new Array(12),
e=a.getFullYear(),
f=0;12>
f;
f++){var
g=
new Date(
e,
f,1);
d[
f]=
h(g,i.month,b&&b.getMonth()===
f&&b.getFullYear()===
e)}
return{
objects:
d,title:c(a,i.monthTitle)}},compare:
function(a,b){
return new Date(a.getFullYear(),a.getMonth())-
new Date(b.getFullYear(),b.getMonth())},split:3,
step:{years:1}},{
name:
"year",getVisibleDates:
function(a,b){
for(var c=
new Array(k),
d=a.getFullYear(),
e=parseInt((
d-1)/k,10)*k+1,
f=0;k>
f;f++){var
g=
new Date(
e+f,0,1);c[
f]=
h(g,i.year,b&&b.getFullYear()===g.getFullYear())}
return{
objects:c,title:[c[0].label,c[k-1].label].join(
" - ")}},compare:
function(a,b){
return a.getFullYear()-b.getFullYear()},split:5,
step:{years:k}}],this.isDisabled=
function(b,c){var
d=this.modes[c||0];
return this.minDate&&d.compare(b,this.minDate)<0||this.maxDate&&d.compare(b,this.maxDate)>0||a.dateDisabled&&a.dateDisabled({date:b,mode:d.name})}}]).directive(
"datepicker",[
"dateFilter",
"$parse",
"datepickerConfig",
"$log",
function(a,b,c,
d){
return{restrict:
"EA",replace:!0,templateUrl:
"template/datepicker/datepicker.html",scope:{dateDisabled:
"&"},require:[
"datepicker",
"?^ngModel"],
controller:
"DatepickerController",link:
function(a,
e,
f,
g){
function h(){a.showWeekNumbers=0===o&&q}
function i(a,b){
for(var c=[];a.length>0;)c.push(a.splice(0,b));
return c}
function j(b){var c=null,e=!0;n.$modelValue&&(c=
new Date(n.$modelValue),isNaN(c)?(e=!1,
d.error(
'Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):b&&(p=c)),n.$setValidity(
"date",e);var f=m.modes[o],
g=f.getVisibleDates(p,c);angular.forEach(
g.objects,
function(a){a.disabled=m.isDisabled(a.date,o)}),n.$setValidity(
"date-disabled",!c||!m.isDisabled(c)),a.rows=i(
g.objects,f.split),a.labels=
g.labels||[],a.title=
g.title}
function k(a){o=a,
h(),j()}
function l(a){var b=
new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();
return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}var m=
g[0],n=
g[1];
if(n){var o=0,p=
new Date,q=c.showWeeks;f.showWeeks?a.$parent.$watch(b(f.showWeeks),
function(a){q=!!a,h()}):
h(),f.min&&a.$parent.$watch(b(f.min),
function(a){m.minDate=a?new Date(a):null,j()}),f.max&&a.$parent.$watch(b(f.max),
function(a){m.maxDate=a?new Date(a):null,j()}),n.$render=
function(){j(!0)},a.select=
function(a){
if(0===o){var b=
new Date(n.$modelValue);b.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()),n.$setViewValue(b),j(!0)}
else p=a,k(o-1)},a.move=
function(a){var b=m.modes[o].step;p.setMonth(p.getMonth()+a*(b.months||0)),p.setFullYear(p.getFullYear()+a*(b.years||0)),j()},a.toggleMode=
function(){k((o+1)%m.modes.length)},a.getWeekNumber=
function(b){
return 0===o&&a.showWeekNumbers&&7===b.length?l(b[0].date):null}}}}}]).constant(
"datepickerPopupConfig",{dateFormat:
"yyyy-MM-dd",currentText:
"Today",toggleWeeksText:
"Weeks",clearText:
"Clear",closeText:
"Done",closeOnDateSelection:!0,appendToBody:!1}).
directive(
"datepickerPopup",[
"$compile",
"$parse",
"$document",
"$position",
"dateFilter",
"datepickerPopupConfig",
"datepickerConfig",
function(a,b,c,
d,
e,
f,
g){
return{restrict:
"EA",require:
"ngModel",link:
function(
h,i,j,k){
function l(a){
v?
v(
h,!!a):t.isOpen=!!a}
function m(a){
if(a){
if(angular.isDate(a))
return k.$setValidity(
"date",!0),a;
if(angular.isString(a)){var b=
new Date(a);
return isNaN(b)?(k.$setValidity(
"date",!1),
void 0):(k.$setValidity(
"date",!0),b)}
return k.$setValidity(
"date",!1),
void 0}
return k.$setValidity(
"date",!0),null}
function n(){t.date=k.$modelValue,p()}
function o(a,c,
d){a&&(
h.$watch(b(a),
function(a){t[c]=a}),
z.attr(
d||c,c))}
function p(){t.position=
s?
d.offset(i):
d.position(i),t.position.top=t.position.top+i.prop(
"offsetHeight")}var q;j.$observe(
"datepickerPopup",
function(a){q=a||
f.dateFormat,k.$render()});var r=angular.isDefined(j.closeOnDateSelection)?
h.$eval(j.closeOnDateSelection):
f.closeOnDateSelection,
s=angular.isDefined(j.datepickerAppendToBody)?
h.$eval(j.datepickerAppendToBody):
f.appendToBody,t=
h.$new();
h.$on(
"$destroy",
function(){t.$destroy()}),j.$observe(
"currentText",
function(a){t.currentText=angular.isDefined(a)?a:f.currentText}),j.$observe(
"toggleWeeksText",
function(a){t.toggleWeeksText=angular.isDefined(a)?a:
f.toggleWeeksText}),j.$observe(
"clearText",
function(a){t.clearText=angular.isDefined(a)?a:f.clearText}),j.$observe(
"closeText",
function(a){t.closeText=angular.isDefined(a)?a:
f.closeText});var u,
v;j.isOpen&&(u=b(j.isOpen),v=u.assign,
h.$watch(u,
function(a){t.isOpen=!!a})),t.isOpen=u?u(
h):!1;var
w=
function(a){t.isOpen&&a.target!==i[0]&&t.$apply(
function(){l(!1)})},x=
function(){t.$apply(
function(){l(!0)})},y=angular.element(
"<div datepicker-popup-wrap><div datepicker></div></div>");y.attr({
"ng-model":
"date",
"ng-change":
"dateSelection()"});var
z=angular.element(y.children()[0]);j.datepickerOptions&&z.attr(angular.extend({},
h.$eval(j.datepickerOptions))),k.$parsers.unshift(m),t.dateSelection=
function(){k.$setViewValue(t.date),k.$render(),r&&l(!1)},i.bind(
"input change keyup",
function(){t.$apply(
function(){n()})}),k.$render=
function(){var a=k.$viewValue?
e(k.$viewValue,q):
"";i.val(a),n()},o(j.min,
"min"),o(j.max,
"max"),j.showWeeks?o(j.showWeeks,
"showWeeks",
"show-weeks"):(t.showWeeks=
g.showWeeks,z.attr(
"show-weeks",
"showWeeks")),j.dateDisabled&&z.attr(
"date-disabled",j.dateDisabled);var A=!1,B=!1;t.$watch(
"isOpen",
function(a){a?(p(),c.bind(
"click",w),B&&i.unbind(
"focus",x),i[0].focus(),A=!0):(A&&c.unbind(
"click",w),i.bind(
"focus",x),B=!0),v&&
v(
h,a)});var C=b(j.ngModel).assign;t.today=
function(){C(
h,
new Date)},t.clear=
function(){C(
h,null)};var D=a(y)(t);
s?c.find(
"body").append(D):i.after(D)}}}]).
directive(
"datepickerPopupWrap",
function(){
return{restrict:
"EA",replace:!0,transclude:!0,templateUrl:
"template/datepicker/popup.html",link:
function(a,b){b.bind(
"click",
function(a){a.preventDefault(),a.stopPropagation()})}}}),angular.module(
"ui.bootstrap.dropdownToggle",[]).directive(
"dropdownToggle",[
"$document",
"$location",
function(a){var b=null,c=angular.noop;
return{restrict:
"CA",link:
function(
d,
e){
d.$watch(
"$location.path",
function(){c()}),
e.parent().bind(
"click",
function(){c()}),
e.bind(
"click",
function(
d){var f=e===b;d.preventDefault(),d.stopPropagation(),b&&c(),f||e.hasClass(
"disabled")||e.prop(
"disabled")||(e.parent().addClass(
"open"),b=e,c=function(d){d&&(d.preventDefault(),d.stopPropagation()),a.unbind(
"click",c),e.parent().removeClass(
"open"),c=angular.noop,b=null},a.bind(
"click",c))})}}}]),angular.module(
"ui.bootstrap.modal",[]).factory(
"$$stackedMap",
function(){
return{createNew:
function(){var a=[];
return{add:
function(b,c){a.push({key:b,value:c})},
get:
function(b){
for(var c=0;c<a.length;c++)
if(b==a[c].key)
return a[c]},keys:
function(){
for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);
return b},top:
function(){
return a[a.length-1]},
remove:
function(b){
for(var c=-1,
d=0;
d<a.length;
d++)
if(b==a[
d].key){c=
d;
break}
return a.splice(c,1)[0]},removeTop:
function(){
return a.splice(a.length-1,1)[0]},length:
function(){
return a.length}}}}}).
directive(
"modalBackdrop",[
"$modalStack",
"$timeout",
function(a,b){
return{restrict:
"EA",replace:!0,templateUrl:
"template/modal/backdrop.html",link:
function(c){b(
function(){c.animate=!0}),c.close=
function(b){var c=a.getTop();c&&c.value.backdrop&&
"static"!=c.value.backdrop&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,
"backdrop click"))}}}}]).directive(
"modalWindow",[
"$timeout",
function(a){
return{restrict:
"EA",scope:{index:
"@"},replace:!0,transclude:!0,templateUrl:
"template/modal/window.html",link:
function(b,c,
d){b.windowClass=
d.windowClass||
"",a(
function(){b.animate=!0})}}}]).factory(
"$modalStack",[
"$document",
"$compile",
"$rootScope",
"$$stackedMap",
function(a,b,c,
d){
function e(){
for(var a=-1,b=k.keys(),c=0;c<b.length;c++)k.get(b[c]).value.backdrop&&(a=c);
return a}
function f(a){var b=k.get(a).value;k.remove(a),b.modalDomEl.remove(),
h&&-1==
e()&&(
h.remove(),
h=
void 0),b.modalScope.$destroy()}var
g,
h,i=c.$new(!0),j=a.find(
"body").eq(0),k=
d.createNew(),l={};
return c.$watch(
e,
function(a){i.index=a}),a.bind(
"keydown",
function(a){var b;27===a.which&&(b=k.top(),b&&b.value.keyboard&&c.$apply(function(){l.dismiss(b.key)}))}),l.open=
function(a,c){k.add(a,{deferred:c.deferred,modalScope:c.scope,backdrop:c.backdrop,keyboard:c.keyboard});var
d=angular.element(
"<div modal-window></div>");d.attr(
"window-class",c.windowClass),d.attr(
"index",k.length()-1),d.html(c.content);var
f=b(d)(c.scope);k.top().value.modalDomEl=
f,j.append(f),
e()>=0&&!
h&&(
g=angular.element(
"<div modal-backdrop></div>"),
h=b(g)(i),j.append(
h))},l.close=
function(a,b){var c=k.get(a);c&&(c.value.deferred.resolve(b),
f(a))},l.dismiss=
function(a,b){var c=k.get(a).value;c&&(c.deferred.reject(b),
f(a))},l.getTop=
function(){
return k.top()},l}]).provider(
"$modal",
function(){var a={options:{backdrop:!0,keyboard:!0},$get:[
"$injector",
"$rootScope",
"$q",
"$http",
"$templateCache",
"$controller",
"$modalStack",
function(b,c,
d,
e,
f,
g,
h){
function i(a){
return a.template?d.when(a.template):e.get(a.templateUrl,{cache:f}).then(
function(a){
return a.data})}
function j(a){var c=[];
return angular.forEach(a,
function(a){(angular.isFunction(a)||angular.isArray(a))&&c.push(d.when(b.invoke(a)))}),c}var k={};
return k.open=
function(b){var e=d.defer(),f=d.defer(),k={result:e.promise,opened:f.promise,close:
function(a){
h.close(k,a)},dismiss:
function(a){
h.dismiss(k,a)}};
if(b=angular.extend({},a.options,b),b.resolve=b.resolve||{},!b.template&&!b.templateUrl)
throw new Error(
"One of template or templateUrl options is required.");var l=d.all([i(b)].concat(j(b.resolve)));
return l.then(
function(a){var d=(b.scope||c).$new();d.$close=k.close,d.$dismiss=k.dismiss;var
f,i={},j=1;b.controller&&(i.$scope=
d,i.$modalInstance=k,angular.forEach(b.resolve,
function(b,c){i[c]=a[j++]}),f=
g(b.controller,i)),
h.open(k,{scope:d,deferred:e,content:a[0],backdrop:b.backdrop,keyboard:b.keyboard,windowClass:b.windowClass})},
function(a){e.reject(a)}),l.then(
function(){f.resolve(!0)},
function(){f.reject(!1)}),k},k}]};
return a}),angular.module(
"ui.bootstrap.pagination",[]).controller(
"PaginationController",[
"$scope",
"$attrs",
"$parse",
"$interpolate",
function(a,b,c,
d){var
e=
this,
f=b.numPages?c(b.numPages).assign:angular.noop;this.init=
function(
d){b.itemsPerPage?a.$parent.$watch(c(b.itemsPerPage),
function(b){e.itemsPerPage=parseInt(b,10),a.totalPages=e.calculateTotalPages()}):this.itemsPerPage=
d},this.noPrevious=
function(){
return 1===this.page},this.noNext=
function(){
return this.page===a.totalPages},this.isActive=
function(a){
return this.page===a},this.calculateTotalPages=
function(){var b=this.itemsPerPage<1?1:Math.ceil(a.totalItems/
this.itemsPerPage);
return Math.max(b||0,1)},this.getAttributeValue=
function(b,c,
e){
return angular.isDefined(b)?e?
d(b)(a.$parent):a.$parent.$eval(b):c},this.render=
function(){this.page=parseInt(a.page,10)||1,this.page>0&&this.page<=a.totalPages&&(a.pages=this.getPages(this.page,a.totalPages))},a.selectPage=
function(b){!e.isActive(b)&&b>0&&b<=a.totalPages&&(a.page=b,a.onSelectPage({page:b}))},a.$watch(
"page",
function(){e.render()}),a.$watch(
"totalItems",
function(){a.totalPages=e.calculateTotalPages()}),a.$watch(
"totalPages",
function(b){
f(a.$parent,b),e.page>b?a.selectPage(b):e.render()})}]).constant(
"paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:
"First",previousText:
"Previous",nextText:
"Next",lastText:
"Last",rotate:!0}).
directive(
"pagination",[
"$parse",
"paginationConfig",
function(a,b){
return{restrict:
"EA",scope:{page:
"=",totalItems:
"=",onSelectPage:
" &"},
controller:
"PaginationController",templateUrl:
"template/pagination/pagination.html",replace:!0,link:
function(c,
d,
e,
f){
function g(a,b,c,d){
return{number:a,text:b,active:c,disabled:d}}var
h,i=
f.getAttributeValue(e.boundaryLinks,b.boundaryLinks),j=
f.getAttributeValue(e.directionLinks,b.directionLinks),k=
f.getAttributeValue(e.firstText,b.firstText,!0),l=
f.getAttributeValue(e.previousText,b.previousText,!0),m=
f.getAttributeValue(e.nextText,b.nextText,!0),n=
f.getAttributeValue(e.lastText,b.lastText,!0),o=
f.getAttributeValue(e.rotate,b.rotate);
f.init(b.itemsPerPage),e.maxSize&&c.$parent.$watch(a(e.maxSize),
function(a){h=parseInt(a,10),f.render()}),
f.getPages=
function(a,b){var c=[],d=1,e=b,p=angular.isDefined(h)&&b>
h;p&&(o?(d=Math.max(a-Math.floor(h/2),1),e=d+h-1,e>b&&(e=b,d=e-h+1)):(d=(Math.ceil(a/h)-1)*h+1,e=Math.min(d+h-1,b)));
for(var q=d;e>=q;q++){var r=
g(q,q,
f.isActive(q),!1);c.push(r)}
if(p&&!o){
if(d>1){var
s=
g(d-1,
"...",!1,!1);c.unshift(s)}
if(b>e){var t=
g(e+1,
"...",!1,!1);c.push(t)}}
if(j){var u=
g(a-1,l,!1,
f.noPrevious());c.unshift(u);var
v=
g(a+1,m,!1,
f.noNext());c.push(v)}
if(i){var
w=
g(1,k,!1,
f.noPrevious());c.unshift(w);var x=
g(b,n,!1,
f.noNext());c.push(x)}
return c}}}}]).constant(
"pagerConfig",{itemsPerPage:10,previousText:
"« Previous",nextText:
"Next »",align:!0}).
directive(
"pager",[
"pagerConfig",
function(a){
return{restrict:
"EA",scope:{page:
"=",totalItems:
"=",onSelectPage:
" &"},
controller:
"PaginationController",templateUrl:
"template/pagination/pager.html",replace:!0,link:
function(b,c,
d,
e){
function f(a,b,c,d,
e){
return{number:a,text:b,disabled:c,previous:i&&
d,next:i&&
e}}var
g=
e.getAttributeValue(d.previousText,a.previousText,!0),
h=
e.getAttributeValue(d.nextText,a.nextText,!0),i=
e.getAttributeValue(d.align,a.align);
e.init(a.itemsPerPage),
e.getPages=
function(a){
return[
f(a-1,g,
e.noPrevious(),!0,!1),
f(a+1,
h,
e.noNext(),!1,!0)]}}}}]),angular.module(
"ui.bootstrap.tooltip",[
"ui.bootstrap.position",
"ui.bootstrap.bindHtml"]).provider(
"$tooltip",
function(){
function a(a){var b=/[A-Z]/
g,c=
"-";
return a.replace(b,
function(a,b){
return(b?c:
"")+a.toLowerCase()})}var b={placement:
"top",
animation:!0,popupDelay:0},c={mouseenter:
"mouseleave",click:
"click",focus:
"blur"},
d={};this.options=
function(a){angular.extend(
d,a)},this.setTriggers=
function(a){angular.extend(c,a)},this.$get=[
"$window",
"$compile",
"$timeout",
"$parse",
"$document",
"$position",
"$interpolate",
function(
e,
f,
g,
h,i,j,k){
return function(
e,l,m){
function n(a){var b=a||o.trigger||m,
d=c[b]||b;
return{show:b,hide:d}}var o=angular.extend({},b,
d),p=a(
e),q=k.startSymbol(),r=k.endSymbol(),
s=
"<"+p+
'-popup title="'+q+
"tt_title"+r+
'" content="'+q+
"tt_content"+r+
'" placement="'+q+
"tt_placement"+r+
'" animation="tt_animation" is-open="tt_isOpen"></'+p+
"-popup>";
return{restrict:
"EA",scope:!0,link:
function(a,b,c){
function d(){a.tt_isOpen?m():k()}
function k(){(!
z||a.$eval(c[l+
"Enable"]))&&(a.tt_popupDelay?t=g(p,a.tt_popupDelay):a.$apply(p))}
function m(){a.$apply(
function(){q()})}
function p(){var c,
d,
e,
f;
if(a.tt_content){
switch(r&&g.cancel(r),u.css({top:0,left:0,display:
"block"}),
w?
v.append(u):b.after(u),c=
w?j.offset(b):j.position(b),d=u.prop(
"offsetWidth"),e=u.prop(
"offsetHeight"),a.tt_placement){
case"right":f={top:c.top+c.height/2-e/2,left:c.left+c.width};
break;
case"bottom":f={top:c.top+c.height,left:c.left+c.width/2-d/2};
break;
case"left":f={top:c.top+c.height/2-e/2,left:c.left-d};
break;
default:f={top:c.top-
e,left:c.left+c.width/2-d/2}}f.top+=
"px",f.left+=
"px",u.css(f),a.tt_isOpen=!0}}
function q(){a.tt_isOpen=!1,g.cancel(t),a.tt_animation?r=
g(
function(){u.remove()},500):u.remove()}var r,t,u=
f(
s)(a),
v=i.find(
"body"),
w=angular.isDefined(o.appendToBody)?o.appendToBody:!1,x=n(
void 0),y=!1,
z=angular.isDefined(c[l+
"Enable"]);a.tt_isOpen=!1,c.$observe(
e,
function(b){b?a.tt_content=b:a.tt_isOpen&&q()}),c.$observe(l+
"Title",
function(b){a.tt_title=b}),c.$observe(l+
"Placement",
function(b){a.tt_placement=angular.isDefined(b)?b:o.placement}),c.$observe(l+
"Animation",
function(b){a.tt_animation=angular.isDefined(b)?!!b:o.animation}),c.$observe(l+
"PopupDelay",
function(b){var c=parseInt(b,10);a.tt_popupDelay=isNaN(c)?o.popupDelay:c}),c.$observe(l+
"Trigger",
function(a){y&&(b.unbind(x.show,k),b.unbind(x.hide,m)),x=n(a),x.show===x.hide?b.bind(x.show,d):(b.bind(x.show,k),b.bind(x.hide,m)),y=!0}),c.$observe(l+
"AppendToBody",
function(b){
w=angular.isDefined(b)?
h(b)(a):
w}),
w&&a.$on(
"$locationChangeSuccess",
function(){a.tt_isOpen&&q()}),a.$on(
"$destroy",
function(){g.cancel(t),u.remove(),u.unbind(),u=null,v=null})}}}}]}).
directive(
"tooltipPopup",
function(){
return{restrict:
"E",replace:!0,scope:{content:
"@",placement:
"@",
animation:
"&",isOpen:
"&"},templateUrl:
"template/tooltip/tooltip-popup.html"}}).
directive(
"tooltip",[
"$tooltip",
function(a){
return a(
"tooltip",
"tooltip",
"mouseenter")}]).
directive(
"tooltipHtmlUnsafePopup",
function(){
return{restrict:
"E",replace:!0,scope:{content:
"@",placement:
"@",
animation:
"&",isOpen:
"&"},templateUrl:
"template/tooltip/tooltip-html-unsafe-popup.html"}}).
directive(
"tooltipHtmlUnsafe",[
"$tooltip",
function(a){
return a(
"tooltipHtmlUnsafe",
"tooltip",
"mouseenter")}]),angular.module(
"ui.bootstrap.popover",[
"ui.bootstrap.tooltip"]).directive(
"popoverPopup",
function(){
return{restrict:
"EA",replace:!0,scope:{title:
"@",content:
"@",placement:
"@",
animation:
"&",isOpen:
"&"},templateUrl:
"template/popover/popover.html"}}).
directive(
"popover",[
"$compile",
"$timeout",
"$parse",
"$window",
"$tooltip",
function(a,b,c,
d,
e){
return e(
"popover",
"popover",
"click")}]),angular.module(
"ui.bootstrap.progressbar",[
"ui.bootstrap.transition"]).constant(
"progressConfig",{animate:!0,autoType:!1,stackedTypes:[
"success",
"info",
"warning",
"danger"]}).
controller(
"ProgressBarController",[
"$scope",
"$attrs",
"progressConfig",
function(a,b,c){
function d(a){
return g[a]}var
e=angular.isDefined(b.animate)?a.$eval(b.animate):c.animate,
f=angular.isDefined(b.autoType)?a.$eval(b.autoType):c.autoType,
g=angular.isDefined(b.stackedTypes)?a.$eval(
"["+b.stackedTypes+
"]"):c.stackedTypes;this.makeBar=
function(a,b,c){var
g=angular.isObject(a)?a.value:a||0,
h=angular.isObject(b)?b.value:b||0,i=angular.isObject(a)&&angular.isDefined(a.type)?a.type:
f?
d(c||0):null;
return{from:
h,to:
g,type:i,animate:e}},this.addBar=
function(b){a.bars.push(b),a.totalPercent+=b.to},this.clearBars=
function(){a.bars=[],a.totalPercent=0},this.clearBars()}]).
directive(
"progress",
function(){
return{restrict:
"EA",replace:!0,
controller:
"ProgressBarController",scope:{value:
"=percent",onFull:
"&",onEmpty:
"&"},templateUrl:
"template/progressbar/progress.html",link:
function(a,b,c,
d){a.$watch(
"value",
function(a,b){
if(
d.clearBars(),angular.isArray(a))
for(var c=0,
e=a.length;
e>c;c++)
d.addBar(
d.makeBar(a[c],b[c],c));
else d.addBar(
d.makeBar(a,b))},!0),a.$watch(
"totalPercent",
function(b){b>=100?a.onFull():0>=b&&a.onEmpty()},!0)}}}).directive(
"progressbar",[
"$transition",
function(a){
return{restrict:
"EA",replace:!0,scope:{
width:
"=",old:
"=",type:
"=",animate:
"="},templateUrl:
"template/progressbar/bar.html",link:
function(b,c){b.$watch(
"width",
function(
d){b.animate?(c.css(
"width",b.old+
"%"),a(c,{
width:
d+
"%"})):c.css(
"width",
d+
"%")})}}}]),angular.module(
"ui.bootstrap.rating",[]).constant(
"ratingConfig",{max:5,stateOn:null,stateOff:null}).
controller(
"RatingController",[
"$scope",
"$attrs",
"$parse",
"ratingConfig",
function(a,b,c,
d){this.maxRange=angular.isDefined(b.max)?a.$parent.$eval(b.max):
d.max,this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):
d.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):
d.stateOff,this.createRateObjects=
function(a){
for(var b={stateOn:this.stateOn,stateOff:this.stateOff},c=0,
d=a.length;
d>c;c++)a[c]=angular.extend({index:c},b,a[c]);
return a},a.range=angular.isDefined(b.ratingStates)?this.createRateObjects(angular.copy(a.$parent.$eval(b.ratingStates))):this.createRateObjects(
new Array(this.maxRange)),a.rate=
function(b){a.readonly||a.value===b||(a.value=b)},a.enter=
function(b){a.readonly||(a.val=b),a.onHover({value:b})},a.reset=
function(){a.val=angular.copy(a.value),a.onLeave()},a.$watch(
"value",
function(b){a.val=b}),a.readonly=!1,b.readonly&&a.$parent.$watch(c(b.readonly),
function(b){a.readonly=!!b})}]).
directive(
"rating",
function(){
return{restrict:
"EA",scope:{value:
"=",onHover:
"&",onLeave:
"&"},
controller:
"RatingController",templateUrl:
"template/rating/rating.html",replace:!0}}),angular.module(
"ui.bootstrap.tabs",[]).directive(
"tabs",
function(){
return function(){
throw new Error(
"The `tabs` directive is deprecated, please migrate to `tabset`. Instructions can be found at http://github.com/angular-ui/bootstrap/tree/master/CHANGELOG.md")}}).
controller(
"TabsetController",[
"$scope",
function(a){var b=
this,c=b.tabs=a.tabs=[];b.select=
function(a){angular.forEach(c,
function(a){a.active=!1}),a.active=!0},b.addTab=
function(a){c.push(a),(1===c.length||a.active)&&b.select(a)},b.removeTab=
function(a){var
d=c.indexOf(a);
if(a.active&&c.length>1){var
e=d==c.length-1?d-1:d+1;b.select(c[e])}c.splice(d,1)}}]).
directive(
"tabset",
function(){
return{restrict:
"EA",transclude:!0,replace:!0,require:
"^tabset",scope:{},
controller:
"TabsetController",templateUrl:
"template/tabs/tabset.html",compile:
function(a,b,c){
return function(a,b,
d,
e){a.vertical=angular.isDefined(d.vertical)?a.$parent.$eval(d.vertical):!1,a.type=angular.isDefined(d.type)?a.$parent.$eval(d.type):
"tabs",a.direction=angular.isDefined(d.direction)?a.$parent.$eval(d.direction):
"top",a.tabsAbove=
"below"!=a.direction,
e.$scope=a,
e.$transcludeFn=c
2 }}}}).
directive(
"tab",[
"$parse",
function(a){
return{require:
"^tabset",restrict:
"EA",replace:!0,templateUrl:
"template/tabs/tab.html",transclude:!0,scope:{heading:
"@",onSelect:
"&select",onDeselect:
"&deselect"},
controller:
function(){},compile:
function(b,c,
d){
return function(b,c,
e,
f){var
g,
h;e.active?(g=a(e.active),h=g.assign,b.$parent.$watch(g,
function(a,c){a!==c&&(b.active=!!a)}),b.active=
g(b.$parent)):h=g=angular.noop,b.$watch(
"active",
function(a){h(b.$parent,a),a?(f.select(b),b.onSelect()):b.onDeselect()}),b.disabled=!1,e.disabled&&b.$parent.$watch(a(e.disabled),
function(a){b.disabled=!!a}),b.select=
function(){b.disabled||(b.active=!0)},
f.addTab(b),b.$on(
"$destroy",
function(){
f.removeTab(b)}),b.$transcludeFn=
d}}}}]).
directive(
"tabHeadingTransclude",[
function(){
return{restrict:
"A",require:
"^tab",link:
function(a,b){a.$watch(
"headingElement",
function(a){a&&(b.html(
""),b.append(a))})}}}]).
directive(
"tabContentTransclude",
function(){
function a(a){
return a.tagName&&(a.hasAttribute(
"tab-heading")||a.hasAttribute(
"data-tab-heading")||
"tab-heading"===a.tagName.toLowerCase()||
"data-tab-heading"===a.tagName.toLowerCase())}
return{restrict:
"A",require:
"^tabset",link:
function(b,c,
d){var
e=b.$eval(
d.tabContentTransclude);e.$transcludeFn(e.$parent,
function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}).directive(
"tabsetTitles",
function(){
return{restrict:
"A",require:
"^tabset",templateUrl:
"template/tabs/tabset-titles.html",replace:!0,link:
function(a,b,c,
d){a.$eval(c.tabsetTitles)?
d.$transcludeFn(
d.$scope.$parent,
function(a){b.append(a)}):b.remove()}}}),angular.module(
"ui.bootstrap.timepicker",[]).constant(
"timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:[
"AM",
"PM"],readonlyInput:!1,mousewheel:!0}).
directive(
"timepicker",[
"$parse",
"$log",
"timepickerConfig",
function(a,b,c){
return{restrict:
"EA",require:
"?^ngModel",replace:!0,scope:{},templateUrl:
"template/timepicker/timepicker.html",link:
function(
d,
e,
f,
g){
function h(){var a=parseInt(
d.hours,10),b=
d.showMeridian?a>0&&13>a:a>=0&&24>a;
return b?(
d.showMeridian&&(12===a&&(a=0),
d.meridian===p[1]&&(a+=12)),a):
void 0}
function i(){var a=parseInt(
d.minutes,10);
return a>=0&&60>a?a:
void 0}
function j(a){
return angular.isDefined(a)&&a.toString().length<2?
"0"+a:a}
function k(a){l(),
g.$setViewValue(
new Date(o)),m(a)}
function l(){
g.$setValidity(
"time",!0),
d.invalidHours=!1,
d.invalidMinutes=!1}
function m(a){var b=o.getHours(),c=o.getMinutes();
d.showMeridian&&(b=0===b||12===b?12:b%12),
d.hours=
"h"===a?b:j(b),
d.minutes=
"m"===a?c:j(c),
d.meridian=o.getHours()<12?p[0]:p[1]}
function n(a){var b=
new Date(o.getTime()+6e4*a);o.setHours(b.getHours(),b.getMinutes()),k()}
if(
g){var o=
new Date,p=c.meridians,q=c.hourStep;f.hourStep&&
d.$parent.$watch(a(f.hourStep),
function(a){q=parseInt(a,10)});var r=c.minuteStep;f.minuteStep&&
d.$parent.$watch(a(f.minuteStep),
function(a){r=parseInt(a,10)}),
d.showMeridian=c.showMeridian,f.showMeridian&&
d.$parent.$watch(a(f.showMeridian),
function(a){if(d.showMeridian=!!a,g.$error.time){var b=h(),c=i();angular.isDefined(b)&&angular.isDefined(c)&&(o.setHours(b),k())}
else m()});var
s=e.find(
"input"),t=s.eq(0),u=s.eq(1),
v=angular.isDefined(f.mousewheel)?
d.$eval(f.mousewheel):c.mousewheel;
if(
v){var
w=
function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;
return a.detail||b>0};t.bind(
"mousewheel wheel",
function(a){
d.$apply(
w(a)?
d.incrementHours():
d.decrementHours()),a.preventDefault()}),u.bind(
"mousewheel wheel",
function(a){d.$apply(w(a)?d.incrementMinutes():d.decrementMinutes()),a.preventDefault()})}
if(
d.readonlyInput=angular.isDefined(f.readonlyInput)?
d.$eval(f.readonlyInput):c.readonlyInput,
d.readonlyInput)
d.updateHours=angular.noop,
d.updateMinutes=angular.noop;
else{var x=
function(a,b){
g.$setViewValue(null),
g.$setValidity(
"time",!1),angular.isDefined(a)&&(
d.invalidHours=a),angular.isDefined(b)&&(
d.invalidMinutes=b)};
d.updateHours=
function(){var a=
h();angular.isDefined(a)?(o.setHours(a),k(
"h")):x(!0)},t.bind(
"blur",
function(){!
d.validHours&&
d.hours<10&&
d.$apply(
function(){
d.hours=j(
d.hours)})}),
d.updateMinutes=
function(){var a=i();angular.isDefined(a)?(o.setMinutes(a),k(
"m")):x(
void 0,!0)},u.bind(
"blur",
function(){!
d.invalidMinutes&&
d.minutes<10&&
d.$apply(
function(){
d.minutes=j(
d.minutes)})})}
g.$render=
function(){var a=
g.$modelValue?
new Date(
g.$modelValue):null;isNaN(a)?(
g.$setValidity(
"time",!1),b.error(
'Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(a&&(o=a),l(),m())},
d.incrementHours=
function(){n(60*q)},
d.decrementHours=
function(){n(60*-q)},
d.incrementMinutes=
function(){n(r)},
d.decrementMinutes=
function(){n(-r)},
d.toggleMeridian=
function(){n(720*(o.getHours()<12?1:-1))}}}}}]),angular.module(
"ui.bootstrap.typeahead",[
"ui.bootstrap.position",
"ui.bootstrap.bindHtml"]).factory(
"typeaheadParser",[
"$parse",
function(a){var b=/^
\s*(.*?)(?:\
s+as\
s+(.*?))?
\s+
for\s+(?:([\$
\w][\$
\w\d]*))
\s+
in\s+(.*)$/;
return{parse:
function(c){var
d=c.match(b);
if(!d)
throw new Error(
"Expected typeahead specification in form of '_modelValue_ (as _label_)? for _item_ in _collection_' but got '"+c+
"'.");
return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).
directive(
"typeahead",[
"$compile",
"$parse",
"$q",
"$timeout",
"$document",
"$position",
"typeaheadParser",
function(a,b,c,
d,
e,
f,
g){var
h=[9,13,27,38,40];
return{require:
"ngModel",link:
function(i,j,k,l){var m,n=i.$eval(k.typeaheadMinLength)||1,o=i.$eval(k.typeaheadWaitMs)||0,p=i.$eval(k.typeaheadEditable)!==!1,q=b(k.typeaheadLoading).assign||angular.noop,r=b(k.typeaheadOnSelect),
s=k.typeaheadInputFormatter?b(k.typeaheadInputFormatter):
void 0,t=b(k.ngModel).assign,u=
g.parse(k.typeahead),
v=angular.element(
"<div typeahead-popup></div>");
v.attr({matches:
"matches",active:
"activeIdx",select:
"select(activeIdx)",
query:
"query",position:
"position"}),angular.isDefined(k.typeaheadTemplateUrl)&&
v.attr(
"template-url",k.typeaheadTemplateUrl);var
w=i.$new();i.$on(
"$destroy",
function(){w.$destroy()});var x=
function(){w.matches=[],w.activeIdx=-1},y=
function(a){var b={$viewValue:a};q(i,!0),c.when(u.source(i,b)).then(
function(c){
if(a===l.$viewValue&&m){
if(c.length>0){w.activeIdx=0,w.matches.length=0;
for(var
d=0;
d<c.length;
d++)b[u.itemName]=c[
d],w.matches.push({label:u.viewMapper(w,b),model:c[d]});w.query=a,w.position=
f.position(j),w.position.top=w.position.top+j.prop(
"offsetHeight")}
else x();q(i,!1)}},
function(){x(),q(i,!1)})};x(),w.query=
void 0;var
z;l.$parsers.unshift(
function(a){
return m=!0,a&&a.length>=n?o>0?(z&&
d.cancel(z),z=
d(
function(){y(a)},o)):y(a):(q(i,!1),x()),p?a:a?(l.$setValidity(
"editable",!1),
void 0):(l.$setValidity(
"editable",!0),a)}),l.$formatters.push(
function(a){var b,c,
d={};
return s?(d.$model=a,
s(i,d)):(d[u.itemName]=a,b=u.viewMapper(i,d),d[u.itemName]=
void 0,c=u.viewMapper(i,d),b!==c?b:a)}),w.select=
function(a){var b,c,
d={};d[u.itemName]=c=w.matches[a].model,b=u.modelMapper(i,d),t(i,b),l.$setValidity(
"editable",!0),r(i,{$item:c,$model:b,$label:u.viewMapper(i,d)}),x(),j[0].focus()},j.bind(
"keydown",
function(a){
return 0===w.matches.length||-1===h.indexOf(a.which)?(13===a.which&&a.preventDefault(),
void 0):(a.preventDefault(),40===a.which?(w.activeIdx=(w.activeIdx+1)%w.matches.length,w.$digest()):38===a.which?(w.activeIdx=(w.activeIdx?w.activeIdx:w.matches.length)-1,w.$digest()):13===a.which||9===a.which?w.$apply(
function(){w.select(w.activeIdx)}):27===a.which&&(a.stopPropagation(),x(),w.$digest()),
void 0)}),j.bind(
"blur",
function(){m=!1});var A=
function(a){j[0]!==a.target&&(x(),w.$digest())};
e.bind(
"click",A),i.$on(
"$destroy",
function(){
e.unbind(
"click",A)}),j.after(a(
v)(w))}}}]).
directive(
"typeaheadPopup",
function(){
return{restrict:
"EA",scope:{matches:
"=",
query:
"=",active:
"=",position:
"=",select:
"&"},replace:!0,templateUrl:
"template/typeahead/typeahead-popup.html",link:
function(a,b,c){a.templateUrl=c.templateUrl,a.isOpen=
function(){
return a.matches.length>0},a.isActive=
function(b){
return a.active==b},a.selectActive=
function(b){a.active=b},a.selectMatch=
function(b){a.select({activeIdx:b})}}}}).directive(
"typeaheadMatch",[
"$http",
"$templateCache",
"$compile",
"$parse",
function(a,b,c,
d){
return{restrict:
"EA",scope:{index:
"=",match:
"=",
query:
"="},link:
function(
e,
f,
g){var
h=
d(
g.templateUrl)(
e.$parent)||
"template/typeahead/typeahead-match.html";a.get(h,{cache:b}).
success(
function(a){f.replaceWith(c(a.trim())(
e))})}}}]).filter(
"typeaheadHighlight",
function(){
function a(a){
return a.replace(/([.?*+^$[\]\\(){}|-])/
g,
"\\$1")}
return function(b,c){
return c?b.replace(
new RegExp(a(c),
"gi"),
"<strong>$&</strong>"):b}}),angular.module(
"template/accordion/accordion-group.html",[]).run([
"$templateCache",
function(a){a.put(
"template/accordion/accordion-group.html",
'<div class="accordion-group">\n <div class="accordion-heading" ><a class="accordion-toggle" ng-click="isOpen = !isOpen" accordion-transclude="heading">{{heading}}</a></div>\n <div class="accordion-body" collapse="!isOpen">\n <div class="accordion-inner" ng-transclude></div> </div>\n</div>')}]),angular.module(
"template/accordion/accordion.html",[]).run([
"$templateCache",
function(a){a.put(
"template/accordion/accordion.html",
'<div class="accordion" ng-transclude></div>')}]),angular.module(
"template/alert/alert.html",[]).run([
"$templateCache",
function(a){a.put(
"template/alert/alert.html",
"<div class='alert' ng-class='type && \"alert-\" + type'>\n <button ng-show='closeable' type='button' class='close' ng-click='close()'>×</button>\n <div ng-transclude></div>\n</div>\n")}]),angular.module(
"template/carousel/carousel.html",[]).run([
"$templateCache",
function(a){a.put(
"template/carousel/carousel.html",
'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel">\n <ol class="carousel-indicators" ng-show="slides().length > 1">\n <li ng-repeat="slide in slides()" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>\n </ol>\n <div class="carousel-inner" ng-transclude></div>\n <a ng-click="prev()" class="carousel-control left" ng-show="slides().length > 1">‹</a>\n <a ng-click="next()" class="carousel-control right" ng-show="slides().length > 1">›</a>\n</div>\n')}]),angular.module(
"template/carousel/slide.html",[]).run([
"$templateCache",
function(a){a.put(
"template/carousel/slide.html",
"<div ng-class=\"{\n 'active': leaving || (active && !entering),\n 'prev': (next || active) && direction=='prev',\n 'next': (next || active) && direction=='next',\n 'right': direction=='prev',\n 'left': direction=='next'\n }\" class=\"item\" ng-transclude></div>\n")}]),angular.module(
"template/datepicker/datepicker.html",[]).run([
"$templateCache",
function(a){a.put(
"template/datepicker/datepicker.html",
'<table>\n <thead>\n <tr class="text-center">\n <th><button type="button" class="btn pull-left" ng-click="move(-1)"><i class="icon-chevron-left"></i></button></th>\n <th colspan="{{rows[0].length - 2 + showWeekNumbers}}"><button type="button" class="btn btn-block" ng-click="toggleMode()"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn pull-right" ng-click="move(1)"><i class="icon-chevron-right"></i></button></th>\n </tr>\n <tr class="text-center" ng-show="labels.length > 0">\n <th ng-show="showWeekNumbers">#</th>\n <th ng-repeat="label in labels">{{label}}</th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows">\n <td ng-show="showWeekNumbers" class="text-center"><em>{{ getWeekNumber(row) }}</em></td>\n <td ng-repeat="dt in row" class="text-center">\n <button type="button" style="width:100%;" class="btn" ng-class="{\'btn-info\': dt.selected}" ng-click="select(dt.date)" ng-disabled="dt.disabled"><span ng-class="{muted: dt.secondary}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module(
"template/datepicker/popup.html",[]).run([
"$templateCache",
function(a){a.put(
"template/datepicker/popup.html",
'<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}">\n <li ng-transclude></li>\n <li class="divider"></li>\n <li style="padding: 9px;">\n <span class="btn-group">\n <button type="button" class="btn btn-small btn-inverse" ng-click="today()">{{currentText}}</button>\n <button type="button" class="btn btn-small btn-info" ng-click="showWeeks = ! showWeeks" ng-class="{active: showWeeks}">{{toggleWeeksText}}</button>\n <button type="button" class="btn btn-small btn-danger" ng-click="clear()">{{clearText}}</button>\n </span>\n <button type="button" class="btn btn-small btn-success pull-right" ng-click="isOpen = false">{{closeText}}</button>\n </li>\n</ul>\n')}]),angular.module(
"template/modal/backdrop.html",[]).run([
"$templateCache",
function(a){a.put(
"template/modal/backdrop.html",
'<div class="modal-backdrop fade" ng-class="{in: animate}" ng-style="{\'z-index\': 1040 + index*10}" ng-click="close($event)"></div>')}]),angular.module(
"template/modal/window.html",[]).run([
"$templateCache",
function(a){a.put(
"template/modal/window.html",
'<div class="modal fade {{ windowClass }}" ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10}" ng-transclude></div>')}]),angular.module(
"template/pagination/pager.html",[]).run([
"$templateCache",
function(a){a.put(
"template/pagination/pager.html",
'<div class="pager">\n <ul>\n <li ng-repeat="page in pages" ng-class="{disabled: page.disabled, previous: page.previous, next: page.next}"><a ng-click="selectPage(page.number)">{{page.text}}</a></li>\n </ul>\n</div>\n')}]),angular.module(
"template/pagination/pagination.html",[]).run([
"$templateCache",
function(a){a.put(
"template/pagination/pagination.html",
'<div class="pagination"><ul>\n <li ng-repeat="page in pages" ng-class="{active: page.active, disabled: page.disabled}"><a ng-click="selectPage(page.number)">{{page.text}}</a></li>\n </ul>\n</div>\n')}]),angular.module(
"template/tooltip/tooltip-html-unsafe-popup.html",[]).run([
"$templateCache",
function(a){a.put(
"template/tooltip/tooltip-html-unsafe-popup.html",
'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n')}]),angular.module(
"template/tooltip/tooltip-popup.html",[]).run([
"$templateCache",
function(a){a.put(
"template/tooltip/tooltip-popup.html",
'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')}]),angular.module(
"template/popover/popover.html",[]).run([
"$templateCache",
function(a){a.put(
"template/popover/popover.html",
'<div class="popover {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n')}]),angular.module(
"template/progressbar/bar.html",[]).run([
"$templateCache",
function(a){a.put(
"template/progressbar/bar.html",
'<div class="bar" ng-class=\'type && "bar-" + type\'></div>')}]),angular.module(
"template/progressbar/progress.html",[]).run([
"$templateCache",
function(a){a.put(
"template/progressbar/progress.html",
'<div class="progress"><progressbar ng-repeat="bar in bars" width="bar.to" old="bar.from" animate="bar.animate" type="bar.type"></progressbar></div>')}]),angular.module(
"template/rating/rating.html",[]).run([
"$templateCache",
function(a){a.put(
"template/rating/rating.html",
'<span ng-mouseleave="reset()">\n <i ng-repeat="r in range" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" ng-class="$index < val && (r.stateOn || \'icon-star\') || (r.stateOff || \'icon-star-empty\')"></i>\n</span>')}]),angular.module(
"template/tabs/tab.html",[]).run([
"$templateCache",
function(a){a.put(
"template/tabs/tab.html",
'<li ng-class="{active: active, disabled: disabled}">\n <a ng-click="select()" tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module(
"template/tabs/tabset-titles.html",[]).run([
"$templateCache",
function(a){a.put(
"template/tabs/tabset-titles.html",
"<ul class=\"nav {{type && 'nav-' + type}}\" ng-class=\"{'nav-stacked': vertical}\">\n</ul>\n")}]),angular.module(
"template/tabs/tabset.html",[]).run([
"$templateCache",
function(a){a.put(
"template/tabs/tabset.html",
'\n<div class="tabbable" ng-class="{\'tabs-right\': direction == \'right\', \'tabs-left\': direction == \'left\', \'tabs-below\': direction == \'below\'}">\n <div tabset-titles="tabsAbove"></div>\n <div class="tab-content">\n <div class="tab-pane" \n ng-repeat="tab in tabs" \n ng-class="{active: tab.active}"\n tab-content-transclude="tab">\n </div>\n </div>\n <div tabset-titles="!tabsAbove"></div>\n</div>\n')}]),angular.module(
"template/timepicker/timepicker.html",[]).run([
"$templateCache",
function(a){a.put(
"template/timepicker/timepicker.html",
'<table class="form-inline">\n <tr class="text-center">\n <td><a ng-click="incrementHours()" class="btn btn-link"><i class="icon-chevron-up"></i></a></td>\n <td> </td>\n <td><a ng-click="incrementMinutes()" class="btn btn-link"><i class="icon-chevron-up"></i></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n <tr>\n <td class="control-group" ng-class="{\'error\': invalidHours}"><input type="text" ng-model="hours" ng-change="updateHours()" class="span1 text-center" ng-mousewheel="incrementHours()" ng-readonly="readonlyInput" maxlength="2"></td>\n <td>:</td>\n <td class="control-group" ng-class="{\'error\': invalidMinutes}"><input type="text" ng-model="minutes" ng-change="updateMinutes()" class="span1 text-center" ng-readonly="readonlyInput" maxlength="2"></td>\n <td ng-show="showMeridian"><button type="button" ng-click="toggleMeridian()" class="btn text-center">{{meridian}}</button></td>\n </tr>\n <tr class="text-center">\n <td><a ng-click="decrementHours()" class="btn btn-link"><i class="icon-chevron-down"></i></a></td>\n <td> </td>\n <td><a ng-click="decrementMinutes()" class="btn btn-link"><i class="icon-chevron-down"></i></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n</table>\n')}]),angular.module(
"template/typeahead/typeahead-match.html",[]).run([
"$templateCache",
function(a){a.put(
"template/typeahead/typeahead-match.html",
'<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>')}]),angular.module(
"template/typeahead/typeahead-popup.html",[]).run([
"$templateCache",
function(a){a.put(
"template/typeahead/typeahead-popup.html",
"<ul class=\"typeahead dropdown-menu\" ng-style=\"{display: isOpen()&&'block' || 'none', top: position.top+'px', left: position.left+'px'}\">\n"+
' <li ng-repeat="match in matches" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)">\n <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>')}]);
App controller('TimelineCtrl', function($scope){$scope.project={fps:{num:24, den:1}, duration:300, scale:16.0, tick_pixels:100, playhead_position:10, clips:[{id: '1', layer:1, image: './media/images/thumbnail.png', locked:false, duration:32, start:0, end:32, position:0.0, title: 'Clip U2V5ENELDY', effects:[{type: 'Saturation', icon: 'bw.png'},{type: 'ChromaKey', icon: 'om.png'},{type: 'Negate', icon: 'neg.png'},{type: 'Blur', icon: 'blur.png'},{type: 'Brightness', icon: 'cartoon.png'}], images:{start:1, end:4}, show_audio:false, alpha:{Points:[{"interpolation":2,"co":{"Y":0,"X":0}},{"interpolation":1,"co":{"Y":0,"X":250}},{"interpolation":1,"co":{"Y":1,"X":500}}]}, location_x:{Points:[]}, location_y:{Points:[]}, scale_x:{Points:[]}, scale_y:{Points:[]}, rotation:{Points:[]}, time:{Points:[]}, volume:{Points:[]}},{id: '2', layer:2, image: './media/images/thumbnail.png', locked:false, duration:45, start:0, end:45, position:0.0, title: 'Clip B', effects:[], images:{start:3, end:7}, show_audio:false, alpha:{Points:[]}, location_x:{Points:[]}, location_y:{Points:[]}, scale_x:{Points:[]}, scale_y:{Points:[]}, rotation:{Points:[]}, time:{Points:[]}, volume:{Points:[]}},{id: '3', layer:3, image: './media/images/thumbnail.png', locked:false, duration:120, start:0, end:120, position:32.0, title: 'Clip C', effects:[{type: 'Deinterlace', icon: 'om.png'},{type: 'Blur', icon: 'blur.png'},{type: 'Mask', icon: 'cartoon.png'}], images:{start:5, end:10}, show_audio:false, audio_data:[.5,.6,.7,.7,.6,.5,.4,.1, 0,-0.1,-0.3,-0.6,-0.6,-0.3,-0.1, 0,.2,.3,.5,.6,.7,.7,.6,.5,.4,.1, 0,-0.1,-0.3,-0.6,-0.6,-0.3,-0.1, 0,.2,.3,.5,.6,.7,.7,.6,.5,.4,.1, 0,-0.1,-0.3,-0.6,-0.6,-0.3,-0.1, 0,.2,.3,.5,.6,.7,.7,.6,.5,.4,.1, 0,-0.1,-0.3,-0.6,-0.6,-0.3,-0.1, 0,.2,.3,.5,.6,.7,.7,.6,.5,.4,.1, 0,-0.1,-0.3,-0.6,-0.6,-0.3,-0.1, 0,.2,.3,.5,.6,.7,.7,.6,.5,.4,.1, 0,-0.1,-0.3,-0.6,-0.6,-0.3,-0.1, 0,.2,.3,.5,.6,.7,.7,.6,.5,.4,.1, 0,-0.1,-0.3,-0.6,-0.6,-0.3,-0.1, 0,.2,.3,.5,.6,.7,.7,.6,.5,.4,.1, 0,-0.1,-0.3,-0.6,-0.6,-0.3,-0.1, 0,.2,.3,.5,.6,.7,.7,.6,.5,.4,.1, 0,-0.1,-0.3,-0.6,-0.6,-0.3,-0.1, 0,.2,.3,], alpha:{Points:[]}, location_x:{Points:[]}, location_y:{Points:[]}, scale_x:{Points:[]}, scale_y:{Points:[]}, rotation:{Points:[]}, time:{Points:[]}, volume:{Points:[]}},], effects:[{id: '5', layer:4, title: 'Transition', position:20.0, start:0, end:30},{id: '6', layer:3, title: 'Transition', position:137.5, start:0, end:30},{id: '7', layer:2, title: 'Transition', position:30.5, start:0, end:30}], layers:[{id: 'L0', number:0, y:0, label: '', lock:false},{id: 'L1', number:1, y:0, label: '', lock:false},{id: 'L2', number:2, y:0, label: '', lock:false},{id: 'L3', number:3, y:0, label: '', lock:false},{id: 'L4', number:4, y:0, label: '', lock:false}], markers:[{id: 'M1', position:16, icon: 'yellow.png'},{id: 'M2', position:120, icon: 'green.png'},{id: 'M3', position:300, icon: 'red.png'},{id: 'M4', position:10, icon: 'purple.png'},], progress:[[0, 30, 'rendering'], [40, 50, 'complete'], [100, 150, 'complete'],]};$scope.pixelsPerSecond=parseFloat($scope.project.tick_pixels)/parseFloat($scope.project.scale);$scope.playheadOffset=0;$scope.keyframePointOffset=3;$scope.playhead_animating=false;$scope.playhead_height=300;$scope.playheadTime=secondsToTime($scope.project.playhead_position, $scope.project.fps.num, $scope.project.fps.den);$scope.shift_pressed=false;$scope.snapline_position=0.0;$scope.snapline=false;$scope.enable_snapping=true;$scope.debug=false;$scope.min_width=1024;$scope.track_label="Track %s";$scope.enable_sorting=true;$scope.Qt=false;$scope.EnableQt=function(){$scope.Qt=true;$scope.project.clips=[];$scope.project.markers=[];$scope.project.effects=[];$scope.project.progress=[];timeline.qt_log("$scope.Qt = true;");};$scope.MovePlayhead=function(position_seconds){$scope.project.playhead_position=position_seconds;$scope.playheadTime=secondsToTime(position_seconds, $scope.project.fps.num, $scope.project.fps.den);$(".playhead-top").css("left",(($scope.project.playhead_position *$scope.pixelsPerSecond)+$scope.playheadOffset)+"px");$(".playhead-line").css("left",(($scope.project.playhead_position *$scope.pixelsPerSecond)+$scope.playheadOffset)+"px");$("#ruler_time").text($scope.playheadTime.hour+":"+$scope.playheadTime.min+":"+$scope.playheadTime.sec+":"+$scope.playheadTime.frame);};$scope.MovePlayheadToFrame=function(position_frames){if($scope.playhead_animating) return;var frames_per_second=$scope.project.fps.num/$scope.project.fps.den;var position_seconds=((position_frames-1)/frames_per_second);$scope.MovePlayhead(position_seconds);};$scope.PreviewFrame=function(position_seconds){var frames_per_second=$scope.project.fps.num/$scope.project.fps.den;var frame=(position_seconds *frames_per_second)+1;if($scope.Qt) timeline.PlayheadMoved(position_seconds, frame, secondsToTime(position_seconds, $scope.project.fps.num, $scope.project.fps.den));};$scope.PreviewClipFrame=function(clip_id, position_seconds){var frames_per_second=$scope.project.fps.num/$scope.project.fps.den;var frame=(position_seconds *frames_per_second)+1;if($scope.Qt) timeline.PreviewClipFrame(clip_id, frame);};$scope.getKeyframes=function(object){keyframes={};var frames_per_second=$scope.project.fps.num/$scope.project.fps.den;var clip_start_x=Math.round(object.start *frames_per_second)+1.0;var clip_end_x=Math.round(object.end *frames_per_second)+1.0;for(child in object){if(!object.hasOwnProperty(child)){continue;}if(typeof object[child]=="object"&&"Points"in object[child]) for(var point=0;point< object[child].Points.length;point++){var co=object[child].Points[point].co;if(co.X >=clip_start_x &&co.X<=clip_end_x) keyframes[co.X]=co.Y;}}if("effects"in object) for(effect in object["effects"]){for(child in object["effects"][effect]){if(!object["effects"][effect].hasOwnProperty(child)){continue;}if(typeof object["effects"][effect][child]=="object"&&"Points"in object["effects"][effect][child]) for(var point=0;point< object["effects"][effect][child].Points.length;point++){var co=object["effects"][effect][child].Points[point].co;if(co.X >=clip_start_x &&co.X<=clip_end_x) keyframes[co.X]=co.Y;}}}return keyframes;};$scope.getTrackTop=function(layer){var vert_scroll_offset=$("#scrolling_tracks").scrollTop();var horz_scroll_offset=$("#scrolling_tracks").scrollLeft();var track_id="div#track_"+layer;if($(track_id).length) return $(track_id).position().top+vert_scroll_offset;else return 0;};$scope.setScale=function(scaleVal){$scope.$apply(function(){$scope.project.scale=scaleVal;$scope.pixelsPerSecond=parseFloat($scope.project.tick_pixels)/parseFloat($scope.project.scale);});};$scope.setAudioData=function(clip_id, audio_data){for(var clip_index=0;clip_index< $scope.project.clips.length;clip_index++) if($scope.project.clips[clip_index].id==clip_id){$scope.$apply(function(){$scope.project.clips[clip_index].audio_data=audio_data;$scope.project.clips[clip_index].show_audio=true;});timeline.qt_log("Audio data successful set on clip JSON");break;}drawAudio($scope, clip_id);};$scope.hideAudioData=function(clip_id, audio_data){for(var clip_index=0;clip_index< $scope.project.clips.length;clip_index++) if($scope.project.clips[clip_index].id==clip_id){$scope.$apply(function(){$scope.project.clips[clip_index].show_audio=false;$scope.project.clips[clip_index].audio_data=[];});break;}};$scope.reDrawAllAudioData=function(){for(var clip_index=0;clip_index< $scope.project.clips.length;clip_index++){if("audio_data"in $scope.project.clips[clip_index]&&$scope.project.clips[clip_index].audio_data.length > 0){drawAudio($scope, $scope.project.clips[clip_index].id);}}};$scope.hasAudioData=function(clip_id){for(var clip_index=0;clip_index< $scope.project.clips.length;clip_index++){if($scope.project.clips[clip_index].id==clip_id &&"audio_data"in $scope.project.clips[clip_index]&&$scope.project.clips[clip_index].audio_data.length > 0){return true;break;}}return false;};$scope.SetSnappingMode=function(enable_snapping){$scope.$apply(function(){$scope.enable_snapping=enable_snapping;if(enable_snapping)$(".droppable").draggable("option","snapTolerance", 20);else $(".droppable").draggable("option","snapTolerance", 0);});};$scope.GetEffectColor=function(effect_type){switch(effect_type){case"Blur":return"#0095bf";case"Brightness":return"#5500ff";case"ChromaKey":return"#00ad2d";case"Deinterlace":return"#006001";case"Mask":return"#cb0091";case"Negate":return"#ff9700";case"Saturation":return"#ff3d00";default:return"#000000";}};$scope.AddClip=function(x, y, clip_json){$scope.$apply(function(){var scrolling_tracks_offset=$("#scrolling_tracks").offset().left;var clip_position=parseFloat(x-scrolling_tracks_offset)/parseFloat($scope.pixelsPerSecond);clip_json.position=clip_position;clip_json.layer=$scope.GetTrackAtY(y).number;$scope.project.clips.push(clip_json);});};$scope.ClearAllSelections=function(){$scope.SelectTransition("", true);$scope.SelectEffect("", true);$scope.$apply(function(){for(var clip_index=0;clip_index< $scope.project.clips.length;clip_index++)$scope.project.clips[clip_index].selected=false;for(var effect_index=0;effect_index< $scope.project.effects.length;effect_index++)$scope.project.effects[effect_index].selected=false;});};$scope.SelectAll=function(){$scope.$apply(function(){for(var clip_index=0;clip_index< $scope.project.clips.length;clip_index++){$scope.project.clips[clip_index].selected=true;timeline.addSelection($scope.project.clips[clip_index].id,"clip", false);}for(var effect_index=0;effect_index< $scope.project.effects.length;effect_index++){$scope.project.effects[effect_index].selected=true;timeline.addSelection($scope.project.effects[effect_index].id,"transition", false);}});};$scope.SelectClip=function(clip_id, clear_selections, event){var id=clip_id.replace("clip_","");if(id!=""&&clear_selections){$scope.SelectTransition("", clear_selections);$scope.SelectEffect("", clear_selections);}is_ctrl=false;if(event &&event.ctrlKey) is_ctrl=true;for(var clip_index=0;clip_index< $scope.project.clips.length;clip_index++) if($scope.project.clips[clip_index].id==id){$scope.project.clips[clip_index].selected=true;if($scope.Qt) timeline.addSelection(id,"clip", clear_selections);}else if(clear_selections &&!is_ctrl){$scope.project.clips[clip_index].selected=false;if($scope.Qt) timeline.removeSelection($scope.project.clips[clip_index].id,"clip");}};$scope.SelectTransition=function(tran_id, clear_selections, event){var id=tran_id.replace("transition_","");if(id!=""&&clear_selections){$scope.SelectClip("", true);$scope.SelectEffect("", true);}is_ctrl=false;if(event &&event.ctrlKey) is_ctrl=true;for(var tran_index=0;tran_index< $scope.project.effects.length;tran_index++) if($scope.project.effects[tran_index].id==id){$scope.project.effects[tran_index].selected=true;if($scope.Qt) timeline.addSelection(id,"transition", clear_selections);}else if(clear_selections &&!is_ctrl){$scope.project.effects[tran_index].selected=false;if($scope.Qt) timeline.removeSelection($scope.project.effects[tran_index].id,"transition");}};$scope.FormatThumbPath=function(image_url){if(image_url.charAt(0)==".") return image_url;else return"file:///"+image_url;};$scope.SelectEffect=function(effect_id){if($scope.Qt) timeline.addSelection(effect_id,"effect", true);};$scope.ResizeTimeline=function(){var furthest_right_edge=0;for(var clip_index=0;clip_index< $scope.project.clips.length;clip_index++){var clip=$scope.project.clips[clip_index];var right_edge=clip.position+(clip.end-clip.start);if(right_edge > furthest_right_edge) furthest_right_edge=right_edge;}if(furthest_right_edge > $scope.project.duration) if($scope.Qt){timeline.resizeTimeline(furthest_right_edge+10) $scope.project.duration=furthest_right_edge+10;}};$scope.ShowClipMenu=function(clip_id){if($scope.Qt){timeline.qt_log("$scope.ShowClipMenu");timeline.ShowClipMenu(clip_id);}};$scope.ShowEffectMenu=function(effect_id){if($scope.Qt){timeline.qt_log("$scope.ShowEffectMenu");timeline.ShowEffectMenu(effect_id);}};$scope.ShowTransitionMenu=function(tran_id){if($scope.Qt){timeline.qt_log("$scope.ShowTransitionMenu");timeline.ShowTransitionMenu(tran_id);}};$scope.ShowTrackMenu=function(layer_id){if($scope.Qt){timeline.qt_log("$scope.ShowTrackMenu");timeline.ShowTrackMenu(layer_id);}};$scope.ShowMarkerMenu=function(marker_id){if($scope.Qt){timeline.qt_log("$scope.ShowMarkerMenu");timeline.ShowMarkerMenu(marker_id);}};$scope.ShowPlayheadMenu=function(position){if($scope.Qt){timeline.qt_log("$scope.ShowPlayheadMenu");timeline.ShowPlayheadMenu(position);}};$scope.ShowTimelineMenu=function(e, layer_number){if($scope.Qt){timeline.ShowTimelineMenu($scope.GetJavaScriptPosition(e.pageX), layer_number);}};$scope.GetTrackName=function(layer_label, layer_number){if(layer_label.length > 0) return layer_label;else return $scope.track_label.replace('%s', layer_number.toString());};$scope.SetTrackLabel=function(label){$scope.track_label=label;};$scope.GetTimelineWidth=function(min_value){return Math.max(min_value, $scope.project.duration *$scope.pixelsPerSecond);};$scope.GetJavaScriptPosition=function(x){var horz_scroll_offset=$("#scrolling_tracks").scrollLeft();var scrolling_tracks_offset_left=$("#scrolling_tracks").offset().left;x+=horz_scroll_offset;var clip_position=parseFloat(x-scrolling_tracks_offset_left)/parseFloat($scope.pixelsPerSecond);if(clip_position< 0) clip_position=0;return clip_position;};$scope.GetJavaScriptTrack=function(y){var vert_scroll_offset=$("#scrolling_tracks").scrollTop();y+=vert_scroll_offset;var track_number=parseInt($scope.GetTrackAtY(y).number);return track_number;};$scope.UpdateRecentItemJSON=function(item_type, item_id){var item_object=null;if(item_type== 'clip'){item_object=findElement($scope.project.clips,"id", item_id);}else if(item_type== 'transition'){item_object=findElement($scope.project.effects,"id", item_id);}else{return;}var scrolling_tracks_offset_top=$("#scrolling_tracks").offset().top;var clip_position=parseFloat(bounding_box.left)/parseFloat($scope.pixelsPerSecond);var layer_num=$scope.GetTrackAtY(bounding_box.track_position-scrolling_tracks_offset_top).number;$scope.$apply(function(){item_object.position=clip_position;item_object.layer=layer_num;});if(item_type== 'clip') timeline.update_clip_data(JSON.stringify(item_object));else if(item_type== 'transition') timeline.update_transition_data(JSON.stringify(item_object));$scope.ResizeTimeline();$scope.HideSnapline();bounding_box={};};$scope.StartManualMove=function(item_type, item_id){$scope.$apply(function(){if(item_type== 'clip')$scope.SelectClip(item_id, true);else if(item_type== 'transition')$scope.SelectTransition(item_id, true);});var element_id="#"+item_type+"_"+item_id;bounding_box={};setBoundingBox($(element_id));bounding_box.previous_x=bounding_box.left;bounding_box.previous_y=bounding_box.top;bounding_box.offset_x=0;bounding_box.offset_y=0;bounding_box.element=$(element_id);bounding_box.track_position=0;};$scope.MoveItem=function(x, y, item_type){var vert_scroll_offset=$("#scrolling_tracks").scrollTop();var horz_scroll_offset=$("#scrolling_tracks").scrollLeft();x+=horz_scroll_offset;y+=vert_scroll_offset;var scrolling_tracks_offset_left=$("#scrolling_tracks").offset().left;var scrolling_tracks_offset_top=$("#scrolling_tracks").offset().top;var left=parseFloat(x-scrolling_tracks_offset_left);var top=parseFloat(y-scrolling_tracks_offset_top);var x_offset=left-bounding_box.previous_x;var y_offset=top-bounding_box.previous_y;results=moveBoundingBox($scope, bounding_box.previous_x, bounding_box.previous_y, x_offset, y_offset, left, top);bounding_box.previous_x=results.position.left;bounding_box.previous_y=results.position.top;var clip_position=parseFloat(results.position.left)/parseFloat($scope.pixelsPerSecond);if(clip_position< 0) clip_position=0;bounding_box.track_position=0;for(var layer_index=$scope.project.layers.length-1;layer_index >=0;layer_index--){var layer=$scope.project.layers[layer_index];if(!layer.lock) if((top< layer.y &&top > bounding_box.track_position)||bounding_box.track_position==0) bounding_box.track_position=layer.y;}bounding_box.element.css('left', results.position.left);bounding_box.element.css('top', bounding_box.track_position-scrolling_tracks_offset_top);};$scope.UpdateLayerIndex=function(){if($scope.Qt) timeline.qt_log('UpdateLayerIndex');var vert_scroll_offset=$("#scrolling_tracks").scrollTop();var horz_scroll_offset=$("#scrolling_tracks").scrollLeft();var scrolling_tracks_offset_left=$("#scrolling_tracks").offset().left;var scrolling_tracks_offset_top=$("#scrolling_tracks").offset().top;$scope.$apply(function(){for(var layer_index=0;layer_index< $scope.project.layers.length;layer_index++){var layer=$scope.project.layers[layer_index];var layer_elem=$("#track_"+layer.number);if(layer_elem){layer.y=layer_elem.offset().top+vert_scroll_offset;}}$scope.playhead_height=$("#track-container").height();$(".playhead-line").height($scope.playhead_height);});};$scope.SortItems=function(){if(!$scope.enable_sorting) return;if($scope.Qt) timeline.qt_log('SortItems');$scope.$apply(function(){$scope.project.clips=$scope.project.clips.sort(function(a, b){if(a.position< b.position) return-1;if(a.position > b.position) return 1;return 0;});$scope.project.effects=$scope.project.effects.sort(function(a, b){if(a.position< b.position) return-1;if(a.position > b.position) return 1;return 0;});$scope.project.layers=$scope.project.layers.sort(function(a, b){if(a.number< b.number) return-1;if(a.number > b.number) return 1;return 0;});});};$scope.GetMissingTransitions=function(original_clip){var transition_size=null;var original_left=original_clip.position;var original_right=original_clip.position+(original_clip.end-original_clip.start);for(var index=0;index< $scope.project.clips.length;index++){var clip=$scope.project.clips[index];if(original_clip.layer!=clip.layer) continue;var clip_left=clip.position;var clip_right=clip.position+(clip.end-clip.start);if(original_left< clip_right &&original_left > clip_left) transition_size={"position":original_left,"layer":clip.layer,"start":0,"end":(clip_right-original_left)};else if(original_right > clip_left &&original_right< clip_right) transition_size={"position":clip_left,"layer":clip.layer,"start":0,"end":(original_right-clip_left)};if(transition_size!=null &&transition_size.end >=0.5) break;else if(transition_size!=null &&transition_size.end< 0.5) transition_size=null;}if(transition_size!=null) for(var tran_index=0;tran_index< $scope.project.effects.length;tran_index++){var tran=$scope.project.effects[tran_index];if(tran.layer!=transition_size.layer) continue;var tran_left=tran.position;var tran_right=tran.position+(tran.end-tran.start);var new_tran_left=transition_size.position;var new_tran_right=transition_size.position+(transition_size.end-transition_size.start);var TOLERANCE=0.01;if(Math.abs(tran_left-new_tran_left)< TOLERANCE||Math.abs(tran_right-new_tran_right)< TOLERANCE){transition_size=null;break;}}return transition_size;};$scope.GetNearbyPosition=function(pixel_positions, threashold, ignore_ids){var smallest_diff=900.0;var smallest_abs_diff=900.0;var snapping_position=0.0;var diffs=[];for(var pos_index=0;pos_index< pixel_positions.length;pos_index++){var pixel_position=pixel_positions[pos_index];var position=pixel_position/$scope.pixelsPerSecond;for(var index=0;index< $scope.project.clips.length;index++){var clip=$scope.project.clips[index];if(ignore_ids.hasOwnProperty(clip.id)) continue;diffs.push({'diff':position-clip.position, 'position':clip.position},{'diff':position-(clip.position+(clip.end-clip.start)), 'position':clip.position+(clip.end-clip.start)});}for(var index=0;index< $scope.project.effects.length;index++){var transition=$scope.project.effects[index];if(ignore_ids.hasOwnProperty(transition.id)) continue;diffs.push({'diff':position-transition.position, 'position':transition.position},{'diff':position-(transition.position+(transition.end-transition.start)), 'position':transition.position+(transition.end-transition.start)});}for(var index=0;index< $scope.project.markers.length;index++){var marker=$scope.project.markers[index];diffs.push({'diff':position-marker.position, 'position':marker.position},{'diff':position-(marker.position+(marker.end-marker.start)), 'position':marker.position+(marker.end-marker.start)});}var playhead_diff=position-$scope.project.playhead_position;diffs.push({'diff':playhead_diff, 'position':$scope.project.playhead_position});for(var diff_index=0;diff_index< diffs.length;diff_index++){var diff=diffs[diff_index].diff;var position=diffs[diff_index].position;var abs_diff=Math.abs(diff);if(abs_diff< smallest_abs_diff &&abs_diff<=threashold){smallest_diff=diff;smallest_abs_diff=abs_diff;snapping_position=position;}}}if(smallest_diff==900.0) smallest_diff=0.0;return[smallest_diff, snapping_position];};$scope.ShowSnapline=function(position){if(position!=$scope.snapline_position||!$scope.snapline){$scope.$apply(function(){$scope.snapline_position=position;$scope.snapline=true;});}};$scope.HideSnapline=function(){if($scope.snapline){$scope.$apply(function(){$scope.snapline=false;});}};$scope.GetTrackAtY=function(y){for(var layer_index=$scope.project.layers.length-1;layer_index >=0;layer_index--){var layer=$scope.project.layers[layer_index];if(layer.y > y) return layer;}if($scope.project.layers.length > 0) return $scope.project.layers[0];else return null;};$scope.GetTrackStyle=function(lock){if(lock) return"track track_disabled";else return"track";};$scope.ApplyJsonDiff=function(jsonDiff){for(var action_index=0;action_index< jsonDiff.length;action_index++){var action=jsonDiff[action_index];var previous_object=null;var current_object=$scope.project;var current_position=0;var current_key="";for(var key_index=0;key_index< action.key.length;key_index++){var key_value=action.key[key_index];if(key_value.constructor==String){if(!current_object.hasOwnProperty(key_value)) return false;previous_object=current_object;current_object=current_object[key_value];current_key=key_value;}else if(key_value.constructor==Object){var id=null;if("id"in key_value) id=key_value["id"];if(current_object.constructor==Array){current_position=0;for(var child_index=0;child_index< current_object.length;child_index++){var child_object=current_object[child_index];if(child_object.hasOwnProperty("id")&&child_object.id==id){previous_object=current_object;current_object=child_object;break;}current_position++;}}}}if(current_object){if(action.type=="insert"){if(current_object.constructor==Array)$scope.$apply(function(){current_object.push(action.value);});else{if(previous_object.constructor==Array){$scope.$apply(function(){previous_object[current_position]=action.value;});}else if(previous_object.constructor==Object){$scope.$apply(function(){previous_object[current_key]=action.value;});}}}else if(action.type=="update"){if(current_object.constructor==Object &&action.value.constructor==Object){for(var update_key in action.value) if(update_key in current_object)$scope.$apply(function(){current_object[update_key]=action.value[update_key];});}else{if(previous_object.constructor==Array){$scope.$apply(function(){previous_object[current_position]=action.value;});}else if(previous_object.constructor==Object){$scope.$apply(function(){previous_object[current_key]=action.value;});}}}else if(action.type=="delete"){$scope.$apply(function(){previous_object.splice(current_position, 1);});}$scope.ResizeTimeline();$scope.SortItems();$scope.UpdateLayerIndex();$scope.LockItems();}}return true;};$scope.LoadJson=function(EntireProjectJson){$scope.$apply(function(){$scope.project=EntireProjectJson.value;$scope.SelectClip("", true);});$scope.SortItems;$scope.UpdateLayerIndex();$scope.LockItems();return true;};$scope.LockItems=function(){};$scope.ToggleDebug=function(){if($scope.debug==true) $scope.debug=false;else $scope.debug=true;};$scope.addClips=function(numClips){startNum=$scope.project.clips.length+1;positionNum=0;for(var x=0;x< parseInt(numClips);x++){$scope.project.clips.push({id:x.toString(), layer:0, image: './media/images/thumbnail.png', locked:false, duration:5, start:0, end:5, position:positionNum, title: 'Clip B', effects:[], images:{start:3, end:7}, show_audio:false, alpha:{Points:[]}, location_x:{Points:[]}, location_y:{Points:[]}, scale_x:{Points:[]}, scale_y:{Points:[]}, rotation:{Points:[]}, time:{Points:[]}, volume:{Points:[]}});startNum++;positionNum+=5;};$scope.numClips="";};$scope.addEffect=function(clipNum){elm=findElement($scope.project.clips,"number", clipNum);elm.effects.push({effect: 'Old Movie', icon: 'om.png'});$scope.clipNum="";};$scope.addMarker=function(markLoc){$scope.project.markers.push({location:parseInt(markLoc), icon: 'blue.png'});$scope.markLoc="";};$scope.changeImage=function(startImage){console.log(startImage);$scope.project.clips[2].images.start=startImage;$scope.startImage="";};})