From 2341dcc12fb23c3e670abde7411af36b8b7dc944 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Mon, 13 Oct 2014 01:48:43 -0300 Subject: [PATCH] Spanish timestamp format (using angular-moment) --- Gruntfile.js | 4 ++-- bower.json | 3 ++- public/js/angularjs-all.min.js | 2 +- public/js/main.min.js | 2 +- public/js/vendors.min.js | 4 ++-- public/src/js/app.js | 1 + public/src/js/config.js | 3 ++- public/src/js/controllers/footer.js | 3 ++- 8 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index e114af9..510f2d5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -26,11 +26,11 @@ module.exports = function(grunt) { } }, vendors: { - src: ['public/src/js/ios-imagefile-megapixel/megapix-image.js', 'public/lib/qrcode-generator/js/qrcode.js', 'public/src/js/jsqrcode/grid.js', 'public/src/js/jsqrcode/version.js', 'public/src/js/jsqrcode/detector.js', 'public/src/js/jsqrcode/formatinf.js', 'public/src/js/jsqrcode/errorlevel.js', 'public/src/js/jsqrcode/bitmat.js', 'public/src/js/jsqrcode/datablock.js', 'public/src/js/jsqrcode/bmparser.js', 'public/src/js/jsqrcode/datamask.js', 'public/src/js/jsqrcode/rsdecoder.js', 'public/src/js/jsqrcode/gf256poly.js', 'public/src/js/jsqrcode/gf256.js', 'public/src/js/jsqrcode/decoder.js', 'public/src/js/jsqrcode/qrcode.js', 'public/src/js/jsqrcode/findpat.js', 'public/src/js/jsqrcode/alignpat.js', 'public/src/js/jsqrcode/databr.js', 'public/lib/momentjs/min/moment.min.js', 'public/lib/zeroclipboard/ZeroClipboard.min.js'], + src: ['public/src/js/ios-imagefile-megapixel/megapix-image.js', 'public/lib/qrcode-generator/js/qrcode.js', 'public/src/js/jsqrcode/grid.js', 'public/src/js/jsqrcode/version.js', 'public/src/js/jsqrcode/detector.js', 'public/src/js/jsqrcode/formatinf.js', 'public/src/js/jsqrcode/errorlevel.js', 'public/src/js/jsqrcode/bitmat.js', 'public/src/js/jsqrcode/datablock.js', 'public/src/js/jsqrcode/bmparser.js', 'public/src/js/jsqrcode/datamask.js', 'public/src/js/jsqrcode/rsdecoder.js', 'public/src/js/jsqrcode/gf256poly.js', 'public/src/js/jsqrcode/gf256.js', 'public/src/js/jsqrcode/decoder.js', 'public/src/js/jsqrcode/qrcode.js', 'public/src/js/jsqrcode/findpat.js', 'public/src/js/jsqrcode/alignpat.js', 'public/src/js/jsqrcode/databr.js', 'public/lib/momentjs/min/moment.min.js', 'public/lib/moment/lang/es.js', 'public/lib/zeroclipboard/ZeroClipboard.min.js'], dest: 'public/js/vendors.js' }, angular: { - src: ['public/lib/angular/angular.min.js', 'public/lib/angular-resource/angular-resource.min.js', 'public/lib/angular-route/angular-route.min.js', 'public/lib/angular-qrcode/qrcode.js', 'public/lib/angular-animate/angular-animate.min.js', 'public/lib/angular-bootstrap/ui-bootstrap.js', 'public/lib/angular-bootstrap/ui-bootstrap-tpls.js', 'public/lib/angular-ui-utils/ui-utils.min.js', 'public/lib/ngprogress/build/ngProgress.min.js', 'public/lib/angular-gettext/dist/angular-gettext.min.js'], + src: ['public/lib/angular/angular.min.js', 'public/lib/angular-resource/angular-resource.min.js', 'public/lib/angular-route/angular-route.min.js', 'public/lib/angular-qrcode/qrcode.js', 'public/lib/angular-animate/angular-animate.min.js', 'public/lib/angular-bootstrap/ui-bootstrap.js', 'public/lib/angular-bootstrap/ui-bootstrap-tpls.js', 'public/lib/angular-ui-utils/ui-utils.min.js', 'public/lib/ngprogress/build/ngProgress.min.js', 'public/lib/angular-gettext/dist/angular-gettext.min.js', 'public/lib/angular-moment/angular-moment.min.js'], dest: 'public/js/angularjs-all.js' }, main: { diff --git a/bower.json b/bower.json index fa32737..db29b28 100644 --- a/bower.json +++ b/bower.json @@ -13,6 +13,7 @@ "zeroclipboard": "~1.3.2", "ngprogress": "~1.0.4", "angular-ui-utils": "~0.1.1", - "angular-gettext": "~1.1.0" + "angular-gettext": "~1.1.0", + "angular-moment": "~0.8.0" } } diff --git a/public/js/angularjs-all.min.js b/public/js/angularjs-all.min.js index dc8643f..a01203a 100644 --- a/public/js/angularjs-all.min.js +++ b/public/js/angularjs-all.min.js @@ -8,4 +8,4 @@ q.template=a,a=L(c,function(a){A(),e.enter(a,null,k,m)}),u=c,x=a,u.$emit("$inclu accordionCtrl.addGroup(scope),scope.isOpen=!1,attrs.isOpen&&(getIsOpen=$parse(attrs.isOpen),setIsOpen=getIsOpen.assign,scope.$parent.$watch(getIsOpen,function(value){scope.isOpen=!!value})),scope.$watch("isOpen",function(value){value&&accordionCtrl.closeOthers(scope),setIsOpen&&setIsOpen(scope.$parent,value)})}}}]).directive("accordionHeading",function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",compile:function(element,attr,transclude){return function(scope,element,attr,accordionGroupCtrl){accordionGroupCtrl.setHeading(transclude(scope,function(){}))}}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(scope,element,attr,controller){scope.$watch(function(){return controller[attr.accordionTransclude]},function(heading){heading&&(element.html(""),element.append(heading))})}}}),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function($scope,$attrs){$scope.closeable="close"in $attrs}]).directive("alert",function(){return{restrict:"EA",controller:"AlertController",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"=",close:"&"}}}),angular.module("ui.bootstrap.bindHtml",[]).directive("bindHtmlUnsafe",function(){return function(scope,element,attr){element.addClass("ng-binding").data("$binding",attr.bindHtmlUnsafe),scope.$watch(attr.bindHtmlUnsafe,function(value){element.html(value||"")})}}),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(buttonConfig){this.activeClass=buttonConfig.activeClass||"active",this.toggleEvent=buttonConfig.toggleEvent||"click"}]).directive("btnRadio",function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(scope,element,attrs,ctrls){var buttonsCtrl=ctrls[0],ngModelCtrl=ctrls[1];ngModelCtrl.$render=function(){element.toggleClass(buttonsCtrl.activeClass,angular.equals(ngModelCtrl.$modelValue,scope.$eval(attrs.btnRadio)))},element.bind(buttonsCtrl.toggleEvent,function(){element.hasClass(buttonsCtrl.activeClass)||scope.$apply(function(){ngModelCtrl.$setViewValue(scope.$eval(attrs.btnRadio)),ngModelCtrl.$render()})})}}}).directive("btnCheckbox",function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(scope,element,attrs,ctrls){function getTrueValue(){return getCheckboxValue(attrs.btnCheckboxTrue,!0)}function getFalseValue(){return getCheckboxValue(attrs.btnCheckboxFalse,!1)}function getCheckboxValue(attributeValue,defaultValue){var val=scope.$eval(attributeValue);return angular.isDefined(val)?val:defaultValue}var buttonsCtrl=ctrls[0],ngModelCtrl=ctrls[1];ngModelCtrl.$render=function(){element.toggleClass(buttonsCtrl.activeClass,angular.equals(ngModelCtrl.$modelValue,getTrueValue()))},element.bind(buttonsCtrl.toggleEvent,function(){scope.$apply(function(){ngModelCtrl.$setViewValue(element.hasClass(buttonsCtrl.activeClass)?getFalseValue():getTrueValue()),ngModelCtrl.$render()})})}}}),angular.module("ui.bootstrap.carousel",["ui.bootstrap.transition"]).controller("CarouselController",["$scope","$timeout","$transition","$q",function($scope,$timeout,$transition){function restartTimer(){resetTimer();var interval=+$scope.interval;!isNaN(interval)&&interval>=0&&(currentTimeout=$timeout(timerFn,interval))}function resetTimer(){currentTimeout&&($timeout.cancel(currentTimeout),currentTimeout=null)}function timerFn(){isPlaying?($scope.next(),restartTimer()):$scope.pause()}var currentTimeout,isPlaying,self=this,slides=self.slides=[],currentIndex=-1;self.currentSlide=null;var destroyed=!1;self.select=function(nextSlide,direction){function goNext(){if(!destroyed){if(self.currentSlide&&angular.isString(direction)&&!$scope.noTransition&&nextSlide.$element){nextSlide.$element.addClass(direction);{nextSlide.$element[0].offsetWidth}angular.forEach(slides,function(slide){angular.extend(slide,{direction:"",entering:!1,leaving:!1,active:!1})}),angular.extend(nextSlide,{direction:direction,active:!0,entering:!0}),angular.extend(self.currentSlide||{},{direction:direction,leaving:!0}),$scope.$currentTransition=$transition(nextSlide.$element,{}),function(next,current){$scope.$currentTransition.then(function(){transitionDone(next,current)},function(){transitionDone(next,current)})}(nextSlide,self.currentSlide)}else transitionDone(nextSlide,self.currentSlide);self.currentSlide=nextSlide,currentIndex=nextIndex,restartTimer()}}function transitionDone(next,current){angular.extend(next,{direction:"",active:!0,leaving:!1,entering:!1}),angular.extend(current||{},{direction:"",active:!1,leaving:!1,entering:!1}),$scope.$currentTransition=null}var nextIndex=slides.indexOf(nextSlide);void 0===direction&&(direction=nextIndex>currentIndex?"next":"prev"),nextSlide&&nextSlide!==self.currentSlide&&($scope.$currentTransition?($scope.$currentTransition.cancel(),$timeout(goNext)):goNext())},$scope.$on("$destroy",function(){destroyed=!0}),self.indexOfSlide=function(slide){return slides.indexOf(slide)},$scope.next=function(){var newIndex=(currentIndex+1)%slides.length;return $scope.$currentTransition?void 0:self.select(slides[newIndex],"next")},$scope.prev=function(){var newIndex=0>currentIndex-1?slides.length-1:currentIndex-1;return $scope.$currentTransition?void 0:self.select(slides[newIndex],"prev")},$scope.select=function(slide){self.select(slide)},$scope.isActive=function(slide){return self.currentSlide===slide},$scope.slides=function(){return slides},$scope.$watch("interval",restartTimer),$scope.$on("$destroy",resetTimer),$scope.play=function(){isPlaying||(isPlaying=!0,restartTimer())},$scope.pause=function(){$scope.noPause||(isPlaying=!1,resetTimer())},self.addSlide=function(slide,element){slide.$element=element,slides.push(slide),1===slides.length||slide.active?(self.select(slides[slides.length-1]),1==slides.length&&$scope.play()):slide.active=!1},self.removeSlide=function(slide){var index=slides.indexOf(slide);slides.splice(index,1),slides.length>0&&slide.active?self.select(index>=slides.length?slides[index-1]:slides[index]):currentIndex>index&¤tIndex--}}]).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($parse){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{},link:function(scope,element,attrs,carouselCtrl){if(attrs.active){var getActive=$parse(attrs.active),setActive=getActive.assign,lastValue=scope.active=getActive(scope.$parent);scope.$watch(function(){var parentActive=getActive(scope.$parent);return parentActive!==scope.active&&(parentActive!==lastValue?lastValue=scope.active=parentActive:setActive(scope.$parent,parentActive=lastValue=scope.active)),parentActive})}carouselCtrl.addSlide(scope,element),scope.$on("$destroy",function(){carouselCtrl.removeSlide(scope)}),scope.$watch("active",function(active){active&&carouselCtrl.select(scope)})}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function($document,$window){function getStyle(el,cssprop){return el.currentStyle?el.currentStyle[cssprop]:$window.getComputedStyle?$window.getComputedStyle(el)[cssprop]:el.style[cssprop]}function isStaticPositioned(element){return"static"===(getStyle(element,"position")||"static")}var parentOffsetEl=function(element){for(var docDomEl=$document[0],offsetParent=element.offsetParent||docDomEl;offsetParent&&offsetParent!==docDomEl&&isStaticPositioned(offsetParent);)offsetParent=offsetParent.offsetParent;return offsetParent||docDomEl};return{position:function(element){var elBCR=this.offset(element),offsetParentBCR={top:0,left:0},offsetParentEl=parentOffsetEl(element[0]);offsetParentEl!=$document[0]&&(offsetParentBCR=this.offset(angular.element(offsetParentEl)),offsetParentBCR.top+=offsetParentEl.clientTop-offsetParentEl.scrollTop,offsetParentBCR.left+=offsetParentEl.clientLeft-offsetParentEl.scrollLeft);var boundingClientRect=element[0].getBoundingClientRect();return{width:boundingClientRect.width||element.prop("offsetWidth"),height:boundingClientRect.height||element.prop("offsetHeight"),top:elBCR.top-offsetParentBCR.top,left:elBCR.left-offsetParentBCR.left}},offset:function(element){var boundingClientRect=element[0].getBoundingClientRect();return{width:boundingClientRect.width||element.prop("offsetWidth"),height:boundingClientRect.height||element.prop("offsetHeight"),top:boundingClientRect.top+($window.pageYOffset||$document[0].body.scrollTop||$document[0].documentElement.scrollTop),left:boundingClientRect.left+($window.pageXOffset||$document[0].body.scrollLeft||$document[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($scope,$attrs,dateFilter,dtConfig){function getValue(value,defaultValue){return angular.isDefined(value)?$scope.$parent.$eval(value):defaultValue}function getDaysInMonth(year,month){return new Date(year,month,0).getDate()}function getDates(startDate,n){for(var dates=new Array(n),current=startDate,i=0;n>i;)dates[i++]=new Date(current),current.setDate(current.getDate()+1);return dates}function makeDate(date,format,isSelected,isSecondary){return{date:date,label:dateFilter(date,format),selected:!!isSelected,secondary:!!isSecondary}}var format={day:getValue($attrs.dayFormat,dtConfig.dayFormat),month:getValue($attrs.monthFormat,dtConfig.monthFormat),year:getValue($attrs.yearFormat,dtConfig.yearFormat),dayHeader:getValue($attrs.dayHeaderFormat,dtConfig.dayHeaderFormat),dayTitle:getValue($attrs.dayTitleFormat,dtConfig.dayTitleFormat),monthTitle:getValue($attrs.monthTitleFormat,dtConfig.monthTitleFormat)},startingDay=getValue($attrs.startingDay,dtConfig.startingDay),yearRange=getValue($attrs.yearRange,dtConfig.yearRange);this.minDate=dtConfig.minDate?new Date(dtConfig.minDate):null,this.maxDate=dtConfig.maxDate?new Date(dtConfig.maxDate):null,this.modes=[{name:"day",getVisibleDates:function(date,selected){var year=date.getFullYear(),month=date.getMonth(),firstDayOfMonth=new Date(year,month,1),difference=startingDay-firstDayOfMonth.getDay(),numDisplayedFromPreviousMonth=difference>0?7-difference:-difference,firstDate=new Date(firstDayOfMonth),numDates=0;numDisplayedFromPreviousMonth>0&&(firstDate.setDate(-numDisplayedFromPreviousMonth+1),numDates+=numDisplayedFromPreviousMonth),numDates+=getDaysInMonth(year,month+1),numDates+=(7-numDates%7)%7;for(var days=getDates(firstDate,numDates),labels=new Array(7),i=0;numDates>i;i++){var dt=new Date(days[i]);days[i]=makeDate(dt,format.day,selected&&selected.getDate()===dt.getDate()&&selected.getMonth()===dt.getMonth()&&selected.getFullYear()===dt.getFullYear(),dt.getMonth()!==month)}for(var j=0;7>j;j++)labels[j]=dateFilter(days[j].date,format.dayHeader);return{objects:days,title:dateFilter(date,format.dayTitle),labels:labels}},compare:function(date1,date2){return new Date(date1.getFullYear(),date1.getMonth(),date1.getDate())-new Date(date2.getFullYear(),date2.getMonth(),date2.getDate())},split:7,step:{months:1}},{name:"month",getVisibleDates:function(date,selected){for(var months=new Array(12),year=date.getFullYear(),i=0;12>i;i++){var dt=new Date(year,i,1);months[i]=makeDate(dt,format.month,selected&&selected.getMonth()===i&&selected.getFullYear()===year)}return{objects:months,title:dateFilter(date,format.monthTitle)}},compare:function(date1,date2){return new Date(date1.getFullYear(),date1.getMonth())-new Date(date2.getFullYear(),date2.getMonth())},split:3,step:{years:1}},{name:"year",getVisibleDates:function(date,selected){for(var years=new Array(yearRange),year=date.getFullYear(),startYear=parseInt((year-1)/yearRange,10)*yearRange+1,i=0;yearRange>i;i++){var dt=new Date(startYear+i,0,1);years[i]=makeDate(dt,format.year,selected&&selected.getFullYear()===dt.getFullYear())}return{objects:years,title:[years[0].label,years[yearRange-1].label].join(" - ")}},compare:function(date1,date2){return date1.getFullYear()-date2.getFullYear()},split:5,step:{years:yearRange}}],this.isDisabled=function(date,mode){var currentMode=this.modes[mode||0];return this.minDate&¤tMode.compare(date,this.minDate)<0||this.maxDate&¤tMode.compare(date,this.maxDate)>0||$scope.dateDisabled&&$scope.dateDisabled({date:date,mode:currentMode.name})}}]).directive("datepicker",["dateFilter","$parse","datepickerConfig","$log",function(dateFilter,$parse,datepickerConfig,$log){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{dateDisabled:"&"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(scope,element,attrs,ctrls){function updateShowWeekNumbers(){scope.showWeekNumbers=0===mode&&showWeeks}function split(arr,size){for(var arrays=[];arr.length>0;)arrays.push(arr.splice(0,size));return arrays}function refill(updateSelected){var date=null,valid=!0;ngModel.$modelValue&&(date=new Date(ngModel.$modelValue),isNaN(date)?(valid=!1,$log.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.')):updateSelected&&(selected=date)),ngModel.$setValidity("date",valid);var currentMode=datepickerCtrl.modes[mode],data=currentMode.getVisibleDates(selected,date);angular.forEach(data.objects,function(obj){obj.disabled=datepickerCtrl.isDisabled(obj.date,mode)}),ngModel.$setValidity("date-disabled",!date||!datepickerCtrl.isDisabled(date)),scope.rows=split(data.objects,currentMode.split),scope.labels=data.labels||[],scope.title=data.title}function setMode(value){mode=value,updateShowWeekNumbers(),refill()}function getISO8601WeekNumber(date){var checkDate=new Date(date);checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));var time=checkDate.getTime();return checkDate.setMonth(0),checkDate.setDate(1),Math.floor(Math.round((time-checkDate)/864e5)/7)+1}var datepickerCtrl=ctrls[0],ngModel=ctrls[1];if(ngModel){var mode=0,selected=new Date,showWeeks=datepickerConfig.showWeeks;attrs.showWeeks?scope.$parent.$watch($parse(attrs.showWeeks),function(value){showWeeks=!!value,updateShowWeekNumbers()}):updateShowWeekNumbers(),attrs.min&&scope.$parent.$watch($parse(attrs.min),function(value){datepickerCtrl.minDate=value?new Date(value):null,refill()}),attrs.max&&scope.$parent.$watch($parse(attrs.max),function(value){datepickerCtrl.maxDate=value?new Date(value):null,refill()}),ngModel.$render=function(){refill(!0)},scope.select=function(date){if(0===mode){var dt=ngModel.$modelValue?new Date(ngModel.$modelValue):new Date(0,0,0,0,0,0,0);dt.setFullYear(date.getFullYear(),date.getMonth(),date.getDate()),ngModel.$setViewValue(dt),refill(!0)}else selected=date,setMode(mode-1)},scope.move=function(direction){var step=datepickerCtrl.modes[mode].step;selected.setMonth(selected.getMonth()+direction*(step.months||0)),selected.setFullYear(selected.getFullYear()+direction*(step.years||0)),refill()},scope.toggleMode=function(){setMode((mode+1)%datepickerCtrl.modes.length)},scope.getWeekNumber=function(row){return 0===mode&&scope.showWeekNumbers&&7===row.length?getISO8601WeekNumber(row[0].date):null}}}}}]).constant("datepickerPopupConfig",{dateFormat:"yyyy-MM-dd",currentText:"Today",toggleWeeksText:"Weeks",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","datepickerPopupConfig","datepickerConfig",function($compile,$parse,$document,$position,dateFilter,datepickerPopupConfig,datepickerConfig){return{restrict:"EA",require:"ngModel",link:function(originalScope,element,attrs,ngModel){function setOpen(value){setIsOpen?setIsOpen(originalScope,!!value):scope.isOpen=!!value}function parseDate(viewValue){if(viewValue){if(angular.isDate(viewValue))return ngModel.$setValidity("date",!0),viewValue;if(angular.isString(viewValue)){var date=new Date(viewValue);return isNaN(date)?void ngModel.$setValidity("date",!1):(ngModel.$setValidity("date",!0),date)}return void ngModel.$setValidity("date",!1)}return ngModel.$setValidity("date",!0),null}function addWatchableAttribute(attribute,scopeProperty,datepickerAttribute){attribute&&(originalScope.$watch($parse(attribute),function(value){scope[scopeProperty]=value}),datepickerEl.attr(datepickerAttribute||scopeProperty,scopeProperty))}function updatePosition(){scope.position=appendToBody?$position.offset(element):$position.position(element),scope.position.top=scope.position.top+element.prop("offsetHeight")}var dateFormat,scope=originalScope.$new(),closeOnDateSelection=angular.isDefined(attrs.closeOnDateSelection)?originalScope.$eval(attrs.closeOnDateSelection):datepickerPopupConfig.closeOnDateSelection,appendToBody=angular.isDefined(attrs.datepickerAppendToBody)?originalScope.$eval(attrs.datepickerAppendToBody):datepickerPopupConfig.appendToBody;attrs.$observe("datepickerPopup",function(value){dateFormat=value||datepickerPopupConfig.dateFormat,ngModel.$render()}),scope.showButtonBar=angular.isDefined(attrs.showButtonBar)?originalScope.$eval(attrs.showButtonBar):datepickerPopupConfig.showButtonBar,originalScope.$on("$destroy",function(){$popup.remove(),scope.$destroy()}),attrs.$observe("currentText",function(text){scope.currentText=angular.isDefined(text)?text:datepickerPopupConfig.currentText}),attrs.$observe("toggleWeeksText",function(text){scope.toggleWeeksText=angular.isDefined(text)?text:datepickerPopupConfig.toggleWeeksText}),attrs.$observe("clearText",function(text){scope.clearText=angular.isDefined(text)?text:datepickerPopupConfig.clearText}),attrs.$observe("closeText",function(text){scope.closeText=angular.isDefined(text)?text:datepickerPopupConfig.closeText});var getIsOpen,setIsOpen;attrs.isOpen&&(getIsOpen=$parse(attrs.isOpen),setIsOpen=getIsOpen.assign,originalScope.$watch(getIsOpen,function(value){scope.isOpen=!!value})),scope.isOpen=getIsOpen?getIsOpen(originalScope):!1;var documentClickBind=function(event){scope.isOpen&&event.target!==element[0]&&scope.$apply(function(){setOpen(!1)})},elementFocusBind=function(){scope.$apply(function(){setOpen(!0)})},popupEl=angular.element("
");popupEl.attr({"ng-model":"date","ng-change":"dateSelection()"});var datepickerEl=angular.element(popupEl.children()[0]),datepickerOptions={};attrs.datepickerOptions&&(datepickerOptions=originalScope.$eval(attrs.datepickerOptions),datepickerEl.attr(angular.extend({},datepickerOptions))),ngModel.$parsers.unshift(parseDate),scope.dateSelection=function(dt){angular.isDefined(dt)&&(scope.date=dt),ngModel.$setViewValue(scope.date),ngModel.$render(),closeOnDateSelection&&setOpen(!1)},element.bind("input change keyup",function(){scope.$apply(function(){scope.date=ngModel.$modelValue})}),ngModel.$render=function(){var date=ngModel.$viewValue?dateFilter(ngModel.$viewValue,dateFormat):"";element.val(date),scope.date=ngModel.$modelValue},addWatchableAttribute(attrs.min,"min"),addWatchableAttribute(attrs.max,"max"),attrs.showWeeks?addWatchableAttribute(attrs.showWeeks,"showWeeks","show-weeks"):(scope.showWeeks="show-weeks"in datepickerOptions?datepickerOptions["show-weeks"]:datepickerConfig.showWeeks,datepickerEl.attr("show-weeks","showWeeks")),attrs.dateDisabled&&datepickerEl.attr("date-disabled",attrs.dateDisabled);var documentBindingInitialized=!1,elementFocusInitialized=!1;scope.$watch("isOpen",function(value){value?(updatePosition(),$document.bind("click",documentClickBind),elementFocusInitialized&&element.unbind("focus",elementFocusBind),element[0].focus(),documentBindingInitialized=!0):(documentBindingInitialized&&$document.unbind("click",documentClickBind),element.bind("focus",elementFocusBind),elementFocusInitialized=!0),setIsOpen&&setIsOpen(originalScope,value)}),scope.today=function(){scope.dateSelection(new Date)},scope.clear=function(){scope.dateSelection(null)};var $popup=$compile(popupEl)(scope);appendToBody?$document.find("body").append($popup):element.after($popup)}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html",link:function(scope,element){element.bind("click",function(event){event.preventDefault(),event.stopPropagation()})}}}),angular.module("ui.bootstrap.dropdownToggle",[]).directive("dropdownToggle",["$document","$location",function($document){var openElement=null,closeMenu=angular.noop;return{restrict:"CA",link:function(scope,element){scope.$watch("$location.path",function(){closeMenu()}),element.parent().bind("click",function(){closeMenu()}),element.bind("click",function(event){var elementWasOpen=element===openElement;event.preventDefault(),event.stopPropagation(),openElement&&closeMenu(),elementWasOpen||element.hasClass("disabled")||element.prop("disabled")||(element.parent().addClass("open"),openElement=element,closeMenu=function(event){event&&(event.preventDefault(),event.stopPropagation()),$document.unbind("click",closeMenu),element.parent().removeClass("open"),closeMenu=angular.noop,openElement=null},$document.bind("click",closeMenu))})}}}]),angular.module("ui.bootstrap.modal",["ui.bootstrap.transition"]).factory("$$stackedMap",function(){return{createNew:function(){var stack=[];return{add:function(key,value){stack.push({key:key,value:value})},get:function(key){for(var i=0;i0)}function checkRemoveBackdrop(){if(backdropDomEl&&-1==backdropIndex()){var backdropScopeRef=backdropScope;removeAfterAnimate(backdropDomEl,backdropScope,150,function(){backdropScopeRef.$destroy(),backdropScopeRef=null}),backdropDomEl=void 0,backdropScope=void 0}}function removeAfterAnimate(domEl,scope,emulateTime,done){function afterAnimating(){afterAnimating.done||(afterAnimating.done=!0,domEl.remove(),done&&done())}scope.animate=!1;var transitionEndEventName=$transition.transitionEndEventName;if(transitionEndEventName){var timeout=$timeout(afterAnimating,emulateTime);domEl.bind(transitionEndEventName,function(){$timeout.cancel(timeout),afterAnimating(),scope.$apply()})}else $timeout(afterAnimating,0)}var backdropDomEl,backdropScope,OPENED_MODAL_CLASS="modal-open",openedWindows=$$stackedMap.createNew(),$modalStack={};return $rootScope.$watch(backdropIndex,function(newBackdropIndex){backdropScope&&(backdropScope.index=newBackdropIndex)}),$document.bind("keydown",function(evt){var modal;27===evt.which&&(modal=openedWindows.top(),modal&&modal.value.keyboard&&$rootScope.$apply(function(){$modalStack.dismiss(modal.key)}))}),$modalStack.open=function(modalInstance,modal){openedWindows.add(modalInstance,{deferred:modal.deferred,modalScope:modal.scope,backdrop:modal.backdrop,keyboard:modal.keyboard});var body=$document.find("body").eq(0),currBackdropIndex=backdropIndex();currBackdropIndex>=0&&!backdropDomEl&&(backdropScope=$rootScope.$new(!0),backdropScope.index=currBackdropIndex,backdropDomEl=$compile("
")(backdropScope),body.append(backdropDomEl));var angularDomEl=angular.element("
");angularDomEl.attr("window-class",modal.windowClass),angularDomEl.attr("index",openedWindows.length()-1),angularDomEl.attr("animate","animate"),angularDomEl.html(modal.content);var modalDomEl=$compile(angularDomEl)(modal.scope);openedWindows.top().value.modalDomEl=modalDomEl,body.append(modalDomEl),body.addClass(OPENED_MODAL_CLASS)},$modalStack.close=function(modalInstance,result){var modalWindow=openedWindows.get(modalInstance).value;modalWindow&&(modalWindow.deferred.resolve(result),removeModalWindow(modalInstance))},$modalStack.dismiss=function(modalInstance,reason){var modalWindow=openedWindows.get(modalInstance).value;modalWindow&&(modalWindow.deferred.reject(reason),removeModalWindow(modalInstance))},$modalStack.dismissAll=function(reason){for(var topModal=this.getTop();topModal;)this.dismiss(topModal.key,reason),topModal=this.getTop()},$modalStack.getTop=function(){return openedWindows.top()},$modalStack}]).provider("$modal",function(){var $modalProvider={options:{backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$http","$templateCache","$controller","$modalStack",function($injector,$rootScope,$q,$http,$templateCache,$controller,$modalStack){function getTemplatePromise(options){return options.template?$q.when(options.template):$http.get(options.templateUrl,{cache:$templateCache}).then(function(result){return result.data})}function getResolvePromises(resolves){var promisesArr=[];return angular.forEach(resolves,function(value){(angular.isFunction(value)||angular.isArray(value))&&promisesArr.push($q.when($injector.invoke(value)))}),promisesArr}var $modal={};return $modal.open=function(modalOptions){var modalResultDeferred=$q.defer(),modalOpenedDeferred=$q.defer(),modalInstance={result:modalResultDeferred.promise,opened:modalOpenedDeferred.promise,close:function(result){$modalStack.close(modalInstance,result)},dismiss:function(reason){$modalStack.dismiss(modalInstance,reason)}};if(modalOptions=angular.extend({},$modalProvider.options,modalOptions),modalOptions.resolve=modalOptions.resolve||{},!modalOptions.template&&!modalOptions.templateUrl)throw new Error("One of template or templateUrl options is required.");var templateAndResolvePromise=$q.all([getTemplatePromise(modalOptions)].concat(getResolvePromises(modalOptions.resolve)));return templateAndResolvePromise.then(function(tplAndVars){var modalScope=(modalOptions.scope||$rootScope).$new();modalScope.$close=modalInstance.close,modalScope.$dismiss=modalInstance.dismiss;var ctrlInstance,ctrlLocals={},resolveIter=1;modalOptions.controller&&(ctrlLocals.$scope=modalScope,ctrlLocals.$modalInstance=modalInstance,angular.forEach(modalOptions.resolve,function(value,key){ctrlLocals[key]=tplAndVars[resolveIter++]}),ctrlInstance=$controller(modalOptions.controller,ctrlLocals)),$modalStack.open(modalInstance,{scope:modalScope,deferred:modalResultDeferred,content:tplAndVars[0],backdrop:modalOptions.backdrop,keyboard:modalOptions.keyboard,windowClass:modalOptions.windowClass})},function(reason){modalResultDeferred.reject(reason)}),templateAndResolvePromise.then(function(){modalOpenedDeferred.resolve(!0)},function(){modalOpenedDeferred.reject(!1)}),modalInstance},$modal}]};return $modalProvider}),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse","$interpolate",function($scope,$attrs,$parse,$interpolate){var self=this,setNumPages=$attrs.numPages?$parse($attrs.numPages).assign:angular.noop;this.init=function(defaultItemsPerPage){$attrs.itemsPerPage?$scope.$parent.$watch($parse($attrs.itemsPerPage),function(value){self.itemsPerPage=parseInt(value,10),$scope.totalPages=self.calculateTotalPages()}):this.itemsPerPage=defaultItemsPerPage},this.noPrevious=function(){return 1===this.page},this.noNext=function(){return this.page===$scope.totalPages},this.isActive=function(page){return this.page===page},this.calculateTotalPages=function(){var totalPages=this.itemsPerPage<1?1:Math.ceil($scope.totalItems/this.itemsPerPage);return Math.max(totalPages||0,1)},this.getAttributeValue=function(attribute,defaultValue,interpolate){return angular.isDefined(attribute)?interpolate?$interpolate(attribute)($scope.$parent):$scope.$parent.$eval(attribute):defaultValue},this.render=function(){this.page=parseInt($scope.page,10)||1,this.page>0&&this.page<=$scope.totalPages&&($scope.pages=this.getPages(this.page,$scope.totalPages))},$scope.selectPage=function(page){!self.isActive(page)&&page>0&&page<=$scope.totalPages&&($scope.page=page,$scope.onSelectPage({page:page}))},$scope.$watch("page",function(){self.render()}),$scope.$watch("totalItems",function(){$scope.totalPages=self.calculateTotalPages()}),$scope.$watch("totalPages",function(value){setNumPages($scope.$parent,value),self.page>value?$scope.selectPage(value):self.render()})}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function($parse,config){return{restrict:"EA",scope:{page:"=",totalItems:"=",onSelectPage:" &"},controller:"PaginationController",templateUrl:"template/pagination/pagination.html",replace:!0,link:function(scope,element,attrs,paginationCtrl){function makePage(number,text,isActive,isDisabled){return{number:number,text:text,active:isActive,disabled:isDisabled}}var maxSize,boundaryLinks=paginationCtrl.getAttributeValue(attrs.boundaryLinks,config.boundaryLinks),directionLinks=paginationCtrl.getAttributeValue(attrs.directionLinks,config.directionLinks),firstText=paginationCtrl.getAttributeValue(attrs.firstText,config.firstText,!0),previousText=paginationCtrl.getAttributeValue(attrs.previousText,config.previousText,!0),nextText=paginationCtrl.getAttributeValue(attrs.nextText,config.nextText,!0),lastText=paginationCtrl.getAttributeValue(attrs.lastText,config.lastText,!0),rotate=paginationCtrl.getAttributeValue(attrs.rotate,config.rotate);paginationCtrl.init(config.itemsPerPage),attrs.maxSize&&scope.$parent.$watch($parse(attrs.maxSize),function(value){maxSize=parseInt(value,10),paginationCtrl.render()}),paginationCtrl.getPages=function(currentPage,totalPages){var pages=[],startPage=1,endPage=totalPages,isMaxSized=angular.isDefined(maxSize)&&totalPages>maxSize;isMaxSized&&(rotate?(startPage=Math.max(currentPage-Math.floor(maxSize/2),1),endPage=startPage+maxSize-1,endPage>totalPages&&(endPage=totalPages,startPage=endPage-maxSize+1)):(startPage=(Math.ceil(currentPage/maxSize)-1)*maxSize+1,endPage=Math.min(startPage+maxSize-1,totalPages)));for(var number=startPage;endPage>=number;number++){var page=makePage(number,number,paginationCtrl.isActive(number),!1); pages.push(page)}if(isMaxSized&&!rotate){if(startPage>1){var previousPageSet=makePage(startPage-1,"...",!1,!1);pages.unshift(previousPageSet)}if(totalPages>endPage){var nextPageSet=makePage(endPage+1,"...",!1,!1);pages.push(nextPageSet)}}if(directionLinks){var previousPage=makePage(currentPage-1,previousText,!1,paginationCtrl.noPrevious());pages.unshift(previousPage);var nextPage=makePage(currentPage+1,nextText,!1,paginationCtrl.noNext());pages.push(nextPage)}if(boundaryLinks){var firstPage=makePage(1,firstText,!1,paginationCtrl.noPrevious());pages.unshift(firstPage);var lastPage=makePage(totalPages,lastText,!1,paginationCtrl.noNext());pages.push(lastPage)}return pages}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(config){return{restrict:"EA",scope:{page:"=",totalItems:"=",onSelectPage:" &"},controller:"PaginationController",templateUrl:"template/pagination/pager.html",replace:!0,link:function(scope,element,attrs,paginationCtrl){function makePage(number,text,isDisabled,isPrevious,isNext){return{number:number,text:text,disabled:isDisabled,previous:align&&isPrevious,next:align&&isNext}}var previousText=paginationCtrl.getAttributeValue(attrs.previousText,config.previousText,!0),nextText=paginationCtrl.getAttributeValue(attrs.nextText,config.nextText,!0),align=paginationCtrl.getAttributeValue(attrs.align,config.align);paginationCtrl.init(config.itemsPerPage),paginationCtrl.getPages=function(currentPage){return[makePage(currentPage-1,previousText,paginationCtrl.noPrevious(),!0,!1),makePage(currentPage+1,nextText,paginationCtrl.noNext(),!1,!0)]}}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",function(){function snake_case(name){var regexp=/[A-Z]/g,separator="-";return name.replace(regexp,function(letter,pos){return(pos?separator:"")+letter.toLowerCase()})}var defaultOptions={placement:"top",animation:!0,popupDelay:0},triggerMap={mouseenter:"mouseleave",click:"click",focus:"blur"},globalOptions={};this.options=function(value){angular.extend(globalOptions,value)},this.setTriggers=function(triggers){angular.extend(triggerMap,triggers)},this.$get=["$window","$compile","$timeout","$parse","$document","$position","$interpolate",function($window,$compile,$timeout,$parse,$document,$position,$interpolate){return function(type,prefix,defaultTriggerShow){function getTriggers(trigger){var show=trigger||options.trigger||defaultTriggerShow,hide=triggerMap[show]||show;return{show:show,hide:hide}}var options=angular.extend({},defaultOptions,globalOptions),directiveName=snake_case(type),startSym=$interpolate.startSymbol(),endSym=$interpolate.endSymbol(),template="
';return{restrict:"EA",scope:!0,compile:function(){var tooltipLinker=$compile(template);return function(scope,element,attrs){function toggleTooltipBind(){scope.tt_isOpen?hideTooltipBind():showTooltipBind()}function showTooltipBind(){(!hasEnableExp||scope.$eval(attrs[prefix+"Enable"]))&&(scope.tt_popupDelay?(popupTimeout=$timeout(show,scope.tt_popupDelay,!1),popupTimeout.then(function(reposition){reposition()})):show()())}function hideTooltipBind(){scope.$apply(function(){hide()})}function show(){return scope.tt_content?(createTooltip(),transitionTimeout&&$timeout.cancel(transitionTimeout),tooltip.css({top:0,left:0,display:"block"}),appendToBody?$document.find("body").append(tooltip):element.after(tooltip),positionTooltip(),scope.tt_isOpen=!0,scope.$digest(),positionTooltip):angular.noop}function hide(){scope.tt_isOpen=!1,$timeout.cancel(popupTimeout),scope.tt_animation?transitionTimeout=$timeout(removeTooltip,500):removeTooltip()}function createTooltip(){tooltip&&removeTooltip(),tooltip=tooltipLinker(scope,function(){}),scope.$digest()}function removeTooltip(){tooltip&&(tooltip.remove(),tooltip=null)}var tooltip,transitionTimeout,popupTimeout,appendToBody=angular.isDefined(options.appendToBody)?options.appendToBody:!1,triggers=getTriggers(void 0),hasRegisteredTriggers=!1,hasEnableExp=angular.isDefined(attrs[prefix+"Enable"]),positionTooltip=function(){var position,ttWidth,ttHeight,ttPosition;switch(position=appendToBody?$position.offset(element):$position.position(element),ttWidth=tooltip.prop("offsetWidth"),ttHeight=tooltip.prop("offsetHeight"),scope.tt_placement){case"right":ttPosition={top:position.top+position.height/2-ttHeight/2,left:position.left+position.width};break;case"bottom":ttPosition={top:position.top+position.height,left:position.left+position.width/2-ttWidth/2};break;case"left":ttPosition={top:position.top+position.height/2-ttHeight/2,left:position.left-ttWidth};break;default:ttPosition={top:position.top-ttHeight,left:position.left+position.width/2-ttWidth/2}}ttPosition.top+="px",ttPosition.left+="px",tooltip.css(ttPosition)};scope.tt_isOpen=!1,attrs.$observe(type,function(val){scope.tt_content=val,!val&&scope.tt_isOpen&&hide()}),attrs.$observe(prefix+"Title",function(val){scope.tt_title=val}),attrs.$observe(prefix+"Placement",function(val){scope.tt_placement=angular.isDefined(val)?val:options.placement}),attrs.$observe(prefix+"PopupDelay",function(val){var delay=parseInt(val,10);scope.tt_popupDelay=isNaN(delay)?options.popupDelay:delay});var unregisterTriggers=function(){hasRegisteredTriggers&&(element.unbind(triggers.show,showTooltipBind),element.unbind(triggers.hide,hideTooltipBind))};attrs.$observe(prefix+"Trigger",function(val){unregisterTriggers(),triggers=getTriggers(val),triggers.show===triggers.hide?element.bind(triggers.show,toggleTooltipBind):(element.bind(triggers.show,showTooltipBind),element.bind(triggers.hide,hideTooltipBind)),hasRegisteredTriggers=!0});var animation=scope.$eval(attrs[prefix+"Animation"]);scope.tt_animation=angular.isDefined(animation)?!!animation:options.animation,attrs.$observe(prefix+"AppendToBody",function(val){appendToBody=angular.isDefined(val)?$parse(val)(scope):appendToBody}),appendToBody&&scope.$on("$locationChangeSuccess",function(){scope.tt_isOpen&&hide()}),scope.$on("$destroy",function(){$timeout.cancel(transitionTimeout),$timeout.cancel(popupTimeout),unregisterTriggers(),removeTooltip()})}}}}}]}).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function($tooltip){return $tooltip("tooltip","tooltip","mouseenter")}]).directive("tooltipHtmlUnsafePopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}}).directive("tooltipHtmlUnsafe",["$tooltip",function($tooltip){return $tooltip("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",["$tooltip",function($tooltip){return $tooltip("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",["ui.bootstrap.transition"]).constant("progressConfig",{animate:!0,max:100}).controller("ProgressController",["$scope","$attrs","progressConfig","$transition",function($scope,$attrs,progressConfig,$transition){var self=this,bars=[],max=angular.isDefined($attrs.max)?$scope.$parent.$eval($attrs.max):progressConfig.max,animate=angular.isDefined($attrs.animate)?$scope.$parent.$eval($attrs.animate):progressConfig.animate;this.addBar=function(bar,element){var oldValue=0,index=bar.$parent.$index;angular.isDefined(index)&&bars[index]&&(oldValue=bars[index].value),bars.push(bar),this.update(element,bar.value,oldValue),bar.$watch("value",function(value,oldValue){value!==oldValue&&self.update(element,value,oldValue)}),bar.$on("$destroy",function(){self.removeBar(bar)})},this.update=function(element,newValue,oldValue){var percent=this.getPercentage(newValue);animate?(element.css("width",this.getPercentage(oldValue)+"%"),$transition(element,{width:percent+"%"})):element.css({transition:"none",width:percent+"%"})},this.removeBar=function(bar){bars.splice(bars.indexOf(bar),1)},this.getPercentage=function(value){return Math.round(100*value/max)}}]).directive("progress",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{},template:'
'}}).directive("bar",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(scope,element,attrs,progressCtrl){progressCtrl.addBar(scope,element)}}}).directive("progressbar",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(scope,element,attrs,progressCtrl){progressCtrl.addBar(scope,angular.element(element.children()[0]))}}}),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","$parse","ratingConfig",function($scope,$attrs,$parse,ratingConfig){this.maxRange=angular.isDefined($attrs.max)?$scope.$parent.$eval($attrs.max):ratingConfig.max,this.stateOn=angular.isDefined($attrs.stateOn)?$scope.$parent.$eval($attrs.stateOn):ratingConfig.stateOn,this.stateOff=angular.isDefined($attrs.stateOff)?$scope.$parent.$eval($attrs.stateOff):ratingConfig.stateOff,this.createRateObjects=function(states){for(var defaultOptions={stateOn:this.stateOn,stateOff:this.stateOff},i=0,n=states.length;n>i;i++)states[i]=angular.extend({index:i},defaultOptions,states[i]);return states},$scope.range=this.createRateObjects(angular.isDefined($attrs.ratingStates)?angular.copy($scope.$parent.$eval($attrs.ratingStates)):new Array(this.maxRange)),$scope.rate=function(value){$scope.value===value||$scope.readonly||($scope.value=value)},$scope.enter=function(value){$scope.readonly||($scope.val=value),$scope.onHover({value:value})},$scope.reset=function(){$scope.val=angular.copy($scope.value),$scope.onLeave()},$scope.$watch("value",function(value){$scope.val=value}),$scope.readonly=!1,$attrs.readonly&&$scope.$parent.$watch($parse($attrs.readonly),function(value){$scope.readonly=!!value})}]).directive("rating",function(){return{restrict:"EA",scope:{value:"=",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0}}),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function($scope){var ctrl=this,tabs=ctrl.tabs=$scope.tabs=[];ctrl.select=function(tab){angular.forEach(tabs,function(tab){tab.active=!1}),tab.active=!0},ctrl.addTab=function(tab){tabs.push(tab),(1===tabs.length||tab.active)&&ctrl.select(tab)},ctrl.removeTab=function(tab){var index=tabs.indexOf(tab);if(tab.active&&tabs.length>1){var newActiveIndex=index==tabs.length-1?index-1:index+1;ctrl.select(tabs[newActiveIndex])}tabs.splice(index,1)}}]).directive("tabset",function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(scope,element,attrs){scope.vertical=angular.isDefined(attrs.vertical)?scope.$parent.$eval(attrs.vertical):!1,scope.justified=angular.isDefined(attrs.justified)?scope.$parent.$eval(attrs.justified):!1,scope.type=angular.isDefined(attrs.type)?scope.$parent.$eval(attrs.type):"tabs"}}}).directive("tab",["$parse",function($parse){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},compile:function(elm,attrs,transclude){return function(scope,elm,attrs,tabsetCtrl){var getActive,setActive;attrs.active?(getActive=$parse(attrs.active),setActive=getActive.assign,scope.$parent.$watch(getActive,function(value,oldVal){value!==oldVal&&(scope.active=!!value)}),scope.active=getActive(scope.$parent)):setActive=getActive=angular.noop,scope.$watch("active",function(active){setActive(scope.$parent,active),active?(tabsetCtrl.select(scope),scope.onSelect()):scope.onDeselect()}),scope.disabled=!1,attrs.disabled&&scope.$parent.$watch($parse(attrs.disabled),function(value){scope.disabled=!!value}),scope.select=function(){scope.disabled||(scope.active=!0)},tabsetCtrl.addTab(scope),scope.$on("$destroy",function(){tabsetCtrl.removeTab(scope)}),scope.$transcludeFn=transclude}}}}]).directive("tabHeadingTransclude",[function(){return{restrict:"A",require:"^tab",link:function(scope,elm){scope.$watch("headingElement",function(heading){heading&&(elm.html(""),elm.append(heading))})}}}]).directive("tabContentTransclude",function(){function isTabHeading(node){return node.tagName&&(node.hasAttribute("tab-heading")||node.hasAttribute("data-tab-heading")||"tab-heading"===node.tagName.toLowerCase()||"data-tab-heading"===node.tagName.toLowerCase())}return{restrict:"A",require:"^tabset",link:function(scope,elm,attrs){var tab=scope.$eval(attrs.tabContentTransclude);tab.$transcludeFn(tab.$parent,function(contents){angular.forEach(contents,function(node){isTabHeading(node)?tab.headingElement=node:elm.append(node)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0}).directive("timepicker",["$parse","$log","timepickerConfig","$locale",function($parse,$log,timepickerConfig,$locale){return{restrict:"EA",require:"?^ngModel",replace:!0,scope:{},templateUrl:"template/timepicker/timepicker.html",link:function(scope,element,attrs,ngModel){function getHoursFromTemplate(){var hours=parseInt(scope.hours,10),valid=scope.showMeridian?hours>0&&13>hours:hours>=0&&24>hours;return valid?(scope.showMeridian&&(12===hours&&(hours=0),scope.meridian===meridians[1]&&(hours+=12)),hours):void 0}function getMinutesFromTemplate(){var minutes=parseInt(scope.minutes,10);return minutes>=0&&60>minutes?minutes:void 0}function pad(value){return angular.isDefined(value)&&value.toString().length<2?"0"+value:value}function refresh(keyboardChange){makeValid(),ngModel.$setViewValue(new Date(selected)),updateTemplate(keyboardChange)}function makeValid(){ngModel.$setValidity("time",!0),scope.invalidHours=!1,scope.invalidMinutes=!1}function updateTemplate(keyboardChange){var hours=selected.getHours(),minutes=selected.getMinutes();scope.showMeridian&&(hours=0===hours||12===hours?12:hours%12),scope.hours="h"===keyboardChange?hours:pad(hours),scope.minutes="m"===keyboardChange?minutes:pad(minutes),scope.meridian=selected.getHours()<12?meridians[0]:meridians[1]}function addMinutes(minutes){var dt=new Date(selected.getTime()+6e4*minutes);selected.setHours(dt.getHours(),dt.getMinutes()),refresh()}if(ngModel){var selected=new Date,meridians=angular.isDefined(attrs.meridians)?scope.$parent.$eval(attrs.meridians):timepickerConfig.meridians||$locale.DATETIME_FORMATS.AMPMS,hourStep=timepickerConfig.hourStep;attrs.hourStep&&scope.$parent.$watch($parse(attrs.hourStep),function(value){hourStep=parseInt(value,10)});var minuteStep=timepickerConfig.minuteStep;attrs.minuteStep&&scope.$parent.$watch($parse(attrs.minuteStep),function(value){minuteStep=parseInt(value,10)}),scope.showMeridian=timepickerConfig.showMeridian,attrs.showMeridian&&scope.$parent.$watch($parse(attrs.showMeridian),function(value){if(scope.showMeridian=!!value,ngModel.$error.time){var hours=getHoursFromTemplate(),minutes=getMinutesFromTemplate();angular.isDefined(hours)&&angular.isDefined(minutes)&&(selected.setHours(hours),refresh())}else updateTemplate()});var inputs=element.find("input"),hoursInputEl=inputs.eq(0),minutesInputEl=inputs.eq(1),mousewheel=angular.isDefined(attrs.mousewheel)?scope.$eval(attrs.mousewheel):timepickerConfig.mousewheel;if(mousewheel){var isScrollingUp=function(e){e.originalEvent&&(e=e.originalEvent);var delta=e.wheelDelta?e.wheelDelta:-e.deltaY;return e.detail||delta>0};hoursInputEl.bind("mousewheel wheel",function(e){scope.$apply(isScrollingUp(e)?scope.incrementHours():scope.decrementHours()),e.preventDefault()}),minutesInputEl.bind("mousewheel wheel",function(e){scope.$apply(isScrollingUp(e)?scope.incrementMinutes():scope.decrementMinutes()),e.preventDefault()})}if(scope.readonlyInput=angular.isDefined(attrs.readonlyInput)?scope.$eval(attrs.readonlyInput):timepickerConfig.readonlyInput,scope.readonlyInput)scope.updateHours=angular.noop,scope.updateMinutes=angular.noop;else{var invalidate=function(invalidHours,invalidMinutes){ngModel.$setViewValue(null),ngModel.$setValidity("time",!1),angular.isDefined(invalidHours)&&(scope.invalidHours=invalidHours),angular.isDefined(invalidMinutes)&&(scope.invalidMinutes=invalidMinutes)};scope.updateHours=function(){var hours=getHoursFromTemplate();angular.isDefined(hours)?(selected.setHours(hours),refresh("h")):invalidate(!0)},hoursInputEl.bind("blur",function(){!scope.validHours&&scope.hours<10&&scope.$apply(function(){scope.hours=pad(scope.hours)})}),scope.updateMinutes=function(){var minutes=getMinutesFromTemplate();angular.isDefined(minutes)?(selected.setMinutes(minutes),refresh("m")):invalidate(void 0,!0)},minutesInputEl.bind("blur",function(){!scope.invalidMinutes&&scope.minutes<10&&scope.$apply(function(){scope.minutes=pad(scope.minutes)})})}ngModel.$render=function(){var date=ngModel.$modelValue?new Date(ngModel.$modelValue):null;isNaN(date)?(ngModel.$setValidity("time",!1),$log.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.')):(date&&(selected=date),makeValid(),updateTemplate())},scope.incrementHours=function(){addMinutes(60*hourStep)},scope.decrementHours=function(){addMinutes(60*-hourStep)},scope.incrementMinutes=function(){addMinutes(minuteStep)},scope.decrementMinutes=function(){addMinutes(-minuteStep)},scope.toggleMeridian=function(){addMinutes(720*(selected.getHours()<12?1:-1))}}}}}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function($parse){var TYPEAHEAD_REGEXP=/^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;return{parse:function(input){var match=input.match(TYPEAHEAD_REGEXP);if(!match)throw new Error("Expected typeahead specification in form of '_modelValue_ (as _label_)? for _item_ in _collection_' but got '"+input+"'.");return{itemName:match[3],source:$parse(match[4]),viewMapper:$parse(match[2]||match[1]),modelMapper:$parse(match[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function($compile,$parse,$q,$timeout,$document,$position,typeaheadParser){var HOT_KEYS=[9,13,27,38,40];return{require:"ngModel",link:function(originalScope,element,attrs,modelCtrl){var hasFocus,minSearch=originalScope.$eval(attrs.typeaheadMinLength)||1,waitTime=originalScope.$eval(attrs.typeaheadWaitMs)||0,isEditable=originalScope.$eval(attrs.typeaheadEditable)!==!1,isLoadingSetter=$parse(attrs.typeaheadLoading).assign||angular.noop,onSelectCallback=$parse(attrs.typeaheadOnSelect),inputFormatter=attrs.typeaheadInputFormatter?$parse(attrs.typeaheadInputFormatter):void 0,appendToBody=attrs.typeaheadAppendToBody?$parse(attrs.typeaheadAppendToBody):!1,$setModelValue=$parse(attrs.ngModel).assign,parserResult=typeaheadParser.parse(attrs.typeahead),popUpEl=angular.element("
");popUpEl.attr({matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"}),angular.isDefined(attrs.typeaheadTemplateUrl)&&popUpEl.attr("template-url",attrs.typeaheadTemplateUrl);var scope=originalScope.$new();originalScope.$on("$destroy",function(){scope.$destroy()});var resetMatches=function(){scope.matches=[],scope.activeIdx=-1},getMatchesAsync=function(inputValue){var locals={$viewValue:inputValue};isLoadingSetter(originalScope,!0),$q.when(parserResult.source(originalScope,locals)).then(function(matches){if(inputValue===modelCtrl.$viewValue&&hasFocus){if(matches.length>0){scope.activeIdx=0,scope.matches.length=0;for(var i=0;i=minSearch?waitTime>0?(timeoutPromise&&$timeout.cancel(timeoutPromise),timeoutPromise=$timeout(function(){getMatchesAsync(inputValue)},waitTime)):getMatchesAsync(inputValue):(isLoadingSetter(originalScope,!1),resetMatches()),isEditable?inputValue:inputValue?void modelCtrl.$setValidity("editable",!1):(modelCtrl.$setValidity("editable",!0),inputValue)}),modelCtrl.$formatters.push(function(modelValue){var candidateViewValue,emptyViewValue,locals={};return inputFormatter?(locals.$model=modelValue,inputFormatter(originalScope,locals)):(locals[parserResult.itemName]=modelValue,candidateViewValue=parserResult.viewMapper(originalScope,locals),locals[parserResult.itemName]=void 0,emptyViewValue=parserResult.viewMapper(originalScope,locals),candidateViewValue!==emptyViewValue?candidateViewValue:modelValue)}),scope.select=function(activeIdx){var model,item,locals={};locals[parserResult.itemName]=item=scope.matches[activeIdx].model,model=parserResult.modelMapper(originalScope,locals),$setModelValue(originalScope,model),modelCtrl.$setValidity("editable",!0),onSelectCallback(originalScope,{$item:item,$model:model,$label:parserResult.viewMapper(originalScope,locals)}),resetMatches(),element[0].focus()},element.bind("keydown",function(evt){0!==scope.matches.length&&-1!==HOT_KEYS.indexOf(evt.which)&&(evt.preventDefault(),40===evt.which?(scope.activeIdx=(scope.activeIdx+1)%scope.matches.length,scope.$digest()):38===evt.which?(scope.activeIdx=(scope.activeIdx?scope.activeIdx:scope.matches.length)-1,scope.$digest()):13===evt.which||9===evt.which?scope.$apply(function(){scope.select(scope.activeIdx)}):27===evt.which&&(evt.stopPropagation(),resetMatches(),scope.$digest()))}),element.bind("blur",function(){hasFocus=!1});var dismissClickHandler=function(evt){element[0]!==evt.target&&(resetMatches(),scope.$digest())};$document.bind("click",dismissClickHandler),originalScope.$on("$destroy",function(){$document.unbind("click",dismissClickHandler)});var $popup=$compile(popUpEl)(scope);appendToBody?$document.find("body").append($popup):element.after($popup)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead-popup.html",link:function(scope,element,attrs){scope.templateUrl=attrs.templateUrl,scope.isOpen=function(){return scope.matches.length>0},scope.isActive=function(matchIdx){return scope.active==matchIdx},scope.selectActive=function(matchIdx){scope.active=matchIdx},scope.selectMatch=function(activeIdx){scope.select({activeIdx:activeIdx})}}}}).directive("typeaheadMatch",["$http","$templateCache","$compile","$parse",function($http,$templateCache,$compile,$parse){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(scope,element,attrs){var tplUrl=$parse(attrs.templateUrl)(scope.$parent)||"template/typeahead/typeahead-match.html";$http.get(tplUrl,{cache:$templateCache}).success(function(tplContent){element.replaceWith($compile(tplContent.trim())(scope))})}}}]).filter("typeaheadHighlight",function(){function escapeRegexp(queryToEscape){return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(matchItem,query){return query?matchItem.replace(new RegExp(escapeRegexp(query),"gi"),"$&"):matchItem}}),angular.module("template/accordion/accordion-group.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/accordion/accordion-group.html",'
\n
\n

\n {{heading}}\n

\n
\n
\n
\n
\n
')}]),angular.module("template/accordion/accordion.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/accordion/accordion.html",'
')}]),angular.module("template/alert/alert.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/alert/alert.html","
\n \n
\n
\n")}]),angular.module("template/carousel/carousel.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/carousel/carousel.html",'\n')}]),angular.module("template/carousel/slide.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/carousel/slide.html","
\n")}]),angular.module("template/datepicker/datepicker.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/datepicker/datepicker.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
#{{label}}
{{ getWeekNumber(row) }}\n \n
\n')}]),angular.module("template/datepicker/popup.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/datepicker/popup.html","
    \n
  • \n"+'
  • \n \n \n \n \n \n \n
  • \n
\n')}]),angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/modal/backdrop.html",'')}]),angular.module("template/modal/window.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/modal/window.html",'')}]),angular.module("template/pagination/pager.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/pagination/pager.html",'')}]),angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/pagination/pagination.html",'')}]),angular.module("template/tooltip/tooltip-html-unsafe-popup.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/tooltip/tooltip-html-unsafe-popup.html",'
\n
\n
\n
\n')}]),angular.module("template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/tooltip/tooltip-popup.html",'
\n
\n
\n
\n')}]),angular.module("template/popover/popover.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/popover/popover.html",'
\n
\n\n
\n

\n
\n
\n
\n')}]),angular.module("template/progressbar/bar.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/progressbar/bar.html",'
')}]),angular.module("template/progressbar/progress.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/progressbar/progress.html",'
')}]),angular.module("template/progressbar/progressbar.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/progressbar/progressbar.html",'
') }]),angular.module("template/rating/rating.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/rating/rating.html",'\n \n')}]),angular.module("template/tabs/tab.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/tabs/tab.html",'
  • \n {{heading}}\n
  • \n')}]),angular.module("template/tabs/tabset-titles.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/tabs/tabset-titles.html","
      \n
    \n")}]),angular.module("template/tabs/tabset.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/tabs/tabset.html",'\n
    \n \n
    \n
    \n
    \n
    \n
    \n')}]),angular.module("template/timepicker/timepicker.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/timepicker/timepicker.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
     
    \n \n :\n \n
     
    \n')}]),angular.module("template/typeahead/typeahead-match.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/typeahead/typeahead-match.html",'')}]),angular.module("template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("template/typeahead/typeahead-popup.html","
      \n"+'
    • \n
      \n
    • \n
    ')}]),angular.module("ui.alias",[]).config(["$compileProvider","uiAliasConfig",function(a,b){b=b||{},angular.forEach(b,function(b,c){angular.isString(b)&&(b={replace:!0,template:b}),a.directive(c,function(){return b})})}]),angular.module("ui.event",[]).directive("uiEvent",["$parse",function(a){return function(b,c,d){var e=b.$eval(d.uiEvent);angular.forEach(e,function(d,e){var f=a(d);c.bind(e,function(a){var c=Array.prototype.slice.call(arguments);c=c.splice(1),f(b,{$event:a,$params:c}),b.$$phase||b.$apply()})})}}]),angular.module("ui.format",[]).filter("format",function(){return function(a,b){var c=a;if(angular.isString(c)&&void 0!==b)if(angular.isArray(b)||angular.isObject(b)||(b=[b]),angular.isArray(b)){var d=b.length,e=function(a,c){return c=parseInt(c,10),c>=0&&d>c?b[c]:a};c=c.replace(/\$([0-9]+)/g,e)}else angular.forEach(b,function(a,b){c=c.split(":"+b).join(a)});return c}}),angular.module("ui.highlight",[]).filter("highlight",function(){return function(a,b,c){return b||angular.isNumber(b)?(a=a.toString(),b=b.toString(),c?a.split(b).join(''+b+""):a.replace(new RegExp(b,"gi"),'$&')):a}}),angular.module("ui.include",[]).directive("uiInclude",["$http","$templateCache","$anchorScroll","$compile",function(a,b,c,d){return{restrict:"ECA",terminal:!0,compile:function(e,f){var g=f.uiInclude||f.src,h=f.fragment||"",i=f.onload||"",j=f.autoscroll;return function(e,f){function k(){var k=++m,o=e.$eval(g),p=e.$eval(h);o?a.get(o,{cache:b}).success(function(a){if(k===m){l&&l.$destroy(),l=e.$new();var b;b=p?angular.element("
    ").html(a).find(p):angular.element("
    ").html(a).contents(),f.html(b),d(b)(l),!angular.isDefined(j)||j&&!e.$eval(j)||c(),l.$emit("$includeContentLoaded"),e.$eval(i)}}).error(function(){k===m&&n()}):n()}var l,m=0,n=function(){l&&(l.$destroy(),l=null),f.html("")};e.$watch(h,k),e.$watch(g,k)}}}}]),angular.module("ui.indeterminate",[]).directive("uiIndeterminate",[function(){return{compile:function(a,b){return b.type&&"checkbox"===b.type.toLowerCase()?function(a,b,c){a.$watch(c.uiIndeterminate,function(a){b[0].indeterminate=!!a})}:angular.noop}}}]),angular.module("ui.inflector",[]).filter("inflector",function(){function a(a){return a.replace(/^([a-z])|\s+([a-z])/g,function(a){return a.toUpperCase()})}function b(a,b){return a.replace(/[A-Z]/g,function(a){return b+a})}var c={humanize:function(c){return a(b(c," ").split("_").join(" "))},underscore:function(a){return a.substr(0,1).toLowerCase()+b(a.substr(1),"_").toLowerCase().split(" ").join("_")},variable:function(b){return b=b.substr(0,1).toLowerCase()+a(b.split("_").join(" ")).substr(1).split(" ").join("")}};return function(a,b){return b!==!1&&angular.isString(a)?(b=b||"humanize",c[b](a)):a}}),angular.module("ui.jq",[]).value("uiJqConfig",{}).directive("uiJq",["uiJqConfig","$timeout",function(a,b){return{restrict:"A",compile:function(c,d){if(!angular.isFunction(c[d.uiJq]))throw new Error('ui-jq: The "'+d.uiJq+'" function does not exist');var e=a&&a[d.uiJq];return function(a,c,d){function f(){b(function(){c[d.uiJq].apply(c,g)},0,!1)}var g=[];d.uiOptions?(g=a.$eval("["+d.uiOptions+"]"),angular.isObject(e)&&angular.isObject(g[0])&&(g[0]=angular.extend({},e,g[0]))):e&&(g=[e]),d.ngModel&&c.is("select,input,textarea")&&c.bind("change",function(){c.trigger("input")}),d.uiRefresh&&a.$watch(d.uiRefresh,function(){f()}),f()}}}}]),angular.module("ui.keypress",[]).factory("keypressHelper",["$parse",function(a){var b={8:"backspace",9:"tab",13:"enter",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"delete"},c=function(a){return a.charAt(0).toUpperCase()+a.slice(1)};return function(d,e,f,g){var h,i=[];h=e.$eval(g["ui"+c(d)]),angular.forEach(h,function(b,c){var d,e;e=a(b),angular.forEach(c.split(" "),function(a){d={expression:e,keys:{}},angular.forEach(a.split("-"),function(a){d.keys[a]=!0}),i.push(d)})}),f.bind(d,function(a){var c=!(!a.metaKey||a.ctrlKey),f=!!a.altKey,g=!!a.ctrlKey,h=!!a.shiftKey,j=a.keyCode;"keypress"===d&&!h&&j>=97&&122>=j&&(j-=32),angular.forEach(i,function(d){var i=d.keys[b[j]]||d.keys[j.toString()],k=!!d.keys.meta,l=!!d.keys.alt,m=!!d.keys.ctrl,n=!!d.keys.shift;i&&k===c&&l===f&&m===g&&n===h&&e.$apply(function(){d.expression(e,{$event:a})})})})}}]),angular.module("ui.keypress").directive("uiKeydown",["keypressHelper",function(a){return{link:function(b,c,d){a("keydown",b,c,d)}}}]),angular.module("ui.keypress").directive("uiKeypress",["keypressHelper",function(a){return{link:function(b,c,d){a("keypress",b,c,d)}}}]),angular.module("ui.keypress").directive("uiKeyup",["keypressHelper",function(a){return{link:function(b,c,d){a("keyup",b,c,d)}}}]),angular.module("ui.mask",[]).value("uiMaskConfig",{maskDefinitions:{9:/\d/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}}).directive("uiMask",["uiMaskConfig",function(a){return{priority:100,require:"ngModel",restrict:"A",compile:function(){var b=a;return function(a,c,d,e){function f(a){return angular.isDefined(a)?(s(a),N?(k(),l(),!0):j()):j()}function g(a){angular.isDefined(a)&&(D=a,N&&w())}function h(a){return N?(G=o(a||""),I=n(G),e.$setValidity("mask",I),I&&G.length?p(G):void 0):a}function i(a){return N?(G=o(a||""),I=n(G),e.$viewValue=G.length?p(G):"",e.$setValidity("mask",I),""===G&&void 0!==e.$error.required&&e.$setValidity("required",!1),I?G:void 0):a}function j(){return N=!1,m(),angular.isDefined(P)?c.attr("placeholder",P):c.removeAttr("placeholder"),angular.isDefined(Q)?c.attr("maxlength",Q):c.removeAttr("maxlength"),c.val(e.$modelValue),e.$viewValue=e.$modelValue,!1}function k(){G=K=o(e.$modelValue||""),H=J=p(G),I=n(G);var a=I&&G.length?H:"";d.maxlength&&c.attr("maxlength",2*B[B.length-1]),c.attr("placeholder",D),c.val(a),e.$viewValue=a}function l(){O||(c.bind("blur",t),c.bind("mousedown mouseup",u),c.bind("input keyup click focus",w),O=!0)}function m(){O&&(c.unbind("blur",t),c.unbind("mousedown",u),c.unbind("mouseup",u),c.unbind("input",w),c.unbind("keyup",w),c.unbind("click",w),c.unbind("focus",w),O=!1)}function n(a){return a.length?a.length>=F:!0}function o(a){var b="",c=C.slice();return a=a.toString(),angular.forEach(E,function(b){a=a.replace(b,"")}),angular.forEach(a.split(""),function(a){c.length&&c[0].test(a)&&(b+=a,c.shift())}),b}function p(a){var b="",c=B.slice();return angular.forEach(D.split(""),function(d,e){a.length&&e===c[0]?(b+=a.charAt(0)||"_",a=a.substr(1),c.shift()):b+=d}),b}function q(a){var b=d.placeholder;return"undefined"!=typeof b&&b[a]?b[a]:"_"}function r(){return D.replace(/[_]+/g,"_").replace(/([^_]+)([a-zA-Z0-9])([^_])/g,"$1$2_$3").split("_")}function s(a){var b=0;if(B=[],C=[],D="","string"==typeof a){F=0;var c=!1,d=a.split("");angular.forEach(d,function(a,d){R.maskDefinitions[a]?(B.push(b),D+=q(d),C.push(R.maskDefinitions[a]),b++,c||F++):"?"===a?c=!0:(D+=a,b++)})}B.push(B.slice().pop()+1),E=r(),N=B.length>1?!0:!1}function t(){L=0,M=0,I&&0!==G.length||(H="",c.val(""),a.$apply(function(){e.$setViewValue("")}))}function u(a){"mousedown"===a.type?c.bind("mouseout",v):c.unbind("mouseout",v)}function v(){M=A(this),c.unbind("mouseout",v)}function w(b){b=b||{};var d=b.which,f=b.type;if(16!==d&&91!==d){var g,h=c.val(),i=J,j=o(h),k=K,l=!1,m=y(this)||0,n=L||0,q=m-n,r=B[0],s=B[j.length]||B.slice().shift(),t=M||0,u=A(this)>0,v=t>0,w=h.length>i.length||t&&h.length>i.length-t,C=h.length=37&&40>=d&&b.shiftKey,E=37===d,F=8===d||"keyup"!==f&&C&&-1===q,G=46===d||"keyup"!==f&&C&&0===q&&!v,H=(E||F||"click"===f)&&m>r;if(M=A(this),!D&&(!u||"click"!==f&&"keyup"!==f)){if("input"===f&&C&&!v&&j===k){for(;F&&m>r&&!x(m);)m--;for(;G&&s>m&&-1===B.indexOf(m);)m++;var I=B.indexOf(m);j=j.substring(0,I)+j.substring(I+1),l=!0}for(g=p(j),J=g,K=j,c.val(g),l&&a.$apply(function(){e.$setViewValue(j)}),w&&r>=m&&(m=r+1),H&&m--,m=m>s?s:r>m?r:m;!x(m)&&m>r&&s>m;)m+=H?-1:1;(H&&s>m||w&&!x(n))&&m++,L=m,z(this,m)}}}function x(a){return B.indexOf(a)>-1}function y(a){if(!a)return 0;if(void 0!==a.selectionStart)return a.selectionStart;if(document.selection){a.focus();var b=document.selection.createRange();return b.moveStart("character",-a.value.length),b.text.length}return 0}function z(a,b){if(!a)return 0;if(0!==a.offsetWidth&&0!==a.offsetHeight)if(a.setSelectionRange)a.focus(),a.setSelectionRange(b,b);else if(a.createTextRange){var c=a.createTextRange();c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",b),c.select()}}function A(a){return a?void 0!==a.selectionStart?a.selectionEnd-a.selectionStart:document.selection?document.selection.createRange().text.length:0:0}var B,C,D,E,F,G,H,I,J,K,L,M,N=!1,O=!1,P=d.placeholder,Q=d.maxlength,R={};d.uiOptions?(R=a.$eval("["+d.uiOptions+"]"),angular.isObject(R[0])&&(R=function(a,b){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]?angular.extend(b[c],a[c]):b[c]=angular.copy(a[c]));return b}(b,R[0]))):R=b,d.$observe("uiMask",f),d.$observe("placeholder",g),e.$formatters.push(h),e.$parsers.push(i),c.bind("mousedown mouseup",u),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){if(null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!==d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1})}}}}]),angular.module("ui.reset",[]).value("uiResetConfig",null).directive("uiReset",["uiResetConfig",function(a){var b=null;return void 0!==a&&(b=a),{require:"ngModel",link:function(a,c,d,e){var f;f=angular.element(''),c.wrap('').after(f),f.bind("click",function(c){c.preventDefault(),a.$apply(function(){e.$setViewValue(d.uiReset?a.$eval(d.uiReset):b),e.$render()})})}}}]),angular.module("ui.route",[]).directive("uiRoute",["$location","$parse",function(a,b){return{restrict:"AC",scope:!0,compile:function(c,d){var e;if(d.uiRoute)e="uiRoute";else if(d.ngHref)e="ngHref";else{if(!d.href)throw new Error("uiRoute missing a route or href property on "+c[0]);e="href"}return function(c,d,f){function g(b){var d=b.indexOf("#");d>-1&&(b=b.substr(d+1)),(j=function(){i(c,a.path().indexOf(b)>-1)})()}function h(b){var d=b.indexOf("#");d>-1&&(b=b.substr(d+1)),(j=function(){var d=new RegExp("^"+b+"$",["i"]);i(c,d.test(a.path()))})()}var i=b(f.ngModel||f.routeModel||"$uiRoute").assign,j=angular.noop;switch(e){case"uiRoute":f.uiRoute?h(f.uiRoute):f.$observe("uiRoute",h);break;case"ngHref":f.ngHref?g(f.ngHref):f.$observe("ngHref",g);break;case"href":g(f.href)}c.$on("$routeChangeSuccess",function(){j()}),c.$on("$stateChangeSuccess",function(){j()})}}}}]),angular.module("ui.scroll.jqlite",["ui.scroll"]).service("jqLiteExtras",["$log","$window",function(a,b){return{registerFor:function(a){var c,d,e,f,g,h,i;return d=angular.element.prototype.css,a.prototype.css=function(a,b){var c,e;return e=this,c=e[0],c&&3!==c.nodeType&&8!==c.nodeType&&c.style?d.call(e,a,b):void 0},h=function(a){return a&&a.document&&a.location&&a.alert&&a.setInterval},i=function(a,b,c){var d,e,f,g,i;return d=a[0],i={top:["scrollTop","pageYOffset","scrollLeft"],left:["scrollLeft","pageXOffset","scrollTop"]}[b],e=i[0],g=i[1],f=i[2],h(d)?angular.isDefined(c)?d.scrollTo(a[f].call(a),c):g in d?d[g]:d.document.documentElement[e]:angular.isDefined(c)?d[e]=c:d[e]},b.getComputedStyle?(f=function(a){return b.getComputedStyle(a,null)},c=function(a,b){return parseFloat(b)}):(f=function(a){return a.currentStyle},c=function(a,b){var c,d,e,f,g,h,i;return c=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,f=new RegExp("^("+c+")(?!px)[a-z%]+$","i"),f.test(b)?(i=a.style,d=i.left,g=a.runtimeStyle,h=g&&g.left,g&&(g.left=i.left),i.left=b,e=i.pixelLeft,i.left=d,h&&(g.left=h),e):parseFloat(b)}),e=function(a,b){var d,e,g,i,j,k,l,m,n,o,p,q,r;return h(a)?(d=document.documentElement[{height:"clientHeight",width:"clientWidth"}[b]],{base:d,padding:0,border:0,margin:0}):(r={width:[a.offsetWidth,"Left","Right"],height:[a.offsetHeight,"Top","Bottom"]}[b],d=r[0],l=r[1],m=r[2],k=f(a),p=c(a,k["padding"+l])||0,q=c(a,k["padding"+m])||0,e=c(a,k["border"+l+"Width"])||0,g=c(a,k["border"+m+"Width"])||0,i=k["margin"+l],j=k["margin"+m],n=c(a,i)||0,o=c(a,j)||0,{base:d,padding:p+q,border:e+g,margin:n+o})},g=function(a,b,c){var d,g,h;return g=e(a,b),g.base>0?{base:g.base-g.padding-g.border,outer:g.base,outerfull:g.base+g.margin}[c]:(d=f(a),h=d[b],(0>h||null===h)&&(h=a.style[b]||0),h=parseFloat(h)||0,{base:h-g.padding-g.border,outer:h,outerfull:h+g.padding+g.border+g.margin}[c])},angular.forEach({before:function(a){var b,c,d,e,f,g,h;if(f=this,c=f[0],e=f.parent(),b=e.contents(),b[0]===c)return e.prepend(a);for(d=g=1,h=b.length-1;h>=1?h>=g:g>=h;d=h>=1?++g:--g)if(b[d]===c)return void angular.element(b[d-1]).after(a);throw new Error("invalid DOM structure "+c.outerHTML)},height:function(a){var b;return b=this,angular.isDefined(a)?(angular.isNumber(a)&&(a+="px"),d.call(b,"height",a)):g(this[0],"height","base")},outerHeight:function(a){return g(this[0],"height",a?"outerfull":"outer")},offset:function(a){var b,c,d,e,f,g;return f=this,arguments.length?void 0===a?f:a:(b={top:0,left:0},e=f[0],(c=e&&e.ownerDocument)?(d=c.documentElement,e.getBoundingClientRect&&(b=e.getBoundingClientRect()),g=c.defaultView||c.parentWindow,{top:b.top+(g.pageYOffset||d.scrollTop)-(d.clientTop||0),left:b.left+(g.pageXOffset||d.scrollLeft)-(d.clientLeft||0)}):void 0)},scrollTop:function(a){return i(this,"top",a)},scrollLeft:function(a){return i(this,"left",a)}},function(b,c){return a.prototype[c]?void 0:a.prototype[c]=b})}}}]).run(["$log","$window","jqLiteExtras",function(a,b,c){return b.jQuery?void 0:c.registerFor(angular.element)}]),angular.module("ui.scroll",[]).directive("ngScrollViewport",["$log",function(){return{controller:["$scope","$element",function(a,b){return b}]}}]).directive("ngScroll",["$log","$injector","$rootScope","$timeout",function(a,b,c,d){return{require:["?^ngScrollViewport"],transclude:"element",priority:1e3,terminal:!0,compile:function(e,f,g){return function(f,h,i,j){var k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T;if(H=i.ngScroll.match(/^\s*(\w+)\s+in\s+(\w+)\s*$/),!H)throw new Error('Expected ngScroll in form of "item_ in _datasource_" but got "'+i.ngScroll+'"');if(F=H[1],v=H[2],D=function(a){return angular.isObject(a)&&a.get&&angular.isFunction(a.get)},u=f[v],!D(u)&&(u=b.get(v),!D(u)))throw new Error(v+" is not a valid datasource");return r=Math.max(3,+i.bufferSize||10),q=function(){return T.height()*Math.max(.1,+i.padding||.1)},O=function(a){return a[0].scrollHeight||a[0].document.documentElement.scrollHeight},k=null,g(R=f.$new(),function(a){var b,c,d,f,g,h;if(f=a[0].localName,"dl"===f)throw new Error("ng-scroll directive does not support <"+a[0].localName+"> as a repeating tag: "+a[0].outerHTML);return"li"!==f&&"tr"!==f&&(f="div"),h=j[0]||angular.element(window),h.css({"overflow-y":"auto",display:"block"}),d=function(a){var b,c,d;switch(a){case"tr":return d=angular.element("
    "),b=d.find("div"),c=d.find("tr"),c.paddingHeight=function(){return b.height.apply(b,arguments)},c;default:return c=angular.element("<"+a+">"),c.paddingHeight=c.height,c}},c=function(a,b,c){return b[{top:"before",bottom:"after"}[c]](a),{paddingHeight:function(){return a.paddingHeight.apply(a,arguments)},insert:function(b){return a[{top:"after",bottom:"before"}[c]](b)}}},g=c(d(f),e,"top"),b=c(d(f),e,"bottom"),R.$destroy(),k={viewport:h,topPadding:g.paddingHeight,bottomPadding:b.paddingHeight,append:b.insert,prepend:g.insert,bottomDataPos:function(){return O(h)-b.paddingHeight()},topDataPos:function(){return g.paddingHeight()}}}),T=k.viewport,B=1,I=1,p=[],J=[],x=!1,n=!1,G=u.loading||function(){},E=!1,L=function(a,b){var c,d;for(c=d=a;b>=a?b>d:d>b;c=b>=a?++d:--d)p[c].scope.$destroy(),p[c].element.remove();return p.splice(a,b-a)},K=function(){return B=1,I=1,L(0,p.length),k.topPadding(0),k.bottomPadding(0),J=[],x=!1,n=!1,l(!1)},o=function(){return T.scrollTop()+T.height()},S=function(){return T.scrollTop()},P=function(){return!x&&k.bottomDataPos()=g?0>=f:f>=0)&&(d=p[c].element.outerHeight(!0),k.bottomDataPos()-b-d>o()+q());c=0>=g?++f:--f)b+=d,e++,x=!1;return e>0?(k.bottomPadding(k.bottomPadding()+b),L(p.length-e,p.length),I-=e,a.log("clipped off bottom "+e+" bottom padding "+k.bottomPadding())):void 0},Q=function(){return!n&&k.topDataPos()>S()-q()},t=function(){var b,c,d,e,f,g;for(e=0,d=0,f=0,g=p.length;g>f&&(b=p[f],c=b.element.outerHeight(!0),k.topDataPos()+e+c0?(k.topPadding(k.topPadding()+e),L(0,d),B+=d,a.log("clipped off top "+d+" top padding "+k.topPadding())):void 0},w=function(a,b){return E||(E=!0,G(!0)),1===J.push(a)?z(b):void 0},C=function(a,b){var c,d,e;return c=f.$new(),c[F]=b,d=a>B,c.$index=a,d&&c.$index--,e={scope:c},g(c,function(b){return e.element=b,d?a===I?(k.append(b),p.push(e)):(p[a-B].element.after(b),p.splice(a-B+1,0,e)):(k.prepend(b),p.unshift(e))}),{appended:d,wrapper:e}},m=function(a,b){var c;return a?k.bottomPadding(Math.max(0,k.bottomPadding()-b.element.outerHeight(!0))):(c=k.topPadding()-b.element.outerHeight(!0),c>=0?k.topPadding(c):T.scrollTop(T.scrollTop()+b.element.outerHeight(!0)))},l=function(b,c,e){var f;return f=function(){return a.log("top {actual="+k.topDataPos()+" visible from="+S()+" bottom {visible through="+o()+" actual="+k.bottomDataPos()+"}"),P()?w(!0,b):Q()&&w(!1,b),e?e():void 0},c?d(function(){var a,b,d;for(b=0,d=c.length;d>b;b++)a=c[b],m(a.appended,a.wrapper);return f()}):f()},A=function(a,b){return l(a,b,function(){return J.shift(),0===J.length?(E=!1,G(!1)):z(a)})},z=function(b){var c;return c=J[0],c?p.length&&!P()?A(b):u.get(I,r,function(c){var d,e,f,g;if(e=[],0===c.length)x=!0,k.bottomPadding(0),a.log("appended: requested "+r+" records starting from "+I+" recieved: eof");else{for(t(),f=0,g=c.length;g>f;f++)d=c[f],e.push(C(++I,d));a.log("appended: requested "+r+" received "+c.length+" buffer size "+p.length+" first "+B+" next "+I)}return A(b,e)}):p.length&&!Q()?A(b):u.get(B-r,r,function(c){var d,e,f,g;if(e=[],0===c.length)n=!0,k.topPadding(0),a.log("prepended: requested "+r+" records starting from "+(B-r)+" recieved: bof");else{for(s(),d=f=g=c.length-1;0>=g?0>=f:f>=0;d=0>=g?++f:--f)e.unshift(C(--B,c[d]));a.log("prepended: requested "+r+" received "+c.length+" buffer size "+p.length+" first "+B+" next "+I)}return A(b,e)})},M=function(){return c.$$phase||E?void 0:(l(!1),f.$apply())},T.bind("resize",M),N=function(){return c.$$phase||E?void 0:(l(!0),f.$apply())},T.bind("scroll",N),f.$watch(u.revision,function(){return K()}),y=u.scope?u.scope.$new():f.$new(),f.$on("$destroy",function(){return y.$destroy(),T.unbind("resize",M),T.unbind("scroll",N)}),y.$on("update.items",function(a,b,c){var d,e,f,g,h;if(angular.isFunction(b))for(e=function(a){return b(a.scope)},f=0,g=p.length;g>f;f++)d=p[f],e(d);else 0<=(h=b-B-1)&&hh;h++)d=p[h],e.unshift(d);for(g=function(a){return b(a.scope)?(L(e.length-1-c,e.length-c),I--):void 0},c=i=0,m=e.length;m>i;c=++i)f=e[c],g(f)}else 0<=(o=b-B-1)&&oj;c=++j)d=p[c],d.scope.$index=B+c;return l(!1)}),y.$on("insert.item",function(a,b,c){var d,e,f,g,h,i,j,k,m,n,o,q;if(e=[],angular.isFunction(b)){for(f=[],i=0,m=p.length;m>i;i++)c=p[i],f.unshift(c);for(h=function(a){var f,g,h,i,j;if(g=b(a.scope)){if(C=function(a,b){return C(a,b),I++},angular.isArray(g)){for(j=[],f=h=0,i=g.length;i>h;f=++h)c=g[f],j.push(e.push(C(d+f,c)));return j}return e.push(C(d,g))}},d=j=0,n=f.length;n>j;d=++j)g=f[d],h(g)}else 0<=(q=b-B-1)&&qk;d=++k)c=p[d],c.scope.$index=B+d;return l(!1,e)})}}}}]),angular.module("ui.scrollfix",[]).directive("uiScrollfix",["$window",function(a){return{require:"^?uiScrollfixTarget",link:function(b,c,d,e){function f(){var b;if(angular.isDefined(a.pageYOffset))b=a.pageYOffset;else{var e=document.compatMode&&"BackCompat"!==document.compatMode?document.documentElement:document.body;b=e.scrollTop}!c.hasClass("ui-scrollfix")&&b>d.uiScrollfix?c.addClass("ui-scrollfix"):c.hasClass("ui-scrollfix")&&b")(i);j.append(k),i.count=f,void 0!==g&&k.eq(0).children().css("height",g),void 0!==h&&(k.eq(0).children().css("background-color",h),k.eq(0).children().css("color",h));var l=0;return{start:function(){this.show();var a=this;l=setInterval(function(){if(isNaN(f))clearInterval(l),f=0,a.hide();else{var b=100-f;f+=.15*Math.pow(1-Math.sqrt(b),2),a.updateCount(f)}},200)},updateCount:function(a){i.count=a,i.$$phase||i.$apply()},height:function(a){return void 0!==a&&(g=a,i.height=g,i.$$phase||i.$apply()),g},color:function(a){return void 0!==a&&(h=a,i.color=h,i.$$phase||i.$apply()),h},hide:function(){k.children().css("opacity","0");var a=this;e(function(){k.children().css("width","0%"),e(function(){a.show()},500)},500)},show:function(){e(function(){k.children().css("opacity","1")},100)},status:function(){return f},stop:function(){clearInterval(l)},set:function(a){return this.show(),this.updateCount(a),f=a,clearInterval(l),f},css:function(a){return k.children().css(a)},reset:function(){return clearInterval(l),f=0,this.updateCount(f),0},complete:function(){f=100,this.updateCount(f);var a=this;return e(function(){a.hide(),e(function(){f=0,a.updateCount(f)},500)},1e3),f}}}],this.setColor=function(a){return void 0!==a&&(this.color=a),this.color},this.setHeight=function(a){return void 0!==a&&(this.height=a),this.height}}),angular.module("ngProgress.directive",[]).directive("ngProgress",["$window","$rootScope",function(a,b){var c={replace:!0,restrict:"E",link:function(a,c){b.$watch("count",function(b){(void 0!==b||null!==b)&&(a.counter=b,c.eq(0).children().css("width",b+"%"))}),b.$watch("color",function(b){(void 0!==b||null!==b)&&(a.color=b,c.eq(0).children().css("background-color",b),c.eq(0).children().css("color",b))}),b.$watch("height",function(b){(void 0!==b||null!==b)&&(a.height=b,c.eq(0).children().css("height",b))})},template:'
    '};return c}]),angular.module("ngProgress",["ngProgress.directive","ngProgress.provider"]),angular.module("gettext",[]),angular.module("gettext").constant("gettext",function(a){return a}),angular.module("gettext").factory("gettextCatalog",["gettextPlurals","$http","$cacheFactory","$interpolate","$rootScope",function(a,b,c,d,e){var f,g=function(a){return f.debug&&f.currentLanguage!==f.baseLanguage?"[MISSING]: "+a:a};return f={debug:!1,strings:{},baseLanguage:"en",currentLanguage:"en",cache:c("strings"),setCurrentLanguage:function(a){this.currentLanguage=a,e.$broadcast("gettextLanguageChanged")},setStrings:function(a,b){this.strings[a]||(this.strings[a]={});for(var c in b){var d=b[c];this.strings[a][c]="string"==typeof d?[d]:d}},getStringForm:function(a,b){var c=this.strings[this.currentLanguage]||{},d=c[a]||[];return d[b]},getString:function(a,b){return a=this.getStringForm(a,0)||g(a),b?d(a)(b):a},getPlural:function(b,c,e,f){var h=a(this.currentLanguage,b);return c=this.getStringForm(c,h)||g(1===b?c:e),f?d(c)(f):c},loadRemote:function(a){return b({method:"GET",url:a,cache:f.cache}).success(function(a){for(var b in a)f.setStrings(b,a[b])})}}}]),angular.module("gettext").directive("translate",["gettextCatalog","$parse","$animate","$compile",function(a,b,c,d){function e(a,b,c){if(!a)throw new Error("You should add a "+b+" attribute whenever you add a "+c+" attribute.")}var f=function(){return String.prototype.trim?function(a){return"string"==typeof a?a.trim():a}:function(a){return"string"==typeof a?a.replace(/^\s*/,"").replace(/\s*$/,""):a}}();return{restrict:"A",terminal:!0,compile:function(g,h){e(!h.translatePlural||h.translateN,"translate-n","translate-plural"),e(!h.translateN||h.translatePlural,"translate-plural","translate-n");var i=f(g.html()),j=h.translatePlural;return{post:function(e,f,g){function h(){var b;j?(e=l||(l=e.$new()),e.$count=k(e),b=a.getPlural(e.$count,i,j)):b=a.getString(i);var g=angular.element(""+b+"");d(g.contents())(e);var h=f.contents(),m=g.contents();c.enter(m,f),c.leave(h)}var k=b(g.translateN),l=null;g.translateN&&e.$watch(g.translateN,h),e.$on("gettextLanguageChanged",h),h()}}}}}]),angular.module("gettext").filter("translate",["gettextCatalog",function(a){return function(b){return a.getString(b)}}]),angular.module("gettext").factory("gettextPlurals",function(){return function(a,b){switch(a){case"ay":case"bo":case"cgg":case"dz":case"fa":case"id":case"ja":case"jbo":case"ka":case"kk":case"km":case"ko":case"ky":case"lo":case"ms":case"my":case"sah":case"su":case"th":case"tt":case"ug":case"vi":case"wo":case"zh":return 0;case"is":return b%10!=1||b%100==11?1:0;case"jv":return 0!=b?1:0;case"mk":return 1==b||b%10==1?0:1;case"ach":case"ak":case"am":case"arn":case"br":case"fil":case"fr":case"gun":case"ln":case"mfe":case"mg":case"mi":case"oc":case"pt_BR":case"tg":case"ti":case"tr":case"uz":case"wa":case"zh":return b>1?1:0; -case"lv":return b%10==1&&b%100!=11?0:0!=b?1:2;case"lt":return b%10==1&&b%100!=11?0:b%10>=2&&(10>b%100||b%100>=20)?1:2;case"be":case"bs":case"hr":case"ru":case"sr":case"uk":return b%10==1&&b%100!=11?0:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?1:2;case"mnk":return 0==b?0:1==b?1:2;case"ro":return 1==b?0:0==b||b%100>0&&20>b%100?1:2;case"pl":return 1==b?0:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?1:2;case"cs":case"sk":return 1==b?0:b>=2&&4>=b?1:2;case"sl":return b%100==1?1:b%100==2?2:b%100==3||b%100==4?3:0;case"mt":return 1==b?0:0==b||b%100>1&&11>b%100?1:b%100>10&&20>b%100?2:3;case"gd":return 1==b||11==b?0:2==b||12==b?1:b>2&&20>b?2:3;case"cy":return 1==b?0:2==b?1:8!=b&&11!=b?2:3;case"kw":return 1==b?0:2==b?1:3==b?2:3;case"ga":return 1==b?0:2==b?1:7>b?2:11>b?3:4;case"ar":return 0==b?0:1==b?1:2==b?2:b%100>=3&&10>=b%100?3:b%100>=11?4:5;default:return 1!=b?1:0}}}); \ No newline at end of file +case"lv":return b%10==1&&b%100!=11?0:0!=b?1:2;case"lt":return b%10==1&&b%100!=11?0:b%10>=2&&(10>b%100||b%100>=20)?1:2;case"be":case"bs":case"hr":case"ru":case"sr":case"uk":return b%10==1&&b%100!=11?0:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?1:2;case"mnk":return 0==b?0:1==b?1:2;case"ro":return 1==b?0:0==b||b%100>0&&20>b%100?1:2;case"pl":return 1==b?0:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?1:2;case"cs":case"sk":return 1==b?0:b>=2&&4>=b?1:2;case"sl":return b%100==1?1:b%100==2?2:b%100==3||b%100==4?3:0;case"mt":return 1==b?0:0==b||b%100>1&&11>b%100?1:b%100>10&&20>b%100?2:3;case"gd":return 1==b||11==b?0:2==b||12==b?1:b>2&&20>b?2:3;case"cy":return 1==b?0:2==b?1:8!=b&&11!=b?2:3;case"kw":return 1==b?0:2==b?1:3==b?2:3;case"ga":return 1==b?0:2==b?1:7>b?2:11>b?3:4;case"ar":return 0==b?0:1==b?1:2==b?2:b%100>=3&&10>=b%100?3:b%100>=11?4:5;default:return 1!=b?1:0}}}),!function(){"use strict";function a(a,b){return a.module("angularMoment",[]).constant("angularMomentConfig",{preprocess:null,timezone:"",format:null}).constant("moment",b).constant("amTimeAgoConfig",{withoutSuffix:!1,serverTime:null}).directive("amTimeAgo",["$window","moment","amMoment","amTimeAgoConfig","angularMomentConfig",function(b,c,d,e,f){return function(g,h,i){function j(){var a;if(e.serverTime){var b=(new Date).getTime(),d=b-t+e.serverTime;a=c(d)}else a=c();return a}function k(){q&&(b.clearTimeout(q),q=null)}function l(a){if(h.text(a.from(j(),s)),!w){var c=j().diff(a,"minute"),d=3600;1>c?d=1:60>c?d=30:180>c&&(d=300),q=b.setTimeout(function(){l(a)},1e3*d)}}function m(a){x&&h.attr("datetime",a)}function n(){if(k(),o){var a=d.preprocessDate(o,u,r);l(a),m(a.toISOString())}}var o,p,q=null,r=f.format,s=e.withoutSuffix,t=(new Date).getTime(),u=f.preprocess,v=i.amTimeAgo.replace(/^::/,""),w=0===i.amTimeAgo.indexOf("::"),x="TIME"===h[0].nodeName.toUpperCase();p=g.$watch(v,function(a){return"undefined"==typeof a||null===a||""===a?(k(),void(o&&(h.text(""),m(""),o=null))):(o=a,n(),void(void 0!==a&&w&&p()))}),a.isDefined(i.amWithoutSuffix)&&g.$watch(i.amWithoutSuffix,function(a){"boolean"==typeof a?(s=a,n()):s=e.withoutSuffix}),i.$observe("amFormat",function(a){"undefined"!=typeof a&&(r=a,n())}),i.$observe("amPreprocess",function(a){u=a,n()}),g.$on("$destroy",function(){k()}),g.$on("amMoment:languageChange",function(){n()})}}]).service("amMoment",["moment","$rootScope","$log","angularMomentConfig",function(b,c,d,e){this.preprocessors={utc:b.utc,unix:b.unix},this.changeLanguage=function(d){var e=b.lang(d);return a.isDefined(d)&&c.$broadcast("amMoment:languageChange"),e},this.preprocessDate=function(c,f,g){return a.isUndefined(f)&&(f=e.preprocess),this.preprocessors[f]?this.preprocessors[f](c,g):(f&&d.warn("angular-moment: Ignoring unsupported value for preprocess: "+f),!isNaN(parseFloat(c))&&isFinite(c)?b(parseInt(c,10)):b(c,g))},this.applyTimezone=function(a){var b=e.timezone;return a&&b&&(a.tz?a=a.tz(b):d.warn("angular-moment: timezone specified but moment.tz() is undefined. Did you forget to include moment-timezone.js?")),a}}]).filter("amCalendar",["moment","amMoment",function(a,b){return function(c,d){if("undefined"==typeof c||null===c)return"";c=b.preprocessDate(c,d);var e=a(c);return e.isValid()?b.applyTimezone(e).calendar():""}}]).filter("amDateFormat",["moment","amMoment",function(a,b){return function(c,d,e){if("undefined"==typeof c||null===c)return"";c=b.preprocessDate(c,e);var f=a(c);return f.isValid()?b.applyTimezone(f).format(d):""}}]).filter("amDurationFormat",["moment",function(a){return function(b,c,d){return"undefined"==typeof b||null===b?"":a.duration(b,c).humanize(d)}}])}"function"==typeof define&&define.amd?define("angular-moment",["angular","moment"],a):a(angular,window.moment)}(); \ No newline at end of file diff --git a/public/js/main.min.js b/public/js/main.min.js index 2dedac8..5cabf51 100644 --- a/public/js/main.min.js +++ b/public/js/main.min.js @@ -1,2 +1,2 @@ /*! insight-bitcore 0.2.5 */ -var defaultLanguage=localStorage.getItem("insight-language")||"en";angular.module("insight",["ngAnimate","ngResource","ngRoute","ngProgress","ui.bootstrap","ui.route","monospaced.qrcode","gettext","insight.system","insight.socket","insight.blocks","insight.transactions","insight.address","insight.search","insight.status","insight.connection","insight.currency"]),angular.module("insight.system",[]),angular.module("insight.socket",[]),angular.module("insight.blocks",[]),angular.module("insight.transactions",[]),angular.module("insight.address",[]),angular.module("insight.search",[]),angular.module("insight.status",[]),angular.module("insight.connection",[]),angular.module("insight.currency",[]),angular.module("insight.address").controller("AddressController",function($scope,$rootScope,$routeParams,$location,Global,Address,getSocket){$scope.global=Global;var socket=getSocket($scope),_startSocket=function(){socket.emit("subscribe",$routeParams.addrStr),socket.on($routeParams.addrStr,function(tx){$rootScope.$broadcast("tx",tx);var beep=new Audio("/sound/transaction.mp3");beep.play()})};socket.on("connect",function(){_startSocket()}),$scope.params=$routeParams,$scope.findOne=function(){$rootScope.currentAddr=$routeParams.addrStr,_startSocket(),Address.get({addrStr:$routeParams.addrStr},function(address){$rootScope.titleDetail=address.addrStr.substring(0,7)+"...",$rootScope.flashMessage=null,$scope.address=address},function(e){$rootScope.flashMessage=400===e.status?"Invalid Address: "+$routeParams.addrStr:503===e.status?"Backend Error. "+e.data:"Address Not Found",$location.path("/")})}}),angular.module("insight.blocks").controller("BlocksController",function($scope,$rootScope,$routeParams,$location,Global,Block,Blocks,BlockByHeight){$scope.global=Global,$scope.loading=!1,$routeParams.blockHeight&&BlockByHeight.get({blockHeight:$routeParams.blockHeight},function(hash){$location.path("/block/"+hash.blockHash)},function(){$rootScope.flashMessage="Bad Request",$location.path("/")});var _formatTimestamp=function(date){var yyyy=date.getUTCFullYear().toString(),mm=(date.getUTCMonth()+1).toString(),dd=date.getUTCDate().toString();return yyyy+"-"+(mm[1]?mm:"0"+mm[0])+"-"+(dd[1]?dd:"0"+dd[0])};$scope.$watch("dt",function(newValue,oldValue){newValue!==oldValue&&$location.path("/blocks-date/"+_formatTimestamp(newValue))}),$scope.openCalendar=function($event){$event.preventDefault(),$event.stopPropagation(),$scope.opened=!0},$scope.humanSince=function(time){var m=moment.unix(time).startOf("day"),b=moment().startOf("day");return m.max().from(b)},$scope.list=function(){if($scope.loading=!0,$routeParams.blockDate&&($scope.detail="On "+$routeParams.blockDate),$routeParams.startTimestamp){var d=new Date(1e3*$routeParams.startTimestamp),m=d.getMinutes();10>m&&(m="0"+m),$scope.before=" before "+d.getHours()+":"+m}$rootScope.titleDetail=$scope.detail,Blocks.get({blockDate:$routeParams.blockDate,startTimestamp:$routeParams.startTimestamp},function(res){$scope.loading=!1,$scope.blocks=res.blocks,$scope.pagination=res.pagination})},$scope.findOne=function(){$scope.loading=!0,Block.get({blockHash:$routeParams.blockHash},function(block){$rootScope.titleDetail=block.height,$rootScope.flashMessage=null,$scope.loading=!1,$scope.block=block},function(e){$rootScope.flashMessage=400===e.status?"Invalid Transaction ID: "+$routeParams.txId:503===e.status?"Backend Error. "+e.data:"Block Not Found",$location.path("/")})},$scope.params=$routeParams}),angular.module("insight.connection").controller("ConnectionController",function($scope,$window,Status,getSocket,PeerSync){$scope.apiOnline=!0,$scope.serverOnline=!0,$scope.clienteOnline=!0;var socket=getSocket($scope);socket.on("connect",function(){$scope.serverOnline=!0,socket.on("disconnect",function(){$scope.serverOnline=!1})}),$scope.getConnStatus=function(){PeerSync.get({},function(peer){$scope.apiOnline=peer.connected,$scope.host=peer.host,$scope.port=peer.port},function(){$scope.apiOnline=!1})},socket.emit("subscribe","sync"),socket.on("status",function(sync){$scope.sync=sync,$scope.apiOnline="aborted"!==sync.status&&"error"!==sync.status}),$window.addEventListener("offline",function(){$scope.$apply(function(){$scope.clienteOnline=!1})},!0),$window.addEventListener("online",function(){$scope.$apply(function(){$scope.clienteOnline=!0})},!0)}),angular.module("insight.currency").controller("CurrencyController",function($scope,$rootScope,Currency){var _roundFloat=function(x,n){return parseInt(n,10)&&parseFloat(x)||(n=0),Math.round(x*Math.pow(10,n))/Math.pow(10,n)};$rootScope.currency.getConvertion=function(value){if(value=1*value,!isNaN(value)&&"undefined"!=typeof value&&null!==value){if(0===value)return"0 "+this.symbol;var response;return"USD"===this.symbol?response=_roundFloat(value*this.factor,2):"mBTC"===this.symbol?(this.factor=1e3,response=_roundFloat(value*this.factor,5)):(this.factor=1,response=value),1e-7>response&&(response=response.toFixed(8)),response+" "+this.symbol}return"value error"},$scope.setCurrency=function(currency){$rootScope.currency.symbol=currency,"USD"===currency?Currency.get({},function(res){$rootScope.currency.factor=$rootScope.currency.bitstamp=res.data.bitstamp}):$rootScope.currency.factor="mBTC"===currency?1e3:1},Currency.get({},function(res){$rootScope.currency.bitstamp=res.data.bitstamp})}),angular.module("insight.system").controller("FooterController",function($scope,$route,$templateCache,gettextCatalog,Version){$scope.defaultLanguage=defaultLanguage;var _getVersion=function(){Version.get({},function(res){$scope.version=res.version})};$scope.version=_getVersion(),$scope.availableLanguages=[{name:"English",isoCode:"en"},{name:"Spanish",isoCode:"es"}],$scope.setLanguage=function(isoCode){gettextCatalog.currentLanguage=$scope.defaultLanguage=defaultLanguage=isoCode,localStorage.setItem("insight-language",isoCode);var currentPageTemplate=$route.current.templateUrl;$templateCache.remove(currentPageTemplate),$route.reload()}}),angular.module("insight.system").controller("HeaderController",function($scope,$rootScope,$modal,getSocket,Global,Block){$scope.global=Global,$rootScope.currency={factor:1,bitstamp:0,symbol:"BTC"},$scope.menu=[{title:"Blocks",link:"blocks"},{title:"Status",link:"status"}],$scope.openScannerModal=function(){$modal.open({templateUrl:"scannerModal.html",controller:"ScannerController"})};var _getBlock=function(hash){Block.get({blockHash:hash},function(res){$scope.totalBlocks=res.height})},socket=getSocket($scope);socket.on("connect",function(){socket.emit("subscribe","inv"),socket.on("block",function(block){var blockHash=block.toString();_getBlock(blockHash)})}),$rootScope.isCollapsed=!0});var TRANSACTION_DISPLAYED=10,BLOCKS_DISPLAYED=5;angular.module("insight.system").controller("IndexController",function($scope,Global,getSocket,Blocks){$scope.global=Global;var _getBlocks=function(){Blocks.get({limit:BLOCKS_DISPLAYED},function(res){$scope.blocks=res.blocks,$scope.blocksLength=res.lenght})},socket=getSocket($scope),_startSocket=function(){socket.emit("subscribe","inv"),socket.on("tx",function(tx){$scope.txs.unshift(tx),parseInt($scope.txs.length,10)>=parseInt(TRANSACTION_DISPLAYED,10)&&($scope.txs=$scope.txs.splice(0,TRANSACTION_DISPLAYED))}),socket.on("block",function(){_getBlocks()})};socket.on("connect",function(){_startSocket()}),$scope.humanSince=function(time){var m=moment.unix(time);return m.max().fromNow()},$scope.index=function(){_getBlocks(),_startSocket()},$scope.txs=[],$scope.blocks=[]}),angular.module("insight.system").controller("ScannerController",function($scope,$rootScope,$modalInstance,Global){$scope.global=Global;var isMobile={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return isMobile.Android()||isMobile.BlackBerry()||isMobile.iOS()||isMobile.Opera()||isMobile.Windows()}};navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,$scope.isMobile=isMobile.any(),$scope.scannerLoading=!1;var cameraInput,video,canvas,$video,context,localMediaStream,$searchInput=angular.element(document.getElementById("search")),_scan=function(evt){if($scope.isMobile){$scope.scannerLoading=!0;var files=evt.target.files;if(1===files.length&&0===files[0].type.indexOf("image/")){var file=files[0],reader=new FileReader;reader.onload=function(){return function(){var mpImg=new MegaPixImage(file);mpImg.render(canvas,{maxWidth:200,maxHeight:200,orientation:6}),setTimeout(function(){qrcode.width=canvas.width,qrcode.height=canvas.height,qrcode.imagedata=context.getImageData(0,0,qrcode.width,qrcode.height);try{qrcode.decode()}catch(e){alert(e)}},1500)}}(file),reader.readAsDataURL(file)}}else{if(localMediaStream){context.drawImage(video,0,0,300,225);try{qrcode.decode()}catch(e){}}setTimeout(_scan,500)}},_successCallback=function(stream){video.src=window.URL&&window.URL.createObjectURL(stream)||stream,localMediaStream=stream,video.play(),setTimeout(_scan,1e3)},_scanStop=function(){$scope.scannerLoading=!1,$modalInstance.close(),$scope.isMobile||(localMediaStream.stop&&localMediaStream.stop(),localMediaStream=null,video.src="")},_videoError=function(err){console.log("Video Error: "+JSON.stringify(err)),_scanStop()};qrcode.callback=function(data){_scanStop();var str=0===data.indexOf("bitcoin:")?data.substring(8):data;console.log("QR code detected: "+str),$searchInput.val(str).triggerHandler("change").triggerHandler("submit")},$scope.cancel=function(){_scanStop()},$modalInstance.opened.then(function(){$rootScope.isCollapsed=!0,setTimeout(function(){canvas=document.getElementById("qr-canvas"),context=canvas.getContext("2d"),$scope.isMobile?(cameraInput=document.getElementById("qrcode-camera"),cameraInput.addEventListener("change",_scan,!1)):(video=document.getElementById("qrcode-scanner-video"),$video=angular.element(video),canvas.width=300,canvas.height=225,context.clearRect(0,0,300,225),navigator.getUserMedia({video:!0},_successCallback,_videoError))},500)})}),angular.module("insight.search").controller("SearchController",function($scope,$routeParams,$location,$timeout,Global,Block,Transaction,Address,BlockByHeight){$scope.global=Global,$scope.loading=!1;var _badQuery=function(){$scope.badQuery=!0,$timeout(function(){$scope.badQuery=!1},2e3)},_resetSearch=function(){$scope.q="",$scope.loading=!1};$scope.search=function(){var q=$scope.q;$scope.badQuery=!1,$scope.loading=!0,Block.get({blockHash:q},function(){_resetSearch(),$location.path("block/"+q)},function(){Transaction.get({txId:q},function(){_resetSearch(),$location.path("tx/"+q)},function(){Address.get({addrStr:q},function(){_resetSearch(),$location.path("address/"+q)},function(){isFinite(q)?BlockByHeight.get({blockHeight:q},function(hash){_resetSearch(),$location.path("/block/"+hash.blockHash)},function(){$scope.loading=!1,_badQuery()}):($scope.loading=!1,_badQuery())})})})}}),angular.module("insight.status").controller("StatusController",function($scope,$routeParams,$location,Global,Status,Sync,getSocket){$scope.global=Global,$scope.getStatus=function(q){Status.get({q:"get"+q},function(d){$scope.loaded=1,angular.extend($scope,d)},function(e){$scope.error="API ERROR: "+e.data})},$scope.humanSince=function(time){var m=moment.unix(time/1e3);return m.max().fromNow()};var _onSyncUpdate=function(sync){$scope.sync=sync},_startSocket=function(){socket.emit("subscribe","sync"),socket.on("status",function(sync){_onSyncUpdate(sync)})},socket=getSocket($scope);socket.on("connect",function(){_startSocket()}),$scope.getSync=function(){_startSocket(),Sync.get({},function(sync){_onSyncUpdate(sync)},function(e){var err="Could not get sync information"+e.toString();$scope.sync={error:err}})}}),angular.module("insight.transactions").controller("transactionsController",function($scope,$rootScope,$routeParams,$location,Global,Transaction,TransactionsByBlock,TransactionsByAddress){$scope.global=Global,$scope.loading=!1,$scope.loadedBy=null;var pageNum=0,pagesTotal=1,COIN=1e8,_aggregateItems=function(items){if(!items)return[];for(var l=items.length,ret=[],tmp={},u=0,i=0;l>i;i++){var notAddr=!1;if(items[i].scriptSig&&!items[i].addr&&(items[i].addr="Unparsed address ["+u++ +"]",items[i].notAddr=!0,notAddr=!0),items[i].scriptPubKey&&!items[i].scriptPubKey.addresses&&(items[i].scriptPubKey.addresses=["Unparsed address ["+u++ +"]"],items[i].notAddr=!0,notAddr=!0),items[i].scriptPubKey&&items[i].scriptPubKey.addresses.length>1)items[i].addr=items[i].scriptPubKey.addresses.join(","),ret.push(items[i]);else{var addr=items[i].addr||items[i].scriptPubKey&&items[i].scriptPubKey.addresses[0];tmp[addr]||(tmp[addr]={},tmp[addr].valueSat=0,tmp[addr].count=0,tmp[addr].addr=addr,tmp[addr].items=[]),tmp[addr].isSpent=items[i].spentTxId,tmp[addr].doubleSpentTxID=tmp[addr].doubleSpentTxID||items[i].doubleSpentTxID,tmp[addr].doubleSpentIndex=tmp[addr].doubleSpentIndex||items[i].doubleSpentIndex,tmp[addr].unconfirmedInput+=items[i].unconfirmedInput,tmp[addr].dbError=tmp[addr].dbError||items[i].dbError,tmp[addr].valueSat+=Math.round(items[i].value*COIN),tmp[addr].items.push(items[i]),tmp[addr].notAddr=notAddr,tmp[addr].count++}}return angular.forEach(tmp,function(v){v.value=v.value||parseInt(v.valueSat)/COIN,ret.push(v)}),ret},_processTX=function(tx){tx.vinSimple=_aggregateItems(tx.vin),tx.voutSimple=_aggregateItems(tx.vout)},_paginate=function(data){$scope.loading=!1,pagesTotal=data.pagesTotal,pageNum+=1,data.txs.forEach(function(tx){_processTX(tx),$scope.txs.push(tx)})},_byBlock=function(){TransactionsByBlock.get({block:$routeParams.blockHash,pageNum:pageNum},function(data){_paginate(data)})},_byAddress=function(){TransactionsByAddress.get({address:$routeParams.addrStr,pageNum:pageNum},function(data){_paginate(data)})},_findTx=function(txid){Transaction.get({txId:txid},function(tx){$rootScope.titleDetail=tx.txid.substring(0,7)+"...",$rootScope.flashMessage=null,$scope.tx=tx,_processTX(tx),$scope.txs.unshift(tx)},function(e){$rootScope.flashMessage=400===e.status?"Invalid Transaction ID: "+$routeParams.txId:503===e.status?"Backend Error. "+e.data:"Transaction Not Found",$location.path("/")})};$scope.findThis=function(){_findTx($routeParams.txId)},$scope.load=function(from){$scope.loadedBy=from,$scope.loadMore()},$scope.loadMore=function(){pagesTotal>pageNum&&!$scope.loading&&($scope.loading=!0,"address"===$scope.loadedBy?_byAddress():_byBlock())},(">"==$routeParams.v_type||"<"==$routeParams.v_type)&&($scope.from_vin="<"==$routeParams.v_type?!0:!1,$scope.from_vout=">"==$routeParams.v_type?!0:!1,$scope.v_index=parseInt($routeParams.v_index),$scope.itemsExpanded=!0),$scope.txs=[],$scope.$on("tx",function(event,txid){_findTx(txid)})}),angular.module("insight.address").factory("Address",function($resource){return $resource("/api/addr/:addrStr/?noTxList=1",{addrStr:"@addStr"},{get:{method:"GET",interceptor:{response:function(res){return res.data},responseError:function(res){return 404===res.status?res:void 0}}}})}),angular.module("insight.blocks").factory("Block",function($resource){return $resource("/api/block/:blockHash",{blockHash:"@blockHash"},{get:{method:"GET",interceptor:{response:function(res){return res.data},responseError:function(res){return 404===res.status?res:void 0}}}})}).factory("Blocks",function($resource){return $resource("/api/blocks")}).factory("BlockByHeight",function($resource){return $resource("/api/block-index/:blockHeight")}),angular.module("insight.currency").factory("Currency",function($resource){return $resource("/api/currency")}),angular.module("insight.system").factory("Global",[function(){}]).factory("Version",function($resource){return $resource("/api/version")});var ScopedSocket=function(socket,$rootScope){this.socket=socket,this.$rootScope=$rootScope,this.listeners=[]};ScopedSocket.prototype.removeAllListeners=function(opts){opts||(opts={});for(var i=0;i=200?!0:!1,scope.$apply()})}}).directive("whenScrolled",function($window){return{restric:"A",link:function(scope,elm,attr){var pageHeight,clientHeight,scrollPos;$window=angular.element($window);var handler=function(){pageHeight=window.document.documentElement.scrollHeight,clientHeight=window.document.documentElement.clientHeight,scrollPos=window.pageYOffset,pageHeight-(scrollPos+clientHeight)===0&&scope.$apply(attr.whenScrolled)};$window.on("scroll",handler),scope.$on("$destroy",function(){return $window.off("scroll",handler)})}}}).directive("clipCopy",function(){return ZeroClipboard.config({moviePath:"/lib/zeroclipboard/ZeroClipboard.swf",trustedDomains:["*"],allowScriptAccess:"always",forceHandCursor:!0}),{restric:"A",scope:{clipCopy:"=clipCopy"},template:'
    Copied!
    ',link:function(scope,elm){var clip=new ZeroClipboard(elm);clip.on("load",function(client){var onMousedown=function(client){client.setText(scope.clipCopy)};client.on("mousedown",onMousedown),scope.$on("$destroy",function(){client.off("mousedown",onMousedown)})}),clip.on("noFlash wrongflash",function(){return elm.remove()})}}}),angular.module("insight").filter("startFrom",function(){return function(input,start){return start=+start,input.slice(start)}}).filter("split",function(){return function(input,delimiter){var delimiter=delimiter||",";return input.split(delimiter)}}),angular.module("insight").config(function($routeProvider){$routeProvider.when("/block/:blockHash",{templateUrl:"/views/block.html",title:"Bitcoin Block "}).when("/block-index/:blockHeight",{controller:"BlocksController",templateUrl:"/views/redirect.html"}).when("/tx/:txId/:v_type?/:v_index?",{templateUrl:"/views/transaction.html",title:"Bitcoin Transaction "}).when("/",{templateUrl:"/views/index.html",title:"Home"}).when("/blocks",{templateUrl:"/views/block_list.html",title:"Bitcoin Blocks solved Today"}).when("/blocks-date/:blockDate/:startTimestamp?",{templateUrl:"/views/block_list.html",title:"Bitcoin Blocks solved "}).when("/address/:addrStr",{templateUrl:"/views/address.html",title:"Bitcoin Address "}).when("/status",{templateUrl:"/views/status.html",title:"Status"}).otherwise({templateUrl:"/views/404.html",title:"Error"})}),angular.module("insight").config(function($locationProvider){$locationProvider.html5Mode(!0),$locationProvider.hashPrefix("!")}).run(function($rootScope,$route,$location,$routeParams,$anchorScroll,ngProgress,gettextCatalog){gettextCatalog.currentLanguage=defaultLanguage,$rootScope.$on("$routeChangeStart",function(){ngProgress.start()}),$rootScope.$on("$routeChangeSuccess",function(){ngProgress.complete(),$rootScope.titleDetail="",$rootScope.title=$route.current.title,$rootScope.isCollapsed=!0,$rootScope.currentAddr=null,$location.hash($routeParams.scrollTo),$anchorScroll()})}),angular.element(document).ready(function(){}),angular.module("insight").run(["gettextCatalog",function(gettextCatalog){gettextCatalog.setStrings("es",{"(Input unconfirmed)":"(Entrada sin confirmar)","404 Page not found :(":"404 Página no encontrada :(",'insight is an
    open-source Bitcoin blockchain explorer with complete REST and websocket APIs that can be used for writing web wallets and other apps that need more advanced blockchain queries than provided by bitcoind RPC. Check out the source code.':'insight es un explorador de bloques de Bitcoin open-source con un completo conjunto de REST y APIs de websockets que pueden ser usadas para escribir monederos de Bitcoins y otras aplicaciones que requieran consultar un explorador de bloques. Obtén el código en el repositorio abierto de Github.','insight is still in development, so be sure to report any bugs and provide feedback for improvement at our github issue tracker.':'insight esta en desarrollo aún, por ello agradecemos que nos reporten errores o sugerencias para mejorar el software. Github issue tracker.',About:"Acerca de",Address:"Dirección",Age:"Edad","Application Status":"Estado de la Aplicación","Best Block":"Mejor Bloque","Bitcoin node information":"Información del nodo Bitcoin",Block:"Bloque","Block Reward":"Bloque Recompensa",Blocks:"Bloques","Bytes Serialized":"Bytes Serializados","Can't connect to bitcoind to get live updates from the p2p network. (Tried connecting to bitcoind at {{host}}:{{port}} and failed.)":"No se pudo conectar a bitcoind para obtener actualizaciones en vivo de la red p2p. (Se intentó conectar a bitcoind de {{host}}:{{port}} y falló.)","Can't connect to insight server. Attempting to reconnect...":"No se pudo conectar al servidor insight. Intentando re-conectar...","Can't connect to internet. Please, check your connection.":"No se pudo conectar a Internet. Por favor, verifique su conexión.",Complete:"Completado",Confirmations:"Confirmaciones",Conn:"Con","Connections to other nodes":"Conexiones a otros nodos","Current Blockchain Tip (insight)":"Actual Blockchain Tip (insight)","Current Sync Status":"Actual Estado de Sincronización",Details:"Detalles",Difficulty:"Dificultad","Double spent attempt detected. From tx:":"Intento de doble gasto detectado. De la transacción:","Error!":"¡Error!",Fee:"Tasa","Final Balance":"Balance Final","Finish Date":"Fecha Final","Go to home":"Volver al Inicio","Hash Serialized":"Hash Serializado",Height:"Altura","Included in Block":"Incluido en el Bloque","Incoherence in levelDB detected:":"Detectada una incoherencia en levelDB:","Info Errors":"Errores de Información","Initial Block Chain Height":"Altura de la Cadena en Bloque Inicial",Input:"Entrada","Last Block":"Último Bloque","Last Block Hash (Bitcoind)":"Último Bloque Hash (Bitcoind)","Latest Blocks":"Últimos Bloques","Latest Transactions":"Últimas Transacciones","Loading Address Information":"Cargando Información de la Dirección","Loading Block Information":"Cargando Información del Bloque","Loading Selected Date...":"Cargando Fecha Seleccionada...","Loading Transaction Details":"Cargando Detalles de la Transacción","Loading Transactions...":"Cargando Transacciones...","Loading...":"Cargando...","Mined Time":"Hora de Minado","Mined by":"Minado por","Mining Difficulty":"Dificultad de Minado","Next Block":"Próximo Bloque","No Inputs (Newly Generated Coins)":"Sin Entradas (Monedas Recién Generadas)","No blocks yet.":"No hay bloques aún.","No matching records found!":"¡No se encontraron registros coincidentes!","No. Transactions":"Nro. de Transacciones","Number Of Transactions":"Número de Transacciones",Output:"Salida","Powered by":"Funciona con","Previous Block":"Bloque Anterior","Protocol version":"Versión del protocolo","Proxy setting":"Opción de proxy","Received Time":"Hora de Recibido","Redirecting...":"Redireccionando...","Search for block, transaction or address":"Buscar bloques, transacciones o direcciones","See all blocks":"Ver todos los bloques","Show Transaction Output data":"Mostrar dato de Salida de la Transacción","Show all":"Mostrar todos","Show input":"Mostrar entrada","Show less":"Ver menos","Show more":"Ver más",Size:"Tamaño","Size (bytes)":"Tamaño (bytes)","Skipped Blocks (previously synced)":"Bloques Saltados (previamente sincronizado)","Start Date":"Fecha de Inicio",Status:"Estado",Summary:"Resumen","Summary confirmed":"Resumen confirmados","Sync Progress":"Proceso de Sincronización","Sync Status":"Estado de Sincronización","Sync Type":"Tipo de Sincronización","Synced Blocks":"Bloques Sincornizados",Testnet:"Red de prueba","There are no transactions involving this address.":"No hay transacciones para esta dirección","Time Offset":"Desplazamiento de hora",Timestamp:"Fecha y hora",Today:"Hoy","Total Amount":"Cantidad Total","Total Received":"Total Recibido","Total Sent":"Total Enviado",Transaction:"Transacción","Transaction Output Set Information":"Información del Conjunto de Salida de la Transacción","Transaction Outputs":"Salidas de la Transacción",Transactions:"Transacciones",Type:"Tipo",Unconfirmed:"Sin confirmar","Unconfirmed Transaction!":"¡Transacción sin confirmar!","Unconfirmed Txs Balance":"Balance sin confirmar","Value Out":"Valor de Salida",Version:"Versión","Waiting for blocks...":"Esperando bloques...","Waiting for transactions...":"Esperando transacciones...","by date.":"por fecha.","first seen at":"Visto a",mined:"minado","mined on:":"minado el:","Waiting for blocks":"Esperando bloques"})}]); \ No newline at end of file +var defaultLanguage=localStorage.getItem("insight-language")||"en";angular.module("insight",["ngAnimate","ngResource","ngRoute","ngProgress","ui.bootstrap","ui.route","monospaced.qrcode","gettext","angularMoment","insight.system","insight.socket","insight.blocks","insight.transactions","insight.address","insight.search","insight.status","insight.connection","insight.currency"]),angular.module("insight.system",[]),angular.module("insight.socket",[]),angular.module("insight.blocks",[]),angular.module("insight.transactions",[]),angular.module("insight.address",[]),angular.module("insight.search",[]),angular.module("insight.status",[]),angular.module("insight.connection",[]),angular.module("insight.currency",[]),angular.module("insight.address").controller("AddressController",function($scope,$rootScope,$routeParams,$location,Global,Address,getSocket){$scope.global=Global;var socket=getSocket($scope),_startSocket=function(){socket.emit("subscribe",$routeParams.addrStr),socket.on($routeParams.addrStr,function(tx){$rootScope.$broadcast("tx",tx);var beep=new Audio("/sound/transaction.mp3");beep.play()})};socket.on("connect",function(){_startSocket()}),$scope.params=$routeParams,$scope.findOne=function(){$rootScope.currentAddr=$routeParams.addrStr,_startSocket(),Address.get({addrStr:$routeParams.addrStr},function(address){$rootScope.titleDetail=address.addrStr.substring(0,7)+"...",$rootScope.flashMessage=null,$scope.address=address},function(e){$rootScope.flashMessage=400===e.status?"Invalid Address: "+$routeParams.addrStr:503===e.status?"Backend Error. "+e.data:"Address Not Found",$location.path("/")})}}),angular.module("insight.blocks").controller("BlocksController",function($scope,$rootScope,$routeParams,$location,Global,Block,Blocks,BlockByHeight){$scope.global=Global,$scope.loading=!1,$routeParams.blockHeight&&BlockByHeight.get({blockHeight:$routeParams.blockHeight},function(hash){$location.path("/block/"+hash.blockHash)},function(){$rootScope.flashMessage="Bad Request",$location.path("/")});var _formatTimestamp=function(date){var yyyy=date.getUTCFullYear().toString(),mm=(date.getUTCMonth()+1).toString(),dd=date.getUTCDate().toString();return yyyy+"-"+(mm[1]?mm:"0"+mm[0])+"-"+(dd[1]?dd:"0"+dd[0])};$scope.$watch("dt",function(newValue,oldValue){newValue!==oldValue&&$location.path("/blocks-date/"+_formatTimestamp(newValue))}),$scope.openCalendar=function($event){$event.preventDefault(),$event.stopPropagation(),$scope.opened=!0},$scope.humanSince=function(time){var m=moment.unix(time).startOf("day"),b=moment().startOf("day");return m.max().from(b)},$scope.list=function(){if($scope.loading=!0,$routeParams.blockDate&&($scope.detail="On "+$routeParams.blockDate),$routeParams.startTimestamp){var d=new Date(1e3*$routeParams.startTimestamp),m=d.getMinutes();10>m&&(m="0"+m),$scope.before=" before "+d.getHours()+":"+m}$rootScope.titleDetail=$scope.detail,Blocks.get({blockDate:$routeParams.blockDate,startTimestamp:$routeParams.startTimestamp},function(res){$scope.loading=!1,$scope.blocks=res.blocks,$scope.pagination=res.pagination})},$scope.findOne=function(){$scope.loading=!0,Block.get({blockHash:$routeParams.blockHash},function(block){$rootScope.titleDetail=block.height,$rootScope.flashMessage=null,$scope.loading=!1,$scope.block=block},function(e){$rootScope.flashMessage=400===e.status?"Invalid Transaction ID: "+$routeParams.txId:503===e.status?"Backend Error. "+e.data:"Block Not Found",$location.path("/")})},$scope.params=$routeParams}),angular.module("insight.connection").controller("ConnectionController",function($scope,$window,Status,getSocket,PeerSync){$scope.apiOnline=!0,$scope.serverOnline=!0,$scope.clienteOnline=!0;var socket=getSocket($scope);socket.on("connect",function(){$scope.serverOnline=!0,socket.on("disconnect",function(){$scope.serverOnline=!1})}),$scope.getConnStatus=function(){PeerSync.get({},function(peer){$scope.apiOnline=peer.connected,$scope.host=peer.host,$scope.port=peer.port},function(){$scope.apiOnline=!1})},socket.emit("subscribe","sync"),socket.on("status",function(sync){$scope.sync=sync,$scope.apiOnline="aborted"!==sync.status&&"error"!==sync.status}),$window.addEventListener("offline",function(){$scope.$apply(function(){$scope.clienteOnline=!1})},!0),$window.addEventListener("online",function(){$scope.$apply(function(){$scope.clienteOnline=!0})},!0)}),angular.module("insight.currency").controller("CurrencyController",function($scope,$rootScope,Currency){var _roundFloat=function(x,n){return parseInt(n,10)&&parseFloat(x)||(n=0),Math.round(x*Math.pow(10,n))/Math.pow(10,n)};$rootScope.currency.getConvertion=function(value){if(value=1*value,!isNaN(value)&&"undefined"!=typeof value&&null!==value){if(0===value)return"0 "+this.symbol;var response;return"USD"===this.symbol?response=_roundFloat(value*this.factor,2):"mBTC"===this.symbol?(this.factor=1e3,response=_roundFloat(value*this.factor,5)):(this.factor=1,response=value),1e-7>response&&(response=response.toFixed(8)),response+" "+this.symbol}return"value error"},$scope.setCurrency=function(currency){$rootScope.currency.symbol=currency,"USD"===currency?Currency.get({},function(res){$rootScope.currency.factor=$rootScope.currency.bitstamp=res.data.bitstamp}):$rootScope.currency.factor="mBTC"===currency?1e3:1},Currency.get({},function(res){$rootScope.currency.bitstamp=res.data.bitstamp})}),angular.module("insight.system").controller("FooterController",function($scope,$route,$templateCache,gettextCatalog,amMoment,Version){$scope.defaultLanguage=defaultLanguage;var _getVersion=function(){Version.get({},function(res){$scope.version=res.version})};$scope.version=_getVersion(),$scope.availableLanguages=[{name:"English",isoCode:"en"},{name:"Spanish",isoCode:"es"}],$scope.setLanguage=function(isoCode){gettextCatalog.currentLanguage=$scope.defaultLanguage=defaultLanguage=isoCode,amMoment.changeLanguage(isoCode),localStorage.setItem("insight-language",isoCode);var currentPageTemplate=$route.current.templateUrl;$templateCache.remove(currentPageTemplate),$route.reload()}}),angular.module("insight.system").controller("HeaderController",function($scope,$rootScope,$modal,getSocket,Global,Block){$scope.global=Global,$rootScope.currency={factor:1,bitstamp:0,symbol:"BTC"},$scope.menu=[{title:"Blocks",link:"blocks"},{title:"Status",link:"status"}],$scope.openScannerModal=function(){$modal.open({templateUrl:"scannerModal.html",controller:"ScannerController"})};var _getBlock=function(hash){Block.get({blockHash:hash},function(res){$scope.totalBlocks=res.height})},socket=getSocket($scope);socket.on("connect",function(){socket.emit("subscribe","inv"),socket.on("block",function(block){var blockHash=block.toString();_getBlock(blockHash)})}),$rootScope.isCollapsed=!0});var TRANSACTION_DISPLAYED=10,BLOCKS_DISPLAYED=5;angular.module("insight.system").controller("IndexController",function($scope,Global,getSocket,Blocks){$scope.global=Global;var _getBlocks=function(){Blocks.get({limit:BLOCKS_DISPLAYED},function(res){$scope.blocks=res.blocks,$scope.blocksLength=res.lenght})},socket=getSocket($scope),_startSocket=function(){socket.emit("subscribe","inv"),socket.on("tx",function(tx){$scope.txs.unshift(tx),parseInt($scope.txs.length,10)>=parseInt(TRANSACTION_DISPLAYED,10)&&($scope.txs=$scope.txs.splice(0,TRANSACTION_DISPLAYED))}),socket.on("block",function(){_getBlocks()})};socket.on("connect",function(){_startSocket()}),$scope.humanSince=function(time){var m=moment.unix(time);return m.max().fromNow()},$scope.index=function(){_getBlocks(),_startSocket()},$scope.txs=[],$scope.blocks=[]}),angular.module("insight.system").controller("ScannerController",function($scope,$rootScope,$modalInstance,Global){$scope.global=Global;var isMobile={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return isMobile.Android()||isMobile.BlackBerry()||isMobile.iOS()||isMobile.Opera()||isMobile.Windows()}};navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,$scope.isMobile=isMobile.any(),$scope.scannerLoading=!1;var cameraInput,video,canvas,$video,context,localMediaStream,$searchInput=angular.element(document.getElementById("search")),_scan=function(evt){if($scope.isMobile){$scope.scannerLoading=!0;var files=evt.target.files;if(1===files.length&&0===files[0].type.indexOf("image/")){var file=files[0],reader=new FileReader;reader.onload=function(){return function(){var mpImg=new MegaPixImage(file);mpImg.render(canvas,{maxWidth:200,maxHeight:200,orientation:6}),setTimeout(function(){qrcode.width=canvas.width,qrcode.height=canvas.height,qrcode.imagedata=context.getImageData(0,0,qrcode.width,qrcode.height);try{qrcode.decode()}catch(e){alert(e)}},1500)}}(file),reader.readAsDataURL(file)}}else{if(localMediaStream){context.drawImage(video,0,0,300,225);try{qrcode.decode()}catch(e){}}setTimeout(_scan,500)}},_successCallback=function(stream){video.src=window.URL&&window.URL.createObjectURL(stream)||stream,localMediaStream=stream,video.play(),setTimeout(_scan,1e3)},_scanStop=function(){$scope.scannerLoading=!1,$modalInstance.close(),$scope.isMobile||(localMediaStream.stop&&localMediaStream.stop(),localMediaStream=null,video.src="")},_videoError=function(err){console.log("Video Error: "+JSON.stringify(err)),_scanStop()};qrcode.callback=function(data){_scanStop();var str=0===data.indexOf("bitcoin:")?data.substring(8):data;console.log("QR code detected: "+str),$searchInput.val(str).triggerHandler("change").triggerHandler("submit")},$scope.cancel=function(){_scanStop()},$modalInstance.opened.then(function(){$rootScope.isCollapsed=!0,setTimeout(function(){canvas=document.getElementById("qr-canvas"),context=canvas.getContext("2d"),$scope.isMobile?(cameraInput=document.getElementById("qrcode-camera"),cameraInput.addEventListener("change",_scan,!1)):(video=document.getElementById("qrcode-scanner-video"),$video=angular.element(video),canvas.width=300,canvas.height=225,context.clearRect(0,0,300,225),navigator.getUserMedia({video:!0},_successCallback,_videoError))},500)})}),angular.module("insight.search").controller("SearchController",function($scope,$routeParams,$location,$timeout,Global,Block,Transaction,Address,BlockByHeight){$scope.global=Global,$scope.loading=!1;var _badQuery=function(){$scope.badQuery=!0,$timeout(function(){$scope.badQuery=!1},2e3)},_resetSearch=function(){$scope.q="",$scope.loading=!1};$scope.search=function(){var q=$scope.q;$scope.badQuery=!1,$scope.loading=!0,Block.get({blockHash:q},function(){_resetSearch(),$location.path("block/"+q)},function(){Transaction.get({txId:q},function(){_resetSearch(),$location.path("tx/"+q)},function(){Address.get({addrStr:q},function(){_resetSearch(),$location.path("address/"+q)},function(){isFinite(q)?BlockByHeight.get({blockHeight:q},function(hash){_resetSearch(),$location.path("/block/"+hash.blockHash)},function(){$scope.loading=!1,_badQuery()}):($scope.loading=!1,_badQuery())})})})}}),angular.module("insight.status").controller("StatusController",function($scope,$routeParams,$location,Global,Status,Sync,getSocket){$scope.global=Global,$scope.getStatus=function(q){Status.get({q:"get"+q},function(d){$scope.loaded=1,angular.extend($scope,d)},function(e){$scope.error="API ERROR: "+e.data})},$scope.humanSince=function(time){var m=moment.unix(time/1e3);return m.max().fromNow()};var _onSyncUpdate=function(sync){$scope.sync=sync},_startSocket=function(){socket.emit("subscribe","sync"),socket.on("status",function(sync){_onSyncUpdate(sync)})},socket=getSocket($scope);socket.on("connect",function(){_startSocket()}),$scope.getSync=function(){_startSocket(),Sync.get({},function(sync){_onSyncUpdate(sync)},function(e){var err="Could not get sync information"+e.toString();$scope.sync={error:err}})}}),angular.module("insight.transactions").controller("transactionsController",function($scope,$rootScope,$routeParams,$location,Global,Transaction,TransactionsByBlock,TransactionsByAddress){$scope.global=Global,$scope.loading=!1,$scope.loadedBy=null;var pageNum=0,pagesTotal=1,COIN=1e8,_aggregateItems=function(items){if(!items)return[];for(var l=items.length,ret=[],tmp={},u=0,i=0;l>i;i++){var notAddr=!1;if(items[i].scriptSig&&!items[i].addr&&(items[i].addr="Unparsed address ["+u++ +"]",items[i].notAddr=!0,notAddr=!0),items[i].scriptPubKey&&!items[i].scriptPubKey.addresses&&(items[i].scriptPubKey.addresses=["Unparsed address ["+u++ +"]"],items[i].notAddr=!0,notAddr=!0),items[i].scriptPubKey&&items[i].scriptPubKey.addresses.length>1)items[i].addr=items[i].scriptPubKey.addresses.join(","),ret.push(items[i]);else{var addr=items[i].addr||items[i].scriptPubKey&&items[i].scriptPubKey.addresses[0];tmp[addr]||(tmp[addr]={},tmp[addr].valueSat=0,tmp[addr].count=0,tmp[addr].addr=addr,tmp[addr].items=[]),tmp[addr].isSpent=items[i].spentTxId,tmp[addr].doubleSpentTxID=tmp[addr].doubleSpentTxID||items[i].doubleSpentTxID,tmp[addr].doubleSpentIndex=tmp[addr].doubleSpentIndex||items[i].doubleSpentIndex,tmp[addr].unconfirmedInput+=items[i].unconfirmedInput,tmp[addr].dbError=tmp[addr].dbError||items[i].dbError,tmp[addr].valueSat+=Math.round(items[i].value*COIN),tmp[addr].items.push(items[i]),tmp[addr].notAddr=notAddr,tmp[addr].count++}}return angular.forEach(tmp,function(v){v.value=v.value||parseInt(v.valueSat)/COIN,ret.push(v)}),ret},_processTX=function(tx){tx.vinSimple=_aggregateItems(tx.vin),tx.voutSimple=_aggregateItems(tx.vout)},_paginate=function(data){$scope.loading=!1,pagesTotal=data.pagesTotal,pageNum+=1,data.txs.forEach(function(tx){_processTX(tx),$scope.txs.push(tx)})},_byBlock=function(){TransactionsByBlock.get({block:$routeParams.blockHash,pageNum:pageNum},function(data){_paginate(data)})},_byAddress=function(){TransactionsByAddress.get({address:$routeParams.addrStr,pageNum:pageNum},function(data){_paginate(data)})},_findTx=function(txid){Transaction.get({txId:txid},function(tx){$rootScope.titleDetail=tx.txid.substring(0,7)+"...",$rootScope.flashMessage=null,$scope.tx=tx,_processTX(tx),$scope.txs.unshift(tx)},function(e){$rootScope.flashMessage=400===e.status?"Invalid Transaction ID: "+$routeParams.txId:503===e.status?"Backend Error. "+e.data:"Transaction Not Found",$location.path("/")})};$scope.findThis=function(){_findTx($routeParams.txId)},$scope.load=function(from){$scope.loadedBy=from,$scope.loadMore()},$scope.loadMore=function(){pagesTotal>pageNum&&!$scope.loading&&($scope.loading=!0,"address"===$scope.loadedBy?_byAddress():_byBlock())},(">"==$routeParams.v_type||"<"==$routeParams.v_type)&&($scope.from_vin="<"==$routeParams.v_type?!0:!1,$scope.from_vout=">"==$routeParams.v_type?!0:!1,$scope.v_index=parseInt($routeParams.v_index),$scope.itemsExpanded=!0),$scope.txs=[],$scope.$on("tx",function(event,txid){_findTx(txid)})}),angular.module("insight.address").factory("Address",function($resource){return $resource("/api/addr/:addrStr/?noTxList=1",{addrStr:"@addStr"},{get:{method:"GET",interceptor:{response:function(res){return res.data},responseError:function(res){return 404===res.status?res:void 0}}}})}),angular.module("insight.blocks").factory("Block",function($resource){return $resource("/api/block/:blockHash",{blockHash:"@blockHash"},{get:{method:"GET",interceptor:{response:function(res){return res.data},responseError:function(res){return 404===res.status?res:void 0}}}})}).factory("Blocks",function($resource){return $resource("/api/blocks")}).factory("BlockByHeight",function($resource){return $resource("/api/block-index/:blockHeight")}),angular.module("insight.currency").factory("Currency",function($resource){return $resource("/api/currency")}),angular.module("insight.system").factory("Global",[function(){}]).factory("Version",function($resource){return $resource("/api/version")});var ScopedSocket=function(socket,$rootScope){this.socket=socket,this.$rootScope=$rootScope,this.listeners=[]};ScopedSocket.prototype.removeAllListeners=function(opts){opts||(opts={});for(var i=0;i=200?!0:!1,scope.$apply()})}}).directive("whenScrolled",function($window){return{restric:"A",link:function(scope,elm,attr){var pageHeight,clientHeight,scrollPos;$window=angular.element($window);var handler=function(){pageHeight=window.document.documentElement.scrollHeight,clientHeight=window.document.documentElement.clientHeight,scrollPos=window.pageYOffset,pageHeight-(scrollPos+clientHeight)===0&&scope.$apply(attr.whenScrolled)};$window.on("scroll",handler),scope.$on("$destroy",function(){return $window.off("scroll",handler)})}}}).directive("clipCopy",function(){return ZeroClipboard.config({moviePath:"/lib/zeroclipboard/ZeroClipboard.swf",trustedDomains:["*"],allowScriptAccess:"always",forceHandCursor:!0}),{restric:"A",scope:{clipCopy:"=clipCopy"},template:'
    Copied!
    ',link:function(scope,elm){var clip=new ZeroClipboard(elm);clip.on("load",function(client){var onMousedown=function(client){client.setText(scope.clipCopy)};client.on("mousedown",onMousedown),scope.$on("$destroy",function(){client.off("mousedown",onMousedown)})}),clip.on("noFlash wrongflash",function(){return elm.remove()})}}}),angular.module("insight").filter("startFrom",function(){return function(input,start){return start=+start,input.slice(start)}}).filter("split",function(){return function(input,delimiter){var delimiter=delimiter||",";return input.split(delimiter)}}),angular.module("insight").config(function($routeProvider){$routeProvider.when("/block/:blockHash",{templateUrl:"/views/block.html",title:"Bitcoin Block "}).when("/block-index/:blockHeight",{controller:"BlocksController",templateUrl:"/views/redirect.html"}).when("/tx/:txId/:v_type?/:v_index?",{templateUrl:"/views/transaction.html",title:"Bitcoin Transaction "}).when("/",{templateUrl:"/views/index.html",title:"Home"}).when("/blocks",{templateUrl:"/views/block_list.html",title:"Bitcoin Blocks solved Today"}).when("/blocks-date/:blockDate/:startTimestamp?",{templateUrl:"/views/block_list.html",title:"Bitcoin Blocks solved "}).when("/address/:addrStr",{templateUrl:"/views/address.html",title:"Bitcoin Address "}).when("/status",{templateUrl:"/views/status.html",title:"Status"}).otherwise({templateUrl:"/views/404.html",title:"Error"})}),angular.module("insight").config(function($locationProvider){$locationProvider.html5Mode(!0),$locationProvider.hashPrefix("!")}).run(function($rootScope,$route,$location,$routeParams,$anchorScroll,ngProgress,gettextCatalog,amMoment){gettextCatalog.currentLanguage=defaultLanguage,amMoment.changeLanguage(defaultLanguage),$rootScope.$on("$routeChangeStart",function(){ngProgress.start()}),$rootScope.$on("$routeChangeSuccess",function(){ngProgress.complete(),$rootScope.titleDetail="",$rootScope.title=$route.current.title,$rootScope.isCollapsed=!0,$rootScope.currentAddr=null,$location.hash($routeParams.scrollTo),$anchorScroll()})}),angular.element(document).ready(function(){}),angular.module("insight").run(["gettextCatalog",function(gettextCatalog){gettextCatalog.setStrings("es",{"(Input unconfirmed)":"(Entrada sin confirmar)","404 Page not found :(":"404 Página no encontrada :(",'insight is an open-source Bitcoin blockchain explorer with complete REST and websocket APIs that can be used for writing web wallets and other apps that need more advanced blockchain queries than provided by bitcoind RPC. Check out the source code.':'insight es un explorador de bloques de Bitcoin open-source con un completo conjunto de REST y APIs de websockets que pueden ser usadas para escribir monederos de Bitcoins y otras aplicaciones que requieran consultar un explorador de bloques. Obtén el código en el repositorio abierto de Github.','insight is still in development, so be sure to report any bugs and provide feedback for improvement at our github issue tracker.':'insight esta en desarrollo aún, por ello agradecemos que nos reporten errores o sugerencias para mejorar el software. Github issue tracker.',About:"Acerca de",Address:"Dirección",Age:"Edad","Application Status":"Estado de la Aplicación","Best Block":"Mejor Bloque","Bitcoin node information":"Información del nodo Bitcoin",Block:"Bloque","Block Reward":"Bloque Recompensa",Blocks:"Bloques","Bytes Serialized":"Bytes Serializados","Can't connect to bitcoind to get live updates from the p2p network. (Tried connecting to bitcoind at {{host}}:{{port}} and failed.)":"No se pudo conectar a bitcoind para obtener actualizaciones en vivo de la red p2p. (Se intentó conectar a bitcoind de {{host}}:{{port}} y falló.)","Can't connect to insight server. Attempting to reconnect...":"No se pudo conectar al servidor insight. Intentando re-conectar...","Can't connect to internet. Please, check your connection.":"No se pudo conectar a Internet. Por favor, verifique su conexión.",Complete:"Completado",Confirmations:"Confirmaciones",Conn:"Con","Connections to other nodes":"Conexiones a otros nodos","Current Blockchain Tip (insight)":"Actual Blockchain Tip (insight)","Current Sync Status":"Actual Estado de Sincronización",Details:"Detalles",Difficulty:"Dificultad","Double spent attempt detected. From tx:":"Intento de doble gasto detectado. De la transacción:","Error!":"¡Error!",Fee:"Tasa","Final Balance":"Balance Final","Finish Date":"Fecha Final","Go to home":"Volver al Inicio","Hash Serialized":"Hash Serializado",Height:"Altura","Included in Block":"Incluido en el Bloque","Incoherence in levelDB detected:":"Detectada una incoherencia en levelDB:","Info Errors":"Errores de Información","Initial Block Chain Height":"Altura de la Cadena en Bloque Inicial",Input:"Entrada","Last Block":"Último Bloque","Last Block Hash (Bitcoind)":"Último Bloque Hash (Bitcoind)","Latest Blocks":"Últimos Bloques","Latest Transactions":"Últimas Transacciones","Loading Address Information":"Cargando Información de la Dirección","Loading Block Information":"Cargando Información del Bloque","Loading Selected Date...":"Cargando Fecha Seleccionada...","Loading Transaction Details":"Cargando Detalles de la Transacción","Loading Transactions...":"Cargando Transacciones...","Loading...":"Cargando...","Mined Time":"Hora de Minado","Mined by":"Minado por","Mining Difficulty":"Dificultad de Minado","Next Block":"Próximo Bloque","No Inputs (Newly Generated Coins)":"Sin Entradas (Monedas Recién Generadas)","No blocks yet.":"No hay bloques aún.","No matching records found!":"¡No se encontraron registros coincidentes!","No. Transactions":"Nro. de Transacciones","Number Of Transactions":"Número de Transacciones",Output:"Salida","Powered by":"Funciona con","Previous Block":"Bloque Anterior","Protocol version":"Versión del protocolo","Proxy setting":"Opción de proxy","Received Time":"Hora de Recibido","Redirecting...":"Redireccionando...","Search for block, transaction or address":"Buscar bloques, transacciones o direcciones","See all blocks":"Ver todos los bloques","Show Transaction Output data":"Mostrar dato de Salida de la Transacción","Show all":"Mostrar todos","Show input":"Mostrar entrada","Show less":"Ver menos","Show more":"Ver más",Size:"Tamaño","Size (bytes)":"Tamaño (bytes)","Skipped Blocks (previously synced)":"Bloques Saltados (previamente sincronizado)","Start Date":"Fecha de Inicio",Status:"Estado",Summary:"Resumen","Summary confirmed":"Resumen confirmados","Sync Progress":"Proceso de Sincronización","Sync Status":"Estado de Sincronización","Sync Type":"Tipo de Sincronización","Synced Blocks":"Bloques Sincornizados",Testnet:"Red de prueba","There are no transactions involving this address.":"No hay transacciones para esta dirección","Time Offset":"Desplazamiento de hora",Timestamp:"Fecha y hora",Today:"Hoy","Total Amount":"Cantidad Total","Total Received":"Total Recibido","Total Sent":"Total Enviado",Transaction:"Transacción","Transaction Output Set Information":"Información del Conjunto de Salida de la Transacción","Transaction Outputs":"Salidas de la Transacción",Transactions:"Transacciones",Type:"Tipo",Unconfirmed:"Sin confirmar","Unconfirmed Transaction!":"¡Transacción sin confirmar!","Unconfirmed Txs Balance":"Balance sin confirmar","Value Out":"Valor de Salida",Version:"Versión","Waiting for blocks...":"Esperando bloques...","Waiting for transactions...":"Esperando transacciones...","by date.":"por fecha.","first seen at":"Visto a",mined:"minado","mined on:":"minado el:","Waiting for blocks":"Esperando bloques"})}]); \ No newline at end of file diff --git a/public/js/vendors.min.js b/public/js/vendors.min.js index 9e07f65..1202753 100644 --- a/public/js/vendors.min.js +++ b/public/js/vendors.min.js @@ -2,5 +2,5 @@ function ECB(count,dataCodewords){this.count=count,this.dataCodewords=dataCodewords,this.__defineGetter__("Count",function(){return this.count}),this.__defineGetter__("DataCodewords",function(){return this.dataCodewords})}function ECBlocks(ecCodewordsPerBlock,ecBlocks1,ecBlocks2){this.ecCodewordsPerBlock=ecCodewordsPerBlock,this.ecBlocks=ecBlocks2?new Array(ecBlocks1,ecBlocks2):new Array(ecBlocks1),this.__defineGetter__("ECCodewordsPerBlock",function(){return this.ecCodewordsPerBlock}),this.__defineGetter__("TotalECCodewords",function(){return this.ecCodewordsPerBlock*this.NumBlocks}),this.__defineGetter__("NumBlocks",function(){for(var total=0,i=0;ix;x++)for(var i=this.alignmentPatternCenters[x]-2,y=0;max>y;y++)0==x&&(0==y||y==max-1)||x==max-1&&0==y||bitMatrix.setRegion(this.alignmentPatternCenters[y]-2,i,5,5);return bitMatrix.setRegion(6,9,1,dimension-17),bitMatrix.setRegion(9,6,dimension-17,1),this.versionNumber>6&&(bitMatrix.setRegion(dimension-11,0,3,6),bitMatrix.setRegion(0,dimension-11,6,3)),bitMatrix},this.getECBlocksForLevel=function(ecLevel){return this.ecBlocks[ecLevel.ordinal()]}}function buildVersions(){return new Array(new Version(1,new Array,new ECBlocks(7,new ECB(1,19)),new ECBlocks(10,new ECB(1,16)),new ECBlocks(13,new ECB(1,13)),new ECBlocks(17,new ECB(1,9))),new Version(2,new Array(6,18),new ECBlocks(10,new ECB(1,34)),new ECBlocks(16,new ECB(1,28)),new ECBlocks(22,new ECB(1,22)),new ECBlocks(28,new ECB(1,16))),new Version(3,new Array(6,22),new ECBlocks(15,new ECB(1,55)),new ECBlocks(26,new ECB(1,44)),new ECBlocks(18,new ECB(2,17)),new ECBlocks(22,new ECB(2,13))),new Version(4,new Array(6,26),new ECBlocks(20,new ECB(1,80)),new ECBlocks(18,new ECB(2,32)),new ECBlocks(26,new ECB(2,24)),new ECBlocks(16,new ECB(4,9))),new Version(5,new Array(6,30),new ECBlocks(26,new ECB(1,108)),new ECBlocks(24,new ECB(2,43)),new ECBlocks(18,new ECB(2,15),new ECB(2,16)),new ECBlocks(22,new ECB(2,11),new ECB(2,12))),new Version(6,new Array(6,34),new ECBlocks(18,new ECB(2,68)),new ECBlocks(16,new ECB(4,27)),new ECBlocks(24,new ECB(4,19)),new ECBlocks(28,new ECB(4,15))),new Version(7,new Array(6,22,38),new ECBlocks(20,new ECB(2,78)),new ECBlocks(18,new ECB(4,31)),new ECBlocks(18,new ECB(2,14),new ECB(4,15)),new ECBlocks(26,new ECB(4,13),new ECB(1,14))),new Version(8,new Array(6,24,42),new ECBlocks(24,new ECB(2,97)),new ECBlocks(22,new ECB(2,38),new ECB(2,39)),new ECBlocks(22,new ECB(4,18),new ECB(2,19)),new ECBlocks(26,new ECB(4,14),new ECB(2,15))),new Version(9,new Array(6,26,46),new ECBlocks(30,new ECB(2,116)),new ECBlocks(22,new ECB(3,36),new ECB(2,37)),new ECBlocks(20,new ECB(4,16),new ECB(4,17)),new ECBlocks(24,new ECB(4,12),new ECB(4,13))),new Version(10,new Array(6,28,50),new ECBlocks(18,new ECB(2,68),new ECB(2,69)),new ECBlocks(26,new ECB(4,43),new ECB(1,44)),new ECBlocks(24,new ECB(6,19),new ECB(2,20)),new ECBlocks(28,new ECB(6,15),new ECB(2,16))),new Version(11,new Array(6,30,54),new ECBlocks(20,new ECB(4,81)),new ECBlocks(30,new ECB(1,50),new ECB(4,51)),new ECBlocks(28,new ECB(4,22),new ECB(4,23)),new ECBlocks(24,new ECB(3,12),new ECB(8,13))),new Version(12,new Array(6,32,58),new ECBlocks(24,new ECB(2,92),new ECB(2,93)),new ECBlocks(22,new ECB(6,36),new ECB(2,37)),new ECBlocks(26,new ECB(4,20),new ECB(6,21)),new ECBlocks(28,new ECB(7,14),new ECB(4,15))),new Version(13,new Array(6,34,62),new ECBlocks(26,new ECB(4,107)),new ECBlocks(22,new ECB(8,37),new ECB(1,38)),new ECBlocks(24,new ECB(8,20),new ECB(4,21)),new ECBlocks(22,new ECB(12,11),new ECB(4,12))),new Version(14,new Array(6,26,46,66),new ECBlocks(30,new ECB(3,115),new ECB(1,116)),new ECBlocks(24,new ECB(4,40),new ECB(5,41)),new ECBlocks(20,new ECB(11,16),new ECB(5,17)),new ECBlocks(24,new ECB(11,12),new ECB(5,13))),new Version(15,new Array(6,26,48,70),new ECBlocks(22,new ECB(5,87),new ECB(1,88)),new ECBlocks(24,new ECB(5,41),new ECB(5,42)),new ECBlocks(30,new ECB(5,24),new ECB(7,25)),new ECBlocks(24,new ECB(11,12),new ECB(7,13))),new Version(16,new Array(6,26,50,74),new ECBlocks(24,new ECB(5,98),new ECB(1,99)),new ECBlocks(28,new ECB(7,45),new ECB(3,46)),new ECBlocks(24,new ECB(15,19),new ECB(2,20)),new ECBlocks(30,new ECB(3,15),new ECB(13,16))),new Version(17,new Array(6,30,54,78),new ECBlocks(28,new ECB(1,107),new ECB(5,108)),new ECBlocks(28,new ECB(10,46),new ECB(1,47)),new ECBlocks(28,new ECB(1,22),new ECB(15,23)),new ECBlocks(28,new ECB(2,14),new ECB(17,15))),new Version(18,new Array(6,30,56,82),new ECBlocks(30,new ECB(5,120),new ECB(1,121)),new ECBlocks(26,new ECB(9,43),new ECB(4,44)),new ECBlocks(28,new ECB(17,22),new ECB(1,23)),new ECBlocks(28,new ECB(2,14),new ECB(19,15))),new Version(19,new Array(6,30,58,86),new ECBlocks(28,new ECB(3,113),new ECB(4,114)),new ECBlocks(26,new ECB(3,44),new ECB(11,45)),new ECBlocks(26,new ECB(17,21),new ECB(4,22)),new ECBlocks(26,new ECB(9,13),new ECB(16,14))),new Version(20,new Array(6,34,62,90),new ECBlocks(28,new ECB(3,107),new ECB(5,108)),new ECBlocks(26,new ECB(3,41),new ECB(13,42)),new ECBlocks(30,new ECB(15,24),new ECB(5,25)),new ECBlocks(28,new ECB(15,15),new ECB(10,16))),new Version(21,new Array(6,28,50,72,94),new ECBlocks(28,new ECB(4,116),new ECB(4,117)),new ECBlocks(26,new ECB(17,42)),new ECBlocks(28,new ECB(17,22),new ECB(6,23)),new ECBlocks(30,new ECB(19,16),new ECB(6,17))),new Version(22,new Array(6,26,50,74,98),new ECBlocks(28,new ECB(2,111),new ECB(7,112)),new ECBlocks(28,new ECB(17,46)),new ECBlocks(30,new ECB(7,24),new ECB(16,25)),new ECBlocks(24,new ECB(34,13))),new Version(23,new Array(6,30,54,74,102),new ECBlocks(30,new ECB(4,121),new ECB(5,122)),new ECBlocks(28,new ECB(4,47),new ECB(14,48)),new ECBlocks(30,new ECB(11,24),new ECB(14,25)),new ECBlocks(30,new ECB(16,15),new ECB(14,16))),new Version(24,new Array(6,28,54,80,106),new ECBlocks(30,new ECB(6,117),new ECB(4,118)),new ECBlocks(28,new ECB(6,45),new ECB(14,46)),new ECBlocks(30,new ECB(11,24),new ECB(16,25)),new ECBlocks(30,new ECB(30,16),new ECB(2,17))),new Version(25,new Array(6,32,58,84,110),new ECBlocks(26,new ECB(8,106),new ECB(4,107)),new ECBlocks(28,new ECB(8,47),new ECB(13,48)),new ECBlocks(30,new ECB(7,24),new ECB(22,25)),new ECBlocks(30,new ECB(22,15),new ECB(13,16))),new Version(26,new Array(6,30,58,86,114),new ECBlocks(28,new ECB(10,114),new ECB(2,115)),new ECBlocks(28,new ECB(19,46),new ECB(4,47)),new ECBlocks(28,new ECB(28,22),new ECB(6,23)),new ECBlocks(30,new ECB(33,16),new ECB(4,17))),new Version(27,new Array(6,34,62,90,118),new ECBlocks(30,new ECB(8,122),new ECB(4,123)),new ECBlocks(28,new ECB(22,45),new ECB(3,46)),new ECBlocks(30,new ECB(8,23),new ECB(26,24)),new ECBlocks(30,new ECB(12,15),new ECB(28,16))),new Version(28,new Array(6,26,50,74,98,122),new ECBlocks(30,new ECB(3,117),new ECB(10,118)),new ECBlocks(28,new ECB(3,45),new ECB(23,46)),new ECBlocks(30,new ECB(4,24),new ECB(31,25)),new ECBlocks(30,new ECB(11,15),new ECB(31,16))),new Version(29,new Array(6,30,54,78,102,126),new ECBlocks(30,new ECB(7,116),new ECB(7,117)),new ECBlocks(28,new ECB(21,45),new ECB(7,46)),new ECBlocks(30,new ECB(1,23),new ECB(37,24)),new ECBlocks(30,new ECB(19,15),new ECB(26,16))),new Version(30,new Array(6,26,52,78,104,130),new ECBlocks(30,new ECB(5,115),new ECB(10,116)),new ECBlocks(28,new ECB(19,47),new ECB(10,48)),new ECBlocks(30,new ECB(15,24),new ECB(25,25)),new ECBlocks(30,new ECB(23,15),new ECB(25,16))),new Version(31,new Array(6,30,56,82,108,134),new ECBlocks(30,new ECB(13,115),new ECB(3,116)),new ECBlocks(28,new ECB(2,46),new ECB(29,47)),new ECBlocks(30,new ECB(42,24),new ECB(1,25)),new ECBlocks(30,new ECB(23,15),new ECB(28,16))),new Version(32,new Array(6,34,60,86,112,138),new ECBlocks(30,new ECB(17,115)),new ECBlocks(28,new ECB(10,46),new ECB(23,47)),new ECBlocks(30,new ECB(10,24),new ECB(35,25)),new ECBlocks(30,new ECB(19,15),new ECB(35,16))),new Version(33,new Array(6,30,58,86,114,142),new ECBlocks(30,new ECB(17,115),new ECB(1,116)),new ECBlocks(28,new ECB(14,46),new ECB(21,47)),new ECBlocks(30,new ECB(29,24),new ECB(19,25)),new ECBlocks(30,new ECB(11,15),new ECB(46,16))),new Version(34,new Array(6,34,62,90,118,146),new ECBlocks(30,new ECB(13,115),new ECB(6,116)),new ECBlocks(28,new ECB(14,46),new ECB(23,47)),new ECBlocks(30,new ECB(44,24),new ECB(7,25)),new ECBlocks(30,new ECB(59,16),new ECB(1,17))),new Version(35,new Array(6,30,54,78,102,126,150),new ECBlocks(30,new ECB(12,121),new ECB(7,122)),new ECBlocks(28,new ECB(12,47),new ECB(26,48)),new ECBlocks(30,new ECB(39,24),new ECB(14,25)),new ECBlocks(30,new ECB(22,15),new ECB(41,16))),new Version(36,new Array(6,24,50,76,102,128,154),new ECBlocks(30,new ECB(6,121),new ECB(14,122)),new ECBlocks(28,new ECB(6,47),new ECB(34,48)),new ECBlocks(30,new ECB(46,24),new ECB(10,25)),new ECBlocks(30,new ECB(2,15),new ECB(64,16))),new Version(37,new Array(6,28,54,80,106,132,158),new ECBlocks(30,new ECB(17,122),new ECB(4,123)),new ECBlocks(28,new ECB(29,46),new ECB(14,47)),new ECBlocks(30,new ECB(49,24),new ECB(10,25)),new ECBlocks(30,new ECB(24,15),new ECB(46,16))),new Version(38,new Array(6,32,58,84,110,136,162),new ECBlocks(30,new ECB(4,122),new ECB(18,123)),new ECBlocks(28,new ECB(13,46),new ECB(32,47)),new ECBlocks(30,new ECB(48,24),new ECB(14,25)),new ECBlocks(30,new ECB(42,15),new ECB(32,16))),new Version(39,new Array(6,26,54,82,110,138,166),new ECBlocks(30,new ECB(20,117),new ECB(4,118)),new ECBlocks(28,new ECB(40,47),new ECB(7,48)),new ECBlocks(30,new ECB(43,24),new ECB(22,25)),new ECBlocks(30,new ECB(10,15),new ECB(67,16))),new Version(40,new Array(6,30,58,86,114,142,170),new ECBlocks(30,new ECB(19,118),new ECB(6,119)),new ECBlocks(28,new ECB(18,47),new ECB(31,48)),new ECBlocks(30,new ECB(34,24),new ECB(34,25)),new ECBlocks(30,new ECB(20,15),new ECB(61,16))))}function PerspectiveTransform(a11,a21,a31,a12,a22,a32,a13,a23,a33){this.a11=a11,this.a12=a12,this.a13=a13,this.a21=a21,this.a22=a22,this.a23=a23,this.a31=a31,this.a32=a32,this.a33=a33,this.transformPoints1=function(points){for(var max=points.length,a11=this.a11,a12=this.a12,a13=this.a13,a21=this.a21,a22=this.a22,a23=this.a23,a31=this.a31,a32=this.a32,a33=this.a33,i=0;max>i;i+=2){var x=points[i],y=points[i+1],denominator=a13*x+a23*y+a33;points[i]=(a11*x+a21*y+a31)/denominator,points[i+1]=(a12*x+a22*y+a32)/denominator}},this.transformPoints2=function(xValues,yValues){for(var n=xValues.length,i=0;n>i;i++){var x=xValues[i],y=yValues[i],denominator=this.a13*x+this.a23*y+this.a33;xValues[i]=(this.a11*x+this.a21*y+this.a31)/denominator,yValues[i]=(this.a12*x+this.a22*y+this.a32)/denominator}},this.buildAdjoint=function(){return new PerspectiveTransform(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},this.times=function(other){return new PerspectiveTransform(this.a11*other.a11+this.a21*other.a12+this.a31*other.a13,this.a11*other.a21+this.a21*other.a22+this.a31*other.a23,this.a11*other.a31+this.a21*other.a32+this.a31*other.a33,this.a12*other.a11+this.a22*other.a12+this.a32*other.a13,this.a12*other.a21+this.a22*other.a22+this.a32*other.a23,this.a12*other.a31+this.a22*other.a32+this.a32*other.a33,this.a13*other.a11+this.a23*other.a12+this.a33*other.a13,this.a13*other.a21+this.a23*other.a22+this.a33*other.a23,this.a13*other.a31+this.a23*other.a32+this.a33*other.a33)}}function DetectorResult(bits,points){this.bits=bits,this.points=points}function Detector(image){this.image=image,this.resultPointCallback=null,this.sizeOfBlackWhiteBlackRun=function(fromX,fromY,toX,toY){var steep=Math.abs(toY-fromY)>Math.abs(toX-fromX);if(steep){var temp=fromX;fromX=fromY,fromY=temp,temp=toX,toX=toY,toY=temp}for(var dx=Math.abs(toX-fromX),dy=Math.abs(toY-fromY),error=-dx>>1,ystep=toY>fromY?1:-1,xstep=toX>fromX?1:-1,state=0,x=fromX,y=fromY;x!=toX;x+=xstep){var realX=steep?y:x,realY=steep?x:y;if(1==state?this.image[realX+realY*qrcode.width]&&state++:this.image[realX+realY*qrcode.width]||state++,3==state){var diffX=x-fromX,diffY=y-fromY;return Math.sqrt(diffX*diffX+diffY*diffY)}if(error+=dy,error>0){if(y==toY)break;y+=ystep,error-=dx}}var diffX2=toX-fromX,diffY2=toY-fromY;return Math.sqrt(diffX2*diffX2+diffY2*diffY2)},this.sizeOfBlackWhiteBlackRunBothWays=function(fromX,fromY,toX,toY){var result=this.sizeOfBlackWhiteBlackRun(fromX,fromY,toX,toY),scale=1,otherToX=fromX-(toX-fromX);0>otherToX?(scale=fromX/(fromX-otherToX),otherToX=0):otherToX>=qrcode.width&&(scale=(qrcode.width-1-fromX)/(otherToX-fromX),otherToX=qrcode.width-1);var otherToY=Math.floor(fromY-(toY-fromY)*scale);return scale=1,0>otherToY?(scale=fromY/(fromY-otherToY),otherToY=0):otherToY>=qrcode.height&&(scale=(qrcode.height-1-fromY)/(otherToY-fromY),otherToY=qrcode.height-1),otherToX=Math.floor(fromX+(otherToX-fromX)*scale),result+=this.sizeOfBlackWhiteBlackRun(fromX,fromY,otherToX,otherToY),result-1},this.calculateModuleSizeOneWay=function(pattern,otherPattern){var moduleSizeEst1=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(pattern.X),Math.floor(pattern.Y),Math.floor(otherPattern.X),Math.floor(otherPattern.Y)),moduleSizeEst2=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(otherPattern.X),Math.floor(otherPattern.Y),Math.floor(pattern.X),Math.floor(pattern.Y));return isNaN(moduleSizeEst1)?moduleSizeEst2/7:isNaN(moduleSizeEst2)?moduleSizeEst1/7:(moduleSizeEst1+moduleSizeEst2)/14},this.calculateModuleSize=function(topLeft,topRight,bottomLeft){return(this.calculateModuleSizeOneWay(topLeft,topRight)+this.calculateModuleSizeOneWay(topLeft,bottomLeft))/2},this.distance=function(pattern1,pattern2){return xDiff=pattern1.X-pattern2.X,yDiff=pattern1.Y-pattern2.Y,Math.sqrt(xDiff*xDiff+yDiff*yDiff)},this.computeDimension=function(topLeft,topRight,bottomLeft,moduleSize){var tltrCentersDimension=Math.round(this.distance(topLeft,topRight)/moduleSize),tlblCentersDimension=Math.round(this.distance(topLeft,bottomLeft)/moduleSize),dimension=(tltrCentersDimension+tlblCentersDimension>>1)+7;switch(3&dimension){case 0:dimension++;break;case 2:dimension--;break;case 3:throw"Error"}return dimension},this.findAlignmentInRegion=function(overallEstModuleSize,estAlignmentX,estAlignmentY,allowanceFactor){var allowance=Math.floor(allowanceFactor*overallEstModuleSize),alignmentAreaLeftX=Math.max(0,estAlignmentX-allowance),alignmentAreaRightX=Math.min(qrcode.width-1,estAlignmentX+allowance);if(3*overallEstModuleSize>alignmentAreaRightX-alignmentAreaLeftX)throw"Error";var alignmentAreaTopY=Math.max(0,estAlignmentY-allowance),alignmentAreaBottomY=Math.min(qrcode.height-1,estAlignmentY+allowance),alignmentFinder=new AlignmentPatternFinder(this.image,alignmentAreaLeftX,alignmentAreaTopY,alignmentAreaRightX-alignmentAreaLeftX,alignmentAreaBottomY-alignmentAreaTopY,overallEstModuleSize,this.resultPointCallback);return alignmentFinder.find()},this.createTransform=function(topLeft,topRight,bottomLeft,alignmentPattern,dimension){var bottomRightX,bottomRightY,sourceBottomRightX,sourceBottomRightY,dimMinusThree=dimension-3.5;null!=alignmentPattern?(bottomRightX=alignmentPattern.X,bottomRightY=alignmentPattern.Y,sourceBottomRightX=sourceBottomRightY=dimMinusThree-3):(bottomRightX=topRight.X-topLeft.X+bottomLeft.X,bottomRightY=topRight.Y-topLeft.Y+bottomLeft.Y,sourceBottomRightX=sourceBottomRightY=dimMinusThree);var transform=PerspectiveTransform.quadrilateralToQuadrilateral(3.5,3.5,dimMinusThree,3.5,sourceBottomRightX,sourceBottomRightY,3.5,dimMinusThree,topLeft.X,topLeft.Y,topRight.X,topRight.Y,bottomRightX,bottomRightY,bottomLeft.X,bottomLeft.Y);return transform},this.sampleGrid=function(image,transform,dimension){var sampler=GridSampler;return sampler.sampleGrid3(image,dimension,transform)},this.processFinderPatternInfo=function(info){var topLeft=info.TopLeft,topRight=info.TopRight,bottomLeft=info.BottomLeft,moduleSize=this.calculateModuleSize(topLeft,topRight,bottomLeft);if(1>moduleSize)throw"Error";var dimension=this.computeDimension(topLeft,topRight,bottomLeft,moduleSize),provisionalVersion=Version.getProvisionalVersionForDimension(dimension),modulesBetweenFPCenters=provisionalVersion.DimensionForVersion-7,alignmentPattern=null;if(provisionalVersion.AlignmentPatternCenters.length>0)for(var bottomRightX=topRight.X-topLeft.X+bottomLeft.X,bottomRightY=topRight.Y-topLeft.Y+bottomLeft.Y,correctionToTopLeft=1-3/modulesBetweenFPCenters,estAlignmentX=Math.floor(topLeft.X+correctionToTopLeft*(bottomRightX-topLeft.X)),estAlignmentY=Math.floor(topLeft.Y+correctionToTopLeft*(bottomRightY-topLeft.Y)),i=4;16>=i;i<<=1){alignmentPattern=this.findAlignmentInRegion(moduleSize,estAlignmentX,estAlignmentY,i);break}var points,transform=this.createTransform(topLeft,topRight,bottomLeft,alignmentPattern,dimension),bits=this.sampleGrid(this.image,transform,dimension);return points=null==alignmentPattern?new Array(bottomLeft,topLeft,topRight):new Array(bottomLeft,topLeft,topRight,alignmentPattern),new DetectorResult(bits,points)},this.detect=function(){var info=(new FinderPatternFinder).findFinderPattern(this.image);return this.processFinderPatternInfo(info)}}function FormatInformation(formatInfo){this.errorCorrectionLevel=ErrorCorrectionLevel.forBits(formatInfo>>3&3),this.dataMask=7&formatInfo,this.__defineGetter__("ErrorCorrectionLevel",function(){return this.errorCorrectionLevel}),this.__defineGetter__("DataMask",function(){return this.dataMask}),this.GetHashCode=function(){return this.errorCorrectionLevel.ordinal()<<3|dataMask},this.Equals=function(o){var other=o;return this.errorCorrectionLevel==other.errorCorrectionLevel&&this.dataMask==other.dataMask}}function ErrorCorrectionLevel(ordinal,bits,name){this.ordinal_Renamed_Field=ordinal,this.bits=bits,this.name=name,this.__defineGetter__("Bits",function(){return this.bits}),this.__defineGetter__("Name",function(){return this.name}),this.ordinal=function(){return this.ordinal_Renamed_Field}}function BitMatrix(width,height){if(height||(height=width),1>width||1>height)throw"Both dimensions must be greater than 0";this.width=width,this.height=height;var rowSize=width>>5;0!=(31&width)&&rowSize++,this.rowSize=rowSize,this.bits=new Array(rowSize*height);for(var i=0;i>5);return 0!=(1&URShift(this.bits[offset],31&x))},this.set_Renamed=function(x,y){var offset=y*this.rowSize+(x>>5);this.bits[offset]|=1<<(31&x)},this.flip=function(x,y){var offset=y*this.rowSize+(x>>5);this.bits[offset]^=1<<(31&x)},this.clear=function(){for(var max=this.bits.length,i=0;max>i;i++)this.bits[i]=0},this.setRegion=function(left,top,width,height){if(0>top||0>left)throw"Left and top must be nonnegative";if(1>height||1>width)throw"Height and width must be at least 1";var right=left+width,bottom=top+height;if(bottom>this.height||right>this.width)throw"The region must fit inside the matrix";for(var y=top;bottom>y;y++)for(var offset=y*this.rowSize,x=left;right>x;x++)this.bits[offset+(x>>5)]|=1<<(31&x)}}function DataBlock(numDataCodewords,codewords){this.numDataCodewords=numDataCodewords,this.codewords=codewords,this.__defineGetter__("NumDataCodewords",function(){return this.numDataCodewords}),this.__defineGetter__("Codewords",function(){return this.codewords})}function BitMatrixParser(bitMatrix){var dimension=bitMatrix.Dimension;if(21>dimension||1!=(3&dimension))throw"Error BitMatrixParser";this.bitMatrix=bitMatrix,this.parsedVersion=null,this.parsedFormatInfo=null,this.copyBit=function(i,j,versionBits){return this.bitMatrix.get_Renamed(i,j)?versionBits<<1|1:versionBits<<1},this.readFormatInformation=function(){if(null!=this.parsedFormatInfo)return this.parsedFormatInfo;for(var formatInfoBits=0,i=0;6>i;i++)formatInfoBits=this.copyBit(i,8,formatInfoBits);formatInfoBits=this.copyBit(7,8,formatInfoBits),formatInfoBits=this.copyBit(8,8,formatInfoBits),formatInfoBits=this.copyBit(8,7,formatInfoBits);for(var j=5;j>=0;j--)formatInfoBits=this.copyBit(8,j,formatInfoBits);if(this.parsedFormatInfo=FormatInformation.decodeFormatInformation(formatInfoBits),null!=this.parsedFormatInfo)return this.parsedFormatInfo;var dimension=this.bitMatrix.Dimension;formatInfoBits=0;for(var iMin=dimension-8,i=dimension-1;i>=iMin;i--)formatInfoBits=this.copyBit(i,8,formatInfoBits);for(var j=dimension-7;dimension>j;j++)formatInfoBits=this.copyBit(8,j,formatInfoBits);if(this.parsedFormatInfo=FormatInformation.decodeFormatInformation(formatInfoBits),null!=this.parsedFormatInfo)return this.parsedFormatInfo;throw"Error readFormatInformation"},this.readVersion=function(){if(null!=this.parsedVersion)return this.parsedVersion;var dimension=this.bitMatrix.Dimension,provisionalVersion=dimension-17>>2;if(6>=provisionalVersion)return Version.getVersionForNumber(provisionalVersion);for(var versionBits=0,ijMin=dimension-11,j=5;j>=0;j--)for(var i=dimension-9;i>=ijMin;i--)versionBits=this.copyBit(i,j,versionBits);if(this.parsedVersion=Version.decodeVersionInformation(versionBits),null!=this.parsedVersion&&this.parsedVersion.DimensionForVersion==dimension)return this.parsedVersion;versionBits=0;for(var i=5;i>=0;i--)for(var j=dimension-9;j>=ijMin;j--)versionBits=this.copyBit(i,j,versionBits);if(this.parsedVersion=Version.decodeVersionInformation(versionBits),null!=this.parsedVersion&&this.parsedVersion.DimensionForVersion==dimension)return this.parsedVersion;throw"Error readVersion"},this.readCodewords=function(){var formatInfo=this.readFormatInformation(),version=this.readVersion(),dataMask=DataMask.forReference(formatInfo.DataMask),dimension=this.bitMatrix.Dimension;dataMask.unmaskBitMatrix(this.bitMatrix,dimension);for(var functionPattern=version.buildFunctionPattern(),readingUp=!0,result=new Array(version.TotalCodewords),resultOffset=0,currentByte=0,bitsRead=0,j=dimension-1;j>0;j-=2){6==j&&j--;for(var count=0;dimension>count;count++)for(var i=readingUp?dimension-1-count:count,col=0;2>col;col++)functionPattern.get_Renamed(j-col,i)||(bitsRead++,currentByte<<=1,this.bitMatrix.get_Renamed(j-col,i)&&(currentByte|=1),8==bitsRead&&(result[resultOffset++]=currentByte,bitsRead=0,currentByte=0));readingUp^=!0}if(resultOffset!=version.TotalCodewords)throw"Error readCodewords";return result}}function DataMask000(){this.unmaskBitMatrix=function(bits,dimension){for(var i=0;dimension>i;i++)for(var j=0;dimension>j;j++)this.isMasked(i,j)&&bits.flip(j,i)},this.isMasked=function(i,j){return 0==(i+j&1)}}function DataMask001(){this.unmaskBitMatrix=function(bits,dimension){for(var i=0;dimension>i;i++)for(var j=0;dimension>j;j++)this.isMasked(i,j)&&bits.flip(j,i)},this.isMasked=function(i){return 0==(1&i)}}function DataMask010(){this.unmaskBitMatrix=function(bits,dimension){for(var i=0;dimension>i;i++)for(var j=0;dimension>j;j++)this.isMasked(i,j)&&bits.flip(j,i)},this.isMasked=function(i,j){return j%3==0}}function DataMask011(){this.unmaskBitMatrix=function(bits,dimension){for(var i=0;dimension>i;i++)for(var j=0;dimension>j;j++)this.isMasked(i,j)&&bits.flip(j,i)},this.isMasked=function(i,j){return(i+j)%3==0}}function DataMask100(){this.unmaskBitMatrix=function(bits,dimension){for(var i=0;dimension>i;i++)for(var j=0;dimension>j;j++)this.isMasked(i,j)&&bits.flip(j,i)},this.isMasked=function(i,j){return 0==(URShift(i,1)+j/3&1)}}function DataMask101(){this.unmaskBitMatrix=function(bits,dimension){for(var i=0;dimension>i;i++)for(var j=0;dimension>j;j++)this.isMasked(i,j)&&bits.flip(j,i)},this.isMasked=function(i,j){var temp=i*j;return(1&temp)+temp%3==0}}function DataMask110(){this.unmaskBitMatrix=function(bits,dimension){for(var i=0;dimension>i;i++)for(var j=0;dimension>j;j++)this.isMasked(i,j)&&bits.flip(j,i)},this.isMasked=function(i,j){var temp=i*j;return 0==((1&temp)+temp%3&1)}}function DataMask111(){this.unmaskBitMatrix=function(bits,dimension){for(var i=0;dimension>i;i++)for(var j=0;dimension>j;j++)this.isMasked(i,j)&&bits.flip(j,i)},this.isMasked=function(i,j){return 0==((i+j&1)+i*j%3&1)}}function ReedSolomonDecoder(field){this.field=field,this.decode=function(received,twoS){for(var poly=new GF256Poly(this.field,received),syndromeCoefficients=new Array(twoS),i=0;ii;i++){var eval=poly.evaluateAt(this.field.exp(dataMatrix?i+1:i));syndromeCoefficients[syndromeCoefficients.length-1-i]=eval,0!=eval&&(noError=!1)}if(!noError)for(var syndrome=new GF256Poly(this.field,syndromeCoefficients),sigmaOmega=this.runEuclideanAlgorithm(this.field.buildMonomial(twoS,1),syndrome,twoS),sigma=sigmaOmega[0],omega=sigmaOmega[1],errorLocations=this.findErrorLocations(sigma),errorMagnitudes=this.findErrorMagnitudes(omega,errorLocations,dataMatrix),i=0;iposition)throw"ReedSolomonException Bad error location";received[position]=GF256.addOrSubtract(received[position],errorMagnitudes[i])}},this.runEuclideanAlgorithm=function(a,b,R){if(a.Degree=Math.floor(R/2);){var rLastLast=rLast,sLastLast=sLast,tLastLast=tLast;if(rLast=r,sLast=s,tLast=t,rLast.Zero)throw"r_{i-1} was zero";r=rLastLast;for(var q=this.field.Zero,denominatorLeadingTerm=rLast.getCoefficient(rLast.Degree),dltInverse=this.field.inverse(denominatorLeadingTerm);r.Degree>=rLast.Degree&&!r.Zero;){var degreeDiff=r.Degree-rLast.Degree,scale=this.field.multiply(r.getCoefficient(r.Degree),dltInverse);q=q.addOrSubtract(this.field.buildMonomial(degreeDiff,scale)),r=r.addOrSubtract(rLast.multiplyByMonomial(degreeDiff,scale))}s=q.multiply1(sLast).addOrSubtract(sLastLast),t=q.multiply1(tLast).addOrSubtract(tLastLast)}var sigmaTildeAtZero=t.getCoefficient(0);if(0==sigmaTildeAtZero)throw"ReedSolomonException sigmaTilde(0) was zero";var inverse=this.field.inverse(sigmaTildeAtZero),sigma=t.multiply2(inverse),omega=r.multiply2(inverse);return new Array(sigma,omega)},this.findErrorLocations=function(errorLocator){var numErrors=errorLocator.Degree;if(1==numErrors)return new Array(errorLocator.getCoefficient(1));for(var result=new Array(numErrors),e=0,i=1;256>i&&numErrors>e;i++)0==errorLocator.evaluateAt(i)&&(result[e]=this.field.inverse(i),e++);if(e!=numErrors)throw"Error locator degree does not match number of roots";return result},this.findErrorMagnitudes=function(errorEvaluator,errorLocations,dataMatrix){for(var s=errorLocations.length,result=new Array(s),i=0;s>i;i++){for(var xiInverse=this.field.inverse(errorLocations[i]),denominator=1,j=0;s>j;j++)i!=j&&(denominator=this.field.multiply(denominator,GF256.addOrSubtract(1,this.field.multiply(errorLocations[j],xiInverse))));result[i]=this.field.multiply(errorEvaluator.evaluateAt(xiInverse),this.field.inverse(denominator)),dataMatrix&&(result[i]=this.field.multiply(result[i],xiInverse))}return result}}function GF256Poly(field,coefficients){if(null==coefficients||0==coefficients.length)throw"System.ArgumentException";this.field=field;var coefficientsLength=coefficients.length;if(coefficientsLength>1&&0==coefficients[0]){for(var firstNonZero=1;coefficientsLength>firstNonZero&&0==coefficients[firstNonZero];)firstNonZero++;if(firstNonZero==coefficientsLength)this.coefficients=field.Zero.coefficients;else{this.coefficients=new Array(coefficientsLength-firstNonZero);for(var i=0;ii;i++)result=GF256.addOrSubtract(result,this.coefficients[i]);return result}for(var result2=this.coefficients[0],i=1;size>i;i++)result2=GF256.addOrSubtract(this.field.multiply(a,result2),this.coefficients[i]);return result2},this.addOrSubtract=function(other){if(this.field!=other.field)throw"GF256Polys do not have same GF256 field";if(this.Zero)return other;if(other.Zero)return this;var smallerCoefficients=this.coefficients,largerCoefficients=other.coefficients;if(smallerCoefficients.length>largerCoefficients.length){var temp=smallerCoefficients;smallerCoefficients=largerCoefficients,largerCoefficients=temp}for(var sumDiff=new Array(largerCoefficients.length),lengthDiff=largerCoefficients.length-smallerCoefficients.length,ci=0;lengthDiff>ci;ci++)sumDiff[ci]=largerCoefficients[ci];for(var i=lengthDiff;ii;i++)for(var aCoeff=aCoefficients[i],j=0;bLength>j;j++)product[i+j]=GF256.addOrSubtract(product[i+j],this.field.multiply(aCoeff,bCoefficients[j]));return new GF256Poly(this.field,product)},this.multiply2=function(scalar){if(0==scalar)return this.field.Zero;if(1==scalar)return this;for(var size=this.coefficients.length,product=new Array(size),i=0;size>i;i++)product[i]=this.field.multiply(this.coefficients[i],scalar);return new GF256Poly(this.field,product)},this.multiplyByMonomial=function(degree,coefficient){if(0>degree)throw"System.ArgumentException";if(0==coefficient)return this.field.Zero;for(var size=this.coefficients.length,product=new Array(size+degree),i=0;ii;i++)product[i]=this.field.multiply(this.coefficients[i],coefficient);return new GF256Poly(this.field,product)},this.divide=function(other){if(this.field!=other.field)throw"GF256Polys do not have same GF256 field";if(other.Zero)throw"Divide by 0";for(var quotient=this.field.Zero,remainder=this,denominatorLeadingTerm=other.getCoefficient(other.Degree),inverseDenominatorLeadingTerm=this.field.inverse(denominatorLeadingTerm);remainder.Degree>=other.Degree&&!remainder.Zero;){var degreeDifference=remainder.Degree-other.Degree,scale=this.field.multiply(remainder.getCoefficient(remainder.Degree),inverseDenominatorLeadingTerm),term=other.multiplyByMonomial(degreeDifference,scale),iterationQuotient=this.field.buildMonomial(degreeDifference,scale); quotient=quotient.addOrSubtract(iterationQuotient),remainder=remainder.addOrSubtract(term)}return new Array(quotient,remainder)}}function GF256(primitive){this.expTable=new Array(256),this.logTable=new Array(256);for(var x=1,i=0;256>i;i++)this.expTable[i]=x,x<<=1,x>=256&&(x^=primitive);for(var i=0;255>i;i++)this.logTable[this.expTable[i]]=i;var at0=new Array(1);at0[0]=0,this.zero=new GF256Poly(this,new Array(at0));var at1=new Array(1);at1[0]=1,this.one=new GF256Poly(this,new Array(at1)),this.__defineGetter__("Zero",function(){return this.zero}),this.__defineGetter__("One",function(){return this.one}),this.buildMonomial=function(degree,coefficient){if(0>degree)throw"System.ArgumentException";if(0==coefficient)return zero;for(var coefficients=new Array(degree+1),i=0;i=0?number>>bits:(number>>bits)+(2<<~bits)}function FinderPattern(posX,posY,estimatedModuleSize){this.x=posX,this.y=posY,this.count=1,this.estimatedModuleSize=estimatedModuleSize,this.__defineGetter__("EstimatedModuleSize",function(){return this.estimatedModuleSize}),this.__defineGetter__("Count",function(){return this.count}),this.__defineGetter__("X",function(){return this.x}),this.__defineGetter__("Y",function(){return this.y}),this.incrementCount=function(){this.count++},this.aboutEquals=function(moduleSize,i,j){if(Math.abs(i-this.y)<=moduleSize&&Math.abs(j-this.x)<=moduleSize){var moduleSizeDiff=Math.abs(moduleSize-this.estimatedModuleSize);return 1>=moduleSizeDiff||moduleSizeDiff/this.estimatedModuleSize<=1}return!1}}function FinderPatternInfo(patternCenters){this.bottomLeft=patternCenters[0],this.topLeft=patternCenters[1],this.topRight=patternCenters[2],this.__defineGetter__("BottomLeft",function(){return this.bottomLeft}),this.__defineGetter__("TopLeft",function(){return this.topLeft}),this.__defineGetter__("TopRight",function(){return this.topRight})}function FinderPatternFinder(){this.image=null,this.possibleCenters=[],this.hasSkipped=!1,this.crossCheckStateCount=new Array(0,0,0,0,0),this.resultPointCallback=null,this.__defineGetter__("CrossCheckStateCount",function(){return this.crossCheckStateCount[0]=0,this.crossCheckStateCount[1]=0,this.crossCheckStateCount[2]=0,this.crossCheckStateCount[3]=0,this.crossCheckStateCount[4]=0,this.crossCheckStateCount}),this.foundPatternCross=function(stateCount){for(var totalModuleSize=0,i=0;5>i;i++){var count=stateCount[i];if(0==count)return!1;totalModuleSize+=count}if(7>totalModuleSize)return!1;var moduleSize=Math.floor((totalModuleSize<=0&&image[centerJ+i*qrcode.width];)stateCount[2]++,i--;if(0>i)return 0/0;for(;i>=0&&!image[centerJ+i*qrcode.width]&&stateCount[1]<=maxCount;)stateCount[1]++,i--;if(0>i||stateCount[1]>maxCount)return 0/0;for(;i>=0&&image[centerJ+i*qrcode.width]&&stateCount[0]<=maxCount;)stateCount[0]++,i--;if(stateCount[0]>maxCount)return 0/0;for(i=startI+1;maxI>i&&image[centerJ+i*qrcode.width];)stateCount[2]++,i++;if(i==maxI)return 0/0;for(;maxI>i&&!image[centerJ+i*qrcode.width]&&stateCount[3]=maxCount)return 0/0;for(;maxI>i&&image[centerJ+i*qrcode.width]&&stateCount[4]=maxCount)return 0/0;var stateCountTotal=stateCount[0]+stateCount[1]+stateCount[2]+stateCount[3]+stateCount[4];return 5*Math.abs(stateCountTotal-originalStateCountTotal)>=2*originalStateCountTotal?0/0:this.foundPatternCross(stateCount)?this.centerFromEnd(stateCount,i):0/0},this.crossCheckHorizontal=function(startJ,centerI,maxCount,originalStateCountTotal){for(var image=this.image,maxJ=qrcode.width,stateCount=this.CrossCheckStateCount,j=startJ;j>=0&&image[j+centerI*qrcode.width];)stateCount[2]++,j--;if(0>j)return 0/0;for(;j>=0&&!image[j+centerI*qrcode.width]&&stateCount[1]<=maxCount;)stateCount[1]++,j--;if(0>j||stateCount[1]>maxCount)return 0/0;for(;j>=0&&image[j+centerI*qrcode.width]&&stateCount[0]<=maxCount;)stateCount[0]++,j--;if(stateCount[0]>maxCount)return 0/0;for(j=startJ+1;maxJ>j&&image[j+centerI*qrcode.width];)stateCount[2]++,j++;if(j==maxJ)return 0/0;for(;maxJ>j&&!image[j+centerI*qrcode.width]&&stateCount[3]=maxCount)return 0/0;for(;maxJ>j&&image[j+centerI*qrcode.width]&&stateCount[4]=maxCount)return 0/0;var stateCountTotal=stateCount[0]+stateCount[1]+stateCount[2]+stateCount[3]+stateCount[4];return 5*Math.abs(stateCountTotal-originalStateCountTotal)>=originalStateCountTotal?0/0:this.foundPatternCross(stateCount)?this.centerFromEnd(stateCount,j):0/0},this.handlePossibleCenter=function(stateCount,i,j){var stateCountTotal=stateCount[0]+stateCount[1]+stateCount[2]+stateCount[3]+stateCount[4],centerJ=this.centerFromEnd(stateCount,j),centerI=this.crossCheckVertical(i,Math.floor(centerJ),stateCount[2],stateCountTotal);if(!isNaN(centerI)&&(centerJ=this.crossCheckHorizontal(Math.floor(centerJ),Math.floor(centerI),stateCount[2],stateCountTotal),!isNaN(centerJ))){for(var estimatedModuleSize=stateCountTotal/7,found=!1,max=this.possibleCenters.length,index=0;max>index;index++){var center=this.possibleCenters[index];if(center.aboutEquals(estimatedModuleSize,centerI,centerJ)){center.incrementCount(),found=!0;break}}if(!found){var point=new FinderPattern(centerJ,centerI,estimatedModuleSize);this.possibleCenters.push(point),null!=this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(point)}return!0}return!1},this.selectBestPatterns=function(){var startSize=this.possibleCenters.length;if(3>startSize)throw"Couldn't find enough finder patterns";if(startSize>3){for(var totalModuleSize=0,square=0,i=0;startSize>i;i++){var centerValue=this.possibleCenters[i].EstimatedModuleSize;totalModuleSize+=centerValue,square+=centerValue*centerValue}var average=totalModuleSize/startSize;this.possibleCenters.sort(function(center1,center2){var dA=Math.abs(center2.EstimatedModuleSize-average),dB=Math.abs(center1.EstimatedModuleSize-average);return dB>dA?-1:dA==dB?0:1});for(var stdDev=Math.sqrt(square/startSize-average*average),limit=Math.max(.2*average,stdDev),i=0;i3;i++){var pattern=this.possibleCenters[i];Math.abs(pattern.EstimatedModuleSize-average)>limit&&(this.possibleCenters.remove(i),i--)}}return this.possibleCenters.length>3&&this.possibleCenters.sort(function(a,b){return a.count>b.count?-1:a.count=max)return 0;for(var firstConfirmedCenter=null,i=0;max>i;i++){var center=this.possibleCenters[i];if(center.Count>=CENTER_QUORUM){if(null!=firstConfirmedCenter)return this.hasSkipped=!0,Math.floor((Math.abs(firstConfirmedCenter.X-center.X)-Math.abs(firstConfirmedCenter.Y-center.Y))/2);firstConfirmedCenter=center}}return 0},this.haveMultiplyConfirmedCenters=function(){for(var confirmedCount=0,totalModuleSize=0,max=this.possibleCenters.length,i=0;max>i;i++){var pattern=this.possibleCenters[i];pattern.Count>=CENTER_QUORUM&&(confirmedCount++,totalModuleSize+=pattern.EstimatedModuleSize)}if(3>confirmedCount)return!1;for(var average=totalModuleSize/max,totalDeviation=0,i=0;max>i;i++)pattern=this.possibleCenters[i],totalDeviation+=Math.abs(pattern.EstimatedModuleSize-average);return.05*totalModuleSize>=totalDeviation},this.findFinderPattern=function(image){var tryHarder=!1;this.image=image;var maxI=qrcode.height,maxJ=qrcode.width,iSkip=Math.floor(3*maxI/(4*MAX_MODULES));(MIN_SKIP>iSkip||tryHarder)&&(iSkip=MIN_SKIP);for(var done=!1,stateCount=new Array(5),i=iSkip-1;maxI>i&&!done;i+=iSkip){stateCount[0]=0,stateCount[1]=0,stateCount[2]=0,stateCount[3]=0,stateCount[4]=0;for(var currentState=0,j=0;maxJ>j;j++)if(image[j+i*qrcode.width])1==(1¤tState)&¤tState++,stateCount[currentState]++;else if(0==(1¤tState))if(4==currentState)if(this.foundPatternCross(stateCount)){var confirmed=this.handlePossibleCenter(stateCount,i,j);if(confirmed)if(iSkip=2,this.hasSkipped)done=this.haveMultiplyConfirmedCenters();else{var rowSkip=this.findRowSkip();rowSkip>stateCount[2]&&(i+=rowSkip-stateCount[2]-iSkip,j=maxJ-1)}else{do j++;while(maxJ>j&&!image[j+i*qrcode.width]);j--}currentState=0,stateCount[0]=0,stateCount[1]=0,stateCount[2]=0,stateCount[3]=0,stateCount[4]=0}else stateCount[0]=stateCount[2],stateCount[1]=stateCount[3],stateCount[2]=stateCount[4],stateCount[3]=1,stateCount[4]=0,currentState=3;else stateCount[++currentState]++;else stateCount[currentState]++;if(this.foundPatternCross(stateCount)){var confirmed=this.handlePossibleCenter(stateCount,i,maxJ);confirmed&&(iSkip=stateCount[0],this.hasSkipped&&(done=haveMultiplyConfirmedCenters()))}}var patternInfo=this.selectBestPatterns();return qrcode.orderBestPatterns(patternInfo),new FinderPatternInfo(patternInfo)}}function AlignmentPattern(posX,posY,estimatedModuleSize){this.x=posX,this.y=posY,this.count=1,this.estimatedModuleSize=estimatedModuleSize,this.__defineGetter__("EstimatedModuleSize",function(){return this.estimatedModuleSize}),this.__defineGetter__("Count",function(){return this.count}),this.__defineGetter__("X",function(){return Math.floor(this.x)}),this.__defineGetter__("Y",function(){return Math.floor(this.y)}),this.incrementCount=function(){this.count++},this.aboutEquals=function(moduleSize,i,j){if(Math.abs(i-this.y)<=moduleSize&&Math.abs(j-this.x)<=moduleSize){var moduleSizeDiff=Math.abs(moduleSize-this.estimatedModuleSize);return 1>=moduleSizeDiff||moduleSizeDiff/this.estimatedModuleSize<=1}return!1}}function AlignmentPatternFinder(image,startX,startY,width,height,moduleSize,resultPointCallback){this.image=image,this.possibleCenters=new Array,this.startX=startX,this.startY=startY,this.width=width,this.height=height,this.moduleSize=moduleSize,this.crossCheckStateCount=new Array(0,0,0),this.resultPointCallback=resultPointCallback,this.centerFromEnd=function(stateCount,end){return end-stateCount[2]-stateCount[1]/2},this.foundPatternCross=function(stateCount){for(var moduleSize=this.moduleSize,maxVariance=moduleSize/2,i=0;3>i;i++)if(Math.abs(moduleSize-stateCount[i])>=maxVariance)return!1;return!0},this.crossCheckVertical=function(startI,centerJ,maxCount,originalStateCountTotal){var image=this.image,maxI=qrcode.height,stateCount=this.crossCheckStateCount;stateCount[0]=0,stateCount[1]=0,stateCount[2]=0;for(var i=startI;i>=0&&image[centerJ+i*qrcode.width]&&stateCount[1]<=maxCount;)stateCount[1]++,i--;if(0>i||stateCount[1]>maxCount)return 0/0;for(;i>=0&&!image[centerJ+i*qrcode.width]&&stateCount[0]<=maxCount;)stateCount[0]++,i--;if(stateCount[0]>maxCount)return 0/0;for(i=startI+1;maxI>i&&image[centerJ+i*qrcode.width]&&stateCount[1]<=maxCount;)stateCount[1]++,i++;if(i==maxI||stateCount[1]>maxCount)return 0/0;for(;maxI>i&&!image[centerJ+i*qrcode.width]&&stateCount[2]<=maxCount;)stateCount[2]++,i++;if(stateCount[2]>maxCount)return 0/0;var stateCountTotal=stateCount[0]+stateCount[1]+stateCount[2];return 5*Math.abs(stateCountTotal-originalStateCountTotal)>=2*originalStateCountTotal?0/0:this.foundPatternCross(stateCount)?this.centerFromEnd(stateCount,i):0/0},this.handlePossibleCenter=function(stateCount,i,j){var stateCountTotal=stateCount[0]+stateCount[1]+stateCount[2],centerJ=this.centerFromEnd(stateCount,j),centerI=this.crossCheckVertical(i,Math.floor(centerJ),2*stateCount[1],stateCountTotal);if(!isNaN(centerI)){for(var estimatedModuleSize=(stateCount[0]+stateCount[1]+stateCount[2])/3,max=this.possibleCenters.length,index=0;max>index;index++){var center=this.possibleCenters[index];if(center.aboutEquals(estimatedModuleSize,centerI,centerJ))return new AlignmentPattern(centerJ,centerI,estimatedModuleSize)}var point=new AlignmentPattern(centerJ,centerI,estimatedModuleSize);this.possibleCenters.push(point),null!=this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(point)}return null},this.find=function(){for(var startX=this.startX,height=this.height,maxJ=startX+width,middleI=startY+(height>>1),stateCount=new Array(0,0,0),iGen=0;height>iGen;iGen++){var i=middleI+(0==(1&iGen)?iGen+1>>1:-(iGen+1>>1));stateCount[0]=0,stateCount[1]=0,stateCount[2]=0;for(var j=startX;maxJ>j&&!image[j+qrcode.width*i];)j++;for(var currentState=0;maxJ>j;){if(image[j+i*qrcode.width])if(1==currentState)stateCount[currentState]++;else if(2==currentState){if(this.foundPatternCross(stateCount)){var confirmed=this.handlePossibleCenter(stateCount,i,j);if(null!=confirmed)return confirmed}stateCount[0]=stateCount[2],stateCount[1]=1,stateCount[2]=0,currentState=1}else stateCount[++currentState]++;else 1==currentState&¤tState++,stateCount[currentState]++;j++}if(this.foundPatternCross(stateCount)){var confirmed=this.handlePossibleCenter(stateCount,i,maxJ);if(null!=confirmed)return confirmed}}if(0!=this.possibleCenters.length)return this.possibleCenters[0];throw"Couldn't find enough alignment patterns"}}function QRCodeDataBlockReader(blocks,version,numErrorCorrectionCode){this.blockPointer=0,this.bitPointer=7,this.dataLength=0,this.blocks=blocks,this.numErrorCorrectionCode=numErrorCorrectionCode,9>=version?this.dataLengthMode=0:version>=10&&26>=version?this.dataLengthMode=1:version>=27&&40>=version&&(this.dataLengthMode=2),this.getNextBits=function(numBits){var bits=0;if(numBitsi;i++)mask+=1<>this.bitPointer-numBits+1,this.bitPointer-=numBits,bits}if(numBits>8-(numBits-(this.bitPointer+1)),this.bitPointer=this.bitPointer-numBits%8,this.bitPointer<0&&(this.bitPointer=8+this.bitPointer),bits}if(numBits>8-(numBits-(this.bitPointer+1+8));return bits=bitsFirstBlock+bitsSecondBlock+bitsThirdBlock,this.bitPointer=this.bitPointer-(numBits-8)%8,this.bitPointer<0&&(this.bitPointer=8+this.bitPointer),bits}return 0},this.NextMode=function(){return this.blockPointer>this.blocks.length-this.numErrorCorrectionCode-2?0:this.getNextBits(4)},this.getDataLength=function(modeIndicator){for(var index=0;;){if(modeIndicator>>index==1)break;index++}return this.getNextBits(qrcode.sizeOfDataLengthInfo[this.dataLengthMode][index])},this.getRomanAndFigureString=function(dataLength){var length=dataLength,intData=0,strData="",tableRomanAndFigure=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":");do if(length>1){intData=this.getNextBits(11);var firstLetter=Math.floor(intData/45),secondLetter=intData%45;strData+=tableRomanAndFigure[firstLetter],strData+=tableRomanAndFigure[secondLetter],length-=2}else 1==length&&(intData=this.getNextBits(6),strData+=tableRomanAndFigure[intData],length-=1);while(length>0);return strData},this.getFigureString=function(dataLength){var length=dataLength,intData=0,strData="";do length>=3?(intData=this.getNextBits(10),100>intData&&(strData+="0"),10>intData&&(strData+="0"),length-=3):2==length?(intData=this.getNextBits(7),10>intData&&(strData+="0"),length-=2):1==length&&(intData=this.getNextBits(4),length-=1),strData+=intData;while(length>0);return strData},this.get8bitByteArray=function(dataLength){var length=dataLength,intData=0,output=new Array;do intData=this.getNextBits(8),output.push(intData),length--;while(length>0);return output},this.getKanjiString=function(dataLength){var length=dataLength,intData=0,unicodeString="";do{intData=getNextBits(13);var lowerByte=intData%192,higherByte=intData/192,tempWord=(higherByte<<8)+lowerByte,shiftjisWord=0;shiftjisWord=40956>=tempWord+33088?tempWord+33088:tempWord+49472,unicodeString+=String.fromCharCode(shiftjisWord),length--}while(length>0);return unicodeString},this.__defineGetter__("DataByte",function(){for(var output=new Array,MODE_NUMBER=1,MODE_ROMAN_AND_NUMBER=2,MODE_8BIT_BYTE=4,MODE_KANJI=8;;){var mode=this.NextMode();if(0==mode){if(output.length>0)break;throw"Empty data block"}if(mode!=MODE_NUMBER&&mode!=MODE_ROMAN_AND_NUMBER&&mode!=MODE_8BIT_BYTE&&mode!=MODE_KANJI)throw"Invalid mode: "+mode+" in (block:"+this.blockPointer+" bit:"+this.bitPointer+")";if(dataLength=this.getDataLength(mode),1>dataLength)throw"Invalid data length: "+dataLength;switch(mode){case MODE_NUMBER:for(var temp_str=this.getFigureString(dataLength),ta=new Array(temp_str.length),j=0;j1048576){var canvas=document.createElement("canvas");canvas.width=canvas.height=1;var ctx=canvas.getContext("2d");return ctx.drawImage(img,-iw+1,0),0===ctx.getImageData(0,0,1,1).data[3]}return!1}function detectVerticalSquash(img,iw,ih){var canvas=document.createElement("canvas");canvas.width=1,canvas.height=ih;var ctx=canvas.getContext("2d");ctx.drawImage(img,0,0);for(var data=ctx.getImageData(0,0,1,ih).data,sy=0,ey=ih,py=ih;py>sy;){var alpha=data[4*(py-1)+3];0===alpha?ey=py:sy=py,py=ey+sy>>1}var ratio=py/ih;return 0===ratio?1:ratio}function renderImageToDataURL(img,options,doSquash){var canvas=document.createElement("canvas");return renderImageToCanvas(img,canvas,options,doSquash),canvas.toDataURL("image/jpeg",options.quality||.8)}function renderImageToCanvas(img,canvas,options,doSquash){var iw=img.naturalWidth,ih=img.naturalHeight,width=options.width,height=options.height,ctx=canvas.getContext("2d");ctx.save(),transformCoordinate(canvas,width,height,options.orientation);var subsampled=detectSubsampling(img);subsampled&&(iw/=2,ih/=2);var d=1024,tmpCanvas=document.createElement("canvas");tmpCanvas.width=tmpCanvas.height=d;for(var tmpCtx=tmpCanvas.getContext("2d"),vertSquashRatio=doSquash?detectVerticalSquash(img,iw,ih):1,dw=Math.ceil(d*width/iw),dh=Math.ceil(d*height/ih/vertSquashRatio),sy=0,dy=0;ih>sy;){for(var sx=0,dx=0;iw>sx;)tmpCtx.clearRect(0,0,d,d),tmpCtx.drawImage(img,-sx,-sy),ctx.drawImage(tmpCanvas,0,0,d,d,dx,dy,dw,dh),sx+=d,dx+=dw;sy+=d,dy+=dh}ctx.restore(),tmpCanvas=tmpCtx=null}function transformCoordinate(canvas,width,height,orientation){switch(orientation){case 5:case 6:case 7:case 8:canvas.width=height,canvas.height=width;break;default:canvas.width=width,canvas.height=height}var ctx=canvas.getContext("2d");switch(orientation){case 2:ctx.translate(width,0),ctx.scale(-1,1);break;case 3:ctx.translate(width,height),ctx.rotate(Math.PI);break;case 4:ctx.translate(0,height),ctx.scale(1,-1);break;case 5:ctx.rotate(.5*Math.PI),ctx.scale(1,-1);break;case 6:ctx.rotate(.5*Math.PI),ctx.translate(0,-height);break;case 7:ctx.rotate(.5*Math.PI),ctx.translate(width,-height),ctx.scale(-1,1);break;case 8:ctx.rotate(-.5*Math.PI),ctx.translate(-width,0)}}function MegaPixImage(srcImage){if(window.Blob&&srcImage instanceof Blob){var img=new Image,URL=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;if(!URL)throw Error("No createObjectURL function found to create blob url");img.src=URL.createObjectURL(srcImage),this.blob=srcImage,srcImage=img}if(!srcImage.naturalWidth&&!srcImage.naturalHeight){var _this=this;srcImage.onload=function(){var listeners=_this.imageLoadListeners;if(listeners){_this.imageLoadListeners=null;for(var i=0,len=listeners.length;len>i;i++)listeners[i]()}},this.imageLoadListeners=[]}this.srcImage=srcImage}MegaPixImage.prototype.render=function(target,options){if(this.imageLoadListeners){var _this=this;return void this.imageLoadListeners.push(function(){_this.render(target,options)})}options=options||{};var imgWidth=this.srcImage.naturalWidth,imgHeight=this.srcImage.naturalHeight,width=options.width,height=options.height,maxWidth=options.maxWidth,maxHeight=options.maxHeight,doSquash=!this.blob||"image/jpeg"===this.blob.type;width&&!height?height=imgHeight*width/imgWidth<<0:height&&!width?width=imgWidth*height/imgHeight<<0:(width=imgWidth,height=imgHeight),maxWidth&&width>maxWidth&&(width=maxWidth,height=imgHeight*width/imgWidth<<0),maxHeight&&height>maxHeight&&(height=maxHeight,width=imgWidth*height/imgHeight<<0);var opt={width:width,height:height};for(var k in options)opt[k]=options[k];var tagName=target.tagName.toLowerCase();"img"===tagName?target.src=renderImageToDataURL(this.srcImage,opt,doSquash):"canvas"===tagName&&renderImageToCanvas(this.srcImage,target,opt,doSquash),"function"==typeof this.onrender&&this.onrender(target)},"function"==typeof define&&define.amd?define([],function(){return MegaPixImage}):this.MegaPixImage=MegaPixImage}();var qrcode=function(){function qrPolynomial(num,shift){if("undefined"==typeof num.length)throw new Error(num.length+"/"+shift);var _num=function(){for(var offset=0;offsetrow;row+=1){modules[row]=new Array(moduleCount);for(var col=0;moduleCount>col;col+=1)modules[row][col]=null}return modules}(_moduleCount),setupPositionProbePattern(0,0),setupPositionProbePattern(_moduleCount-7,0),setupPositionProbePattern(0,_moduleCount-7),setupPositionAdjustPattern(),setupTimingPattern(),setupTypeInfo(test,maskPattern),_typeNumber>=7&&setupTypeNumber(test),null==_dataCache&&(_dataCache=createData(_typeNumber,_errorCorrectLevel,_dataList)),mapData(_dataCache,maskPattern)},setupPositionProbePattern=function(row,col){for(var r=-1;7>=r;r+=1)if(!(-1>=row+r||row+r>=_moduleCount))for(var c=-1;7>=c;c+=1)-1>=col+c||col+c>=_moduleCount||(_modules[row+r][col+c]=r>=0&&6>=r&&(0==c||6==c)||c>=0&&6>=c&&(0==r||6==r)||r>=2&&4>=r&&c>=2&&4>=c?!0:!1)},getBestMaskPattern=function(){for(var minLostPoint=0,pattern=0,i=0;8>i;i+=1){makeImpl(!0,i);var lostPoint=QRUtil.getLostPoint(_this);(0==i||minLostPoint>lostPoint)&&(minLostPoint=lostPoint,pattern=i)}return pattern},setupTimingPattern=function(){for(var r=8;_moduleCount-8>r;r+=1)null==_modules[r][6]&&(_modules[r][6]=r%2==0);for(var c=8;_moduleCount-8>c;c+=1)null==_modules[6][c]&&(_modules[6][c]=c%2==0)},setupPositionAdjustPattern=function(){for(var pos=QRUtil.getPatternPosition(_typeNumber),i=0;i=r;r+=1)for(var c=-2;2>=c;c+=1)_modules[row+r][col+c]=-2==r||2==r||-2==c||2==c||0==r&&0==c?!0:!1}},setupTypeNumber=function(test){for(var bits=QRUtil.getBCHTypeNumber(_typeNumber),i=0;18>i;i+=1){var mod=!test&&1==(bits>>i&1);_modules[Math.floor(i/3)][i%3+_moduleCount-8-3]=mod}for(var i=0;18>i;i+=1){var mod=!test&&1==(bits>>i&1);_modules[i%3+_moduleCount-8-3][Math.floor(i/3)]=mod}},setupTypeInfo=function(test,maskPattern){for(var data=_errorCorrectLevel<<3|maskPattern,bits=QRUtil.getBCHTypeInfo(data),i=0;15>i;i+=1){var mod=!test&&1==(bits>>i&1);6>i?_modules[i][8]=mod:8>i?_modules[i+1][8]=mod:_modules[_moduleCount-15+i][8]=mod}for(var i=0;15>i;i+=1){var mod=!test&&1==(bits>>i&1);8>i?_modules[8][_moduleCount-i-1]=mod:9>i?_modules[8][15-i-1+1]=mod:_modules[8][15-i-1]=mod}_modules[_moduleCount-8][8]=!test},mapData=function(data,maskPattern){for(var inc=-1,row=_moduleCount-1,bitIndex=7,byteIndex=0,maskFunc=QRUtil.getMaskFunction(maskPattern),col=_moduleCount-1;col>0;col-=2)for(6==col&&(col-=1);;){for(var c=0;2>c;c+=1)if(null==_modules[row][col-c]){var dark=!1;byteIndex>>bitIndex&1));var mask=maskFunc(row,col-c);mask&&(dark=!dark),_modules[row][col-c]=dark,bitIndex-=1,-1==bitIndex&&(byteIndex+=1,bitIndex=7)}if(row+=inc,0>row||row>=_moduleCount){row-=inc,inc=-inc;break}}},createBytes=function(buffer,rsBlocks){for(var offset=0,maxDcCount=0,maxEcCount=0,dcdata=new Array(rsBlocks.length),ecdata=new Array(rsBlocks.length),r=0;r=0?modPoly.getAt(modIndex):0}}for(var totalCodeCount=0,i=0;ii;i+=1)for(var r=0;ri;i+=1)for(var r=0;r8*totalDataCount)throw new Error("code length overflow. ("+buffer.getLengthInBits()+">"+8*totalDataCount+")");for(buffer.getLengthInBits()+4<=8*totalDataCount&&buffer.put(0,4);buffer.getLengthInBits()%8!=0;)buffer.putBit(!1);for(;;){if(buffer.getLengthInBits()>=8*totalDataCount)break;if(buffer.put(PAD0,8),buffer.getLengthInBits()>=8*totalDataCount)break;buffer.put(PAD1,8)}return createBytes(buffer,rsBlocks)};return _this.addData=function(data){var newData=qr8BitByte(data);_dataList.push(newData),_dataCache=null},_this.isDark=function(row,col){if(0>row||row>=_moduleCount||0>col||col>=_moduleCount)throw new Error(row+","+col);return _modules[row][col]},_this.getModuleCount=function(){return _moduleCount},_this.make=function(){makeImpl(!1,getBestMaskPattern())},_this.createTableTag=function(cellSize,margin){cellSize=cellSize||2,margin="undefined"==typeof margin?4*cellSize:margin;var qrHtml="";qrHtml+='";for(var c=0;c<_this.getModuleCount();c+=1)qrHtml+='"}return qrHtml+="",qrHtml+="
    ';qrHtml+="
    "},_this.createImgTag=function(cellSize,margin){cellSize=cellSize||2,margin="undefined"==typeof margin?4*cellSize:margin;var size=_this.getModuleCount()*cellSize+2*margin,min=margin,max=size-margin;return createImgTag(size,size,function(x,y){if(x>=min&&max>x&&y>=min&&max>y){var c=Math.floor((x-min)/cellSize),r=Math.floor((y-min)/cellSize);return _this.isDark(r,c)?0:1}return 1})},_this};qrcode.stringToBytes=function(s){for(var bytes=new Array,i=0;ic)bytes.push(c);else{var b=unicodeMap[s.charAt(i)];"number"==typeof b?(255&b)==b?bytes.push(b):(bytes.push(b>>>8),bytes.push(255&b)):bytes.push(unknownChar)}}return bytes}};var QRMode={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},QRErrorCorrectLevel={L:1,M:0,Q:3,H:2},QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},QRUtil=function(){var PATTERN_POSITION_TABLE=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15=1335,G18=7973,G15_MASK=21522,_this={},getBCHDigit=function(data){for(var digit=0;0!=data;)digit+=1,data>>>=1; return digit};return _this.getBCHTypeInfo=function(data){for(var d=data<<10;getBCHDigit(d)-getBCHDigit(G15)>=0;)d^=G15<=0;)d^=G18<i;i+=1)a=a.multiply(qrPolynomial([1,QRMath.gexp(i)],0));return a},_this.getLengthInBits=function(mode,type){if(type>=1&&10>type)switch(mode){case QRMode.MODE_NUMBER:return 10;case QRMode.MODE_ALPHA_NUM:return 9;case QRMode.MODE_8BIT_BYTE:return 8;case QRMode.MODE_KANJI:return 8;default:throw new Error("mode:"+mode)}else if(27>type)switch(mode){case QRMode.MODE_NUMBER:return 12;case QRMode.MODE_ALPHA_NUM:return 11;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 10;default:throw new Error("mode:"+mode)}else{if(!(41>type))throw new Error("type:"+type);switch(mode){case QRMode.MODE_NUMBER:return 14;case QRMode.MODE_ALPHA_NUM:return 13;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 12;default:throw new Error("mode:"+mode)}}},_this.getLostPoint=function(qrcode){for(var moduleCount=qrcode.getModuleCount(),lostPoint=0,row=0;moduleCount>row;row+=1)for(var col=0;moduleCount>col;col+=1){for(var sameCount=0,dark=qrcode.isDark(row,col),r=-1;1>=r;r+=1)if(!(0>row+r||row+r>=moduleCount))for(var c=-1;1>=c;c+=1)0>col+c||col+c>=moduleCount||(0!=r||0!=c)&&dark==qrcode.isDark(row+r,col+c)&&(sameCount+=1);sameCount>5&&(lostPoint+=3+sameCount-5)}for(var row=0;moduleCount-1>row;row+=1)for(var col=0;moduleCount-1>col;col+=1){var count=0;qrcode.isDark(row,col)&&(count+=1),qrcode.isDark(row+1,col)&&(count+=1),qrcode.isDark(row,col+1)&&(count+=1),qrcode.isDark(row+1,col+1)&&(count+=1),(0==count||4==count)&&(lostPoint+=3)}for(var row=0;moduleCount>row;row+=1)for(var col=0;moduleCount-6>col;col+=1)qrcode.isDark(row,col)&&!qrcode.isDark(row,col+1)&&qrcode.isDark(row,col+2)&&qrcode.isDark(row,col+3)&&qrcode.isDark(row,col+4)&&!qrcode.isDark(row,col+5)&&qrcode.isDark(row,col+6)&&(lostPoint+=40);for(var col=0;moduleCount>col;col+=1)for(var row=0;moduleCount-6>row;row+=1)qrcode.isDark(row,col)&&!qrcode.isDark(row+1,col)&&qrcode.isDark(row+2,col)&&qrcode.isDark(row+3,col)&&qrcode.isDark(row+4,col)&&!qrcode.isDark(row+5,col)&&qrcode.isDark(row+6,col)&&(lostPoint+=40);for(var darkCount=0,col=0;moduleCount>col;col+=1)for(var row=0;moduleCount>row;row+=1)qrcode.isDark(row,col)&&(darkCount+=1);var ratio=Math.abs(100*darkCount/moduleCount/moduleCount-50)/5;return lostPoint+=10*ratio},_this}(),QRMath=function(){for(var EXP_TABLE=new Array(256),LOG_TABLE=new Array(256),i=0;8>i;i+=1)EXP_TABLE[i]=1<i;i+=1)EXP_TABLE[i]=EXP_TABLE[i-4]^EXP_TABLE[i-5]^EXP_TABLE[i-6]^EXP_TABLE[i-8];for(var i=0;255>i;i+=1)LOG_TABLE[EXP_TABLE[i]]=i;var _this={};return _this.glog=function(n){if(1>n)throw new Error("glog("+n+")");return LOG_TABLE[n]},_this.gexp=function(n){for(;0>n;)n+=255;for(;n>=256;)n-=255;return EXP_TABLE[n]},_this}(),QRRSBlock=function(){var RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16]],qrRSBlock=function(totalCount,dataCount){var _this={};return _this.totalCount=totalCount,_this.dataCount=dataCount,_this},_this={},getRsBlockTable=function(typeNumber,errorCorrectLevel){switch(errorCorrectLevel){case QRErrorCorrectLevel.L:return RS_BLOCK_TABLE[4*(typeNumber-1)+0];case QRErrorCorrectLevel.M:return RS_BLOCK_TABLE[4*(typeNumber-1)+1];case QRErrorCorrectLevel.Q:return RS_BLOCK_TABLE[4*(typeNumber-1)+2];case QRErrorCorrectLevel.H:return RS_BLOCK_TABLE[4*(typeNumber-1)+3];default:return void 0}};return _this.getRSBlocks=function(typeNumber,errorCorrectLevel){var rsBlock=getRsBlockTable(typeNumber,errorCorrectLevel);if("undefined"==typeof rsBlock)throw new Error("bad rs block @ typeNumber:"+typeNumber+"/errorCorrectLevel:"+errorCorrectLevel);for(var length=rsBlock.length/3,list=new Array,i=0;length>i;i+=1)for(var count=rsBlock[3*i+0],totalCount=rsBlock[3*i+1],dataCount=rsBlock[3*i+2],j=0;count>j;j+=1)list.push(qrRSBlock(totalCount,dataCount));return list},_this}(),qrBitBuffer=function(){var _buffer=new Array,_length=0,_this={};return _this.getBuffer=function(){return _buffer},_this.getAt=function(index){var bufIndex=Math.floor(index/8);return 1==(_buffer[bufIndex]>>>7-index%8&1)},_this.put=function(num,length){for(var i=0;length>i;i+=1)_this.putBit(1==(num>>>length-i-1&1))},_this.getLengthInBits=function(){return _length},_this.putBit=function(bit){var bufIndex=Math.floor(_length/8);_buffer.length<=bufIndex&&_buffer.push(0),bit&&(_buffer[bufIndex]|=128>>>_length%8),_length+=1},_this},qr8BitByte=function(data){var _mode=QRMode.MODE_8BIT_BYTE,_bytes=qrcode.stringToBytes(data),_this={};return _this.getMode=function(){return _mode},_this.getLength=function(){return _bytes.length},_this.write=function(buffer){for(var i=0;i<_bytes.length;i+=1)buffer.put(_bytes[i],8)},_this},byteArrayOutputStream=function(){var _bytes=new Array,_this={};return _this.writeByte=function(b){_bytes.push(255&b)},_this.writeShort=function(i){_this.writeByte(i),_this.writeByte(i>>>8)},_this.writeBytes=function(b,off,len){off=off||0,len=len||b.length;for(var i=0;len>i;i+=1)_this.writeByte(b[i+off])},_this.writeString=function(s){for(var i=0;i0&&(s+=","),s+=_bytes[i];return s+="]"},_this},base64EncodeOutputStream=function(){var _buffer=0,_buflen=0,_length=0,_base64="",_this={},writeEncoded=function(b){_base64+=String.fromCharCode(encode(63&b))},encode=function(n){if(0>n);else{if(26>n)return 65+n;if(52>n)return 97+(n-26);if(62>n)return 48+(n-52);if(62==n)return 43;if(63==n)return 47}throw new Error("n:"+n)};return _this.writeByte=function(n){for(_buffer=_buffer<<8|255&n,_buflen+=8,_length+=1;_buflen>=6;)writeEncoded(_buffer>>>_buflen-6),_buflen-=6},_this.flush=function(){if(_buflen>0&&(writeEncoded(_buffer<<6-_buflen),_buffer=0,_buflen=0),_length%3!=0)for(var padlen=3-_length%3,i=0;padlen>i;i+=1)_base64+="="},_this.toString=function(){return _base64},_this},base64DecodeInputStream=function(str){var _str=str,_pos=0,_buffer=0,_buflen=0,_this={};_this.read=function(){for(;8>_buflen;){if(_pos>=_str.length){if(0==_buflen)return-1;throw new Error("unexpected end of file./"+_buflen)}var c=_str.charAt(_pos);if(_pos+=1,"="==c)return _buflen=0,-1;c.match(/^\s$/)||(_buffer=_buffer<<6|decode(c.charCodeAt(0)),_buflen+=6)}var n=_buffer>>>_buflen-8&255;return _buflen-=8,n};var decode=function(c){if(c>=65&&90>=c)return c-65;if(c>=97&&122>=c)return c-97+26;if(c>=48&&57>=c)return c-48+52;if(43==c)return 62;if(47==c)return 63;throw new Error("c:"+c)};return _this},gifImage=function(width,height){var _width=width,_height=height,_data=new Array(width*height),_this={};_this.setPixel=function(x,y,pixel){_data[y*_width+x]=pixel},_this.write=function(out){out.writeString("GIF87a"),out.writeShort(_width),out.writeShort(_height),out.writeByte(128),out.writeByte(0),out.writeByte(0),out.writeByte(0),out.writeByte(0),out.writeByte(0),out.writeByte(255),out.writeByte(255),out.writeByte(255),out.writeString(","),out.writeShort(0),out.writeShort(0),out.writeShort(_width),out.writeShort(_height),out.writeByte(0);var lzwMinCodeSize=2,raster=getLZWRaster(lzwMinCodeSize);out.writeByte(lzwMinCodeSize);for(var offset=0;raster.length-offset>255;)out.writeByte(255),out.writeBytes(raster,offset,255),offset+=255;out.writeByte(raster.length-offset),out.writeBytes(raster,offset,raster.length-offset),out.writeByte(0),out.writeString(";")};var bitOutputStream=function(out){var _out=out,_bitLength=0,_bitBuffer=0,_this={};return _this.write=function(data,length){if(data>>>length!=0)throw new Error("length over");for(;_bitLength+length>=8;)_out.writeByte(255&(data<<_bitLength|_bitBuffer)),length-=8-_bitLength,data>>>=8-_bitLength,_bitBuffer=0,_bitLength=0;_bitBuffer=data<<_bitLength|_bitBuffer,_bitLength+=length},_this.flush=function(){_bitLength>0&&_out.writeByte(_bitBuffer)},_this},getLZWRaster=function(lzwMinCodeSize){for(var clearCode=1<i;i+=1)table.add(String.fromCharCode(i));table.add(String.fromCharCode(clearCode)),table.add(String.fromCharCode(endCode));var byteOut=byteArrayOutputStream(),bitOut=bitOutputStream(byteOut);bitOut.write(clearCode,bitLength);var dataIndex=0,s=String.fromCharCode(_data[dataIndex]);for(dataIndex+=1;dataIndex<_data.length;){var c=String.fromCharCode(_data[dataIndex]);dataIndex+=1,table.contains(s+c)?s+=c:(bitOut.write(table.indexOf(s),bitLength),table.size()<4095&&(table.size()==1<y;y+=1)for(var x=0;width>x;x+=1)gif.setPixel(x,y,getPixel(x,y));var b=byteArrayOutputStream();gif.write(b);for(var base64=base64EncodeOutputStream(),bytes=b.toByteArray(),i=0;ix||x>width||-1>y||y>height)throw"Error.checkAndNudgePoints ";nudged=!1,-1==x?(points[offset]=0,nudged=!0):x==width&&(points[offset]=width-1,nudged=!0),-1==y?(points[offset+1]=0,nudged=!0):y==height&&(points[offset+1]=height-1,nudged=!0)}nudged=!0;for(var offset=points.length-2;offset>=0&&nudged;offset-=2){var x=Math.floor(points[offset]),y=Math.floor(points[offset+1]);if(-1>x||x>width||-1>y||y>height)throw"Error.checkAndNudgePoints ";nudged=!1,-1==x?(points[offset]=0,nudged=!0):x==width&&(points[offset]=width-1,nudged=!0),-1==y?(points[offset+1]=0,nudged=!0):y==height&&(points[offset+1]=height-1,nudged=!0)}},GridSampler.sampleGrid3=function(image,dimension,transform){for(var bits=new BitMatrix(dimension),points=new Array(dimension<<1),y=0;dimension>y;y++){for(var max=points.length,iValue=y+.5,x=0;max>x;x+=2)points[x]=(x>>1)+.5,points[x+1]=iValue;transform.transformPoints1(points),GridSampler.checkAndNudgePoints(image,points);try{for(var x=0;max>x;x+=2){var xpoint=4*Math.floor(points[x])+Math.floor(points[x+1])*qrcode.width*4,bit=image[Math.floor(points[x])+qrcode.width*Math.floor(points[x+1])];qrcode.imagedata.data[xpoint]=bit?255:0,qrcode.imagedata.data[xpoint+1]=bit?255:0,qrcode.imagedata.data[xpoint+2]=0,qrcode.imagedata.data[xpoint+3]=255,bit&&bits.set_Renamed(x>>1,y)}}catch(aioobe){throw"Error.checkAndNudgePoints"}}return bits},GridSampler.sampleGridx=function(image,dimension,p1ToX,p1ToY,p2ToX,p2ToY,p3ToX,p3ToY,p4ToX,p4ToY,p1FromX,p1FromY,p2FromX,p2FromY,p3FromX,p3FromY,p4FromX,p4FromY){var transform=PerspectiveTransform.quadrilateralToQuadrilateral(p1ToX,p1ToY,p2ToX,p2ToY,p3ToX,p3ToY,p4ToX,p4ToY,p1FromX,p1FromY,p2FromX,p2FromY,p3FromX,p3FromY,p4FromX,p4FromY);return GridSampler.sampleGrid3(image,dimension,transform)},Version.VERSION_DECODE_INFO=new Array(31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017),Version.VERSIONS=buildVersions(),Version.getVersionForNumber=function(versionNumber){if(1>versionNumber||versionNumber>40)throw"ArgumentException";return Version.VERSIONS[versionNumber-1]},Version.getProvisionalVersionForDimension=function(dimension){if(dimension%4!=1)throw"Error getProvisionalVersionForDimension";try{return Version.getVersionForNumber(dimension-17>>2)}catch(iae){throw"Error getVersionForNumber"}},Version.decodeVersionInformation=function(versionBits){for(var bestDifference=4294967295,bestVersion=0,i=0;ibitsDifference&&(bestVersion=i+7,bestDifference=bitsDifference)}return 3>=bestDifference?this.getVersionForNumber(bestVersion):null},PerspectiveTransform.quadrilateralToQuadrilateral=function(x0,y0,x1,y1,x2,y2,x3,y3,x0p,y0p,x1p,y1p,x2p,y2p,x3p,y3p){var qToS=this.quadrilateralToSquare(x0,y0,x1,y1,x2,y2,x3,y3),sToQ=this.squareToQuadrilateral(x0p,y0p,x1p,y1p,x2p,y2p,x3p,y3p);return sToQ.times(qToS)},PerspectiveTransform.squareToQuadrilateral=function(x0,y0,x1,y1,x2,y2,x3,y3){return dy2=y3-y2,dy3=y0-y1+y2-y3,0==dy2&&0==dy3?new PerspectiveTransform(x1-x0,x2-x1,x0,y1-y0,y2-y1,y0,0,0,1):(dx1=x1-x2,dx2=x3-x2,dx3=x0-x1+x2-x3,dy1=y1-y2,denominator=dx1*dy2-dx2*dy1,a13=(dx3*dy2-dx2*dy3)/denominator,a23=(dx1*dy3-dx3*dy1)/denominator,new PerspectiveTransform(x1-x0+a13*x1,x3-x0+a23*x3,x0,y1-y0+a13*y1,y3-y0+a23*y3,y0,a13,a23,1))},PerspectiveTransform.quadrilateralToSquare=function(x0,y0,x1,y1,x2,y2,x3,y3){return this.squareToQuadrilateral(x0,y0,x1,y1,x2,y2,x3,y3).buildAdjoint()};var FORMAT_INFO_MASK_QR=21522,FORMAT_INFO_DECODE_LOOKUP=new Array(new Array(21522,0),new Array(20773,1),new Array(24188,2),new Array(23371,3),new Array(17913,4),new Array(16590,5),new Array(20375,6),new Array(19104,7),new Array(30660,8),new Array(29427,9),new Array(32170,10),new Array(30877,11),new Array(26159,12),new Array(25368,13),new Array(27713,14),new Array(26998,15),new Array(5769,16),new Array(5054,17),new Array(7399,18),new Array(6608,19),new Array(1890,20),new Array(597,21),new Array(3340,22),new Array(2107,23),new Array(13663,24),new Array(12392,25),new Array(16177,26),new Array(14854,27),new Array(9396,28),new Array(8579,29),new Array(11994,30),new Array(11245,31)),BITS_SET_IN_HALF_BYTE=new Array(0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4);FormatInformation.numBitsDiffering=function(a,b){return a^=b,BITS_SET_IN_HALF_BYTE[15&a]+BITS_SET_IN_HALF_BYTE[15&URShift(a,4)]+BITS_SET_IN_HALF_BYTE[15&URShift(a,8)]+BITS_SET_IN_HALF_BYTE[15&URShift(a,12)]+BITS_SET_IN_HALF_BYTE[15&URShift(a,16)]+BITS_SET_IN_HALF_BYTE[15&URShift(a,20)]+BITS_SET_IN_HALF_BYTE[15&URShift(a,24)]+BITS_SET_IN_HALF_BYTE[15&URShift(a,28)]},FormatInformation.decodeFormatInformation=function(maskedFormatInfo){var formatInfo=FormatInformation.doDecodeFormatInformation(maskedFormatInfo);return null!=formatInfo?formatInfo:FormatInformation.doDecodeFormatInformation(maskedFormatInfo^FORMAT_INFO_MASK_QR)},FormatInformation.doDecodeFormatInformation=function(maskedFormatInfo){for(var bestDifference=4294967295,bestFormatInfo=0,i=0;ibitsDifference&&(bestFormatInfo=decodeInfo[1],bestDifference=bitsDifference)}return 3>=bestDifference?new FormatInformation(bestFormatInfo):null},ErrorCorrectionLevel.forBits=function(bits){if(0>bits||bits>=FOR_BITS.length)throw"ArgumentException";return FOR_BITS[bits]};var L=new ErrorCorrectionLevel(0,1,"L"),M=new ErrorCorrectionLevel(1,0,"M"),Q=new ErrorCorrectionLevel(2,3,"Q"),H=new ErrorCorrectionLevel(3,2,"H"),FOR_BITS=new Array(M,L,H,Q);DataBlock.getDataBlocks=function(rawCodewords,version,ecLevel){if(rawCodewords.length!=version.TotalCodewords)throw"ArgumentException";for(var ecBlocks=version.getECBlocksForLevel(ecLevel),totalBlocks=0,ecBlockArray=ecBlocks.getECBlocks(),i=0;i=0;){var numCodewords=result[longerBlocksStartAt].codewords.length;if(numCodewords==shorterBlocksTotalCodewords)break;longerBlocksStartAt--}longerBlocksStartAt++;for(var shorterBlocksNumDataCodewords=shorterBlocksTotalCodewords-ecBlocks.ECCodewordsPerBlock,rawCodewordsOffset=0,i=0;shorterBlocksNumDataCodewords>i;i++)for(var j=0;numResultBlocks>j;j++)result[j].codewords[i]=rawCodewords[rawCodewordsOffset++];for(var j=longerBlocksStartAt;numResultBlocks>j;j++)result[j].codewords[shorterBlocksNumDataCodewords]=rawCodewords[rawCodewordsOffset++];for(var max=result[0].codewords.length,i=shorterBlocksNumDataCodewords;max>i;i++)for(var j=0;numResultBlocks>j;j++){var iOffset=longerBlocksStartAt>j?i:i+1;result[j].codewords[iOffset]=rawCodewords[rawCodewordsOffset++]}return result},DataMask={},DataMask.forReference=function(reference){if(0>reference||reference>7)throw"System.ArgumentException";return DataMask.DATA_MASKS[reference]},DataMask.DATA_MASKS=new Array(new DataMask000,new DataMask001,new DataMask010,new DataMask011,new DataMask100,new DataMask101,new DataMask110,new DataMask111),GF256.QR_CODE_FIELD=new GF256(285),GF256.DATA_MATRIX_FIELD=new GF256(301),GF256.addOrSubtract=function(a,b){return a^b},Decoder={},Decoder.rsDecoder=new ReedSolomonDecoder(GF256.QR_CODE_FIELD),Decoder.correctErrors=function(codewordBytes,numDataCodewords){for(var numCodewords=codewordBytes.length,codewordsInts=new Array(numCodewords),i=0;numCodewords>i;i++)codewordsInts[i]=255&codewordBytes[i];var numECCodewords=codewordBytes.length-numDataCodewords;try{Decoder.rsDecoder.decode(codewordsInts,numECCodewords)}catch(rse){throw rse}for(var i=0;numDataCodewords>i;i++)codewordBytes[i]=codewordsInts[i]},Decoder.decode=function(bits){for(var parser=new BitMatrixParser(bits),version=parser.readVersion(),ecLevel=parser.readFormatInformation().ErrorCorrectionLevel,codewords=parser.readCodewords(),dataBlocks=DataBlock.getDataBlocks(codewords,version,ecLevel),totalBytes=0,i=0;ii;i++)resultBytes[resultOffset++]=codewordBytes[i]}var reader=new QRCodeDataBlockReader(resultBytes,version.VersionNumber,ecLevel.Bits);return reader},qrcode=window.qrcode||{},qrcode.imagedata=null,qrcode.width=0,qrcode.height=0,qrcode.qrCodeSymbol=null,qrcode.debug=!1,qrcode.maxImgSize=1048576,qrcode.sizeOfDataLengthInfo=[[10,9,8,8],[12,11,16,10],[14,13,16,12]],qrcode.callback=null,qrcode.decode=function(src){if(0==arguments.length){var canvas_qr=document.getElementById("qr-canvas"),context=canvas_qr.getContext("2d");return qrcode.width=canvas_qr.width,qrcode.height=canvas_qr.height,qrcode.imagedata=context.getImageData(0,0,qrcode.width,qrcode.height),qrcode.result=qrcode.process(context),null!=qrcode.callback&&qrcode.callback(qrcode.result),qrcode.result}var image=new Image;image.onload=function(){var canvas_qr=document.createElement("canvas"),context=canvas_qr.getContext("2d"),nheight=image.height,nwidth=image.width;if(image.width*image.height>qrcode.maxImgSize){var ir=image.width/image.height;nheight=Math.sqrt(qrcode.maxImgSize/ir),nwidth=ir*nheight}canvas_qr.width=nwidth,canvas_qr.height=nheight,context.drawImage(image,0,0,canvas_qr.width,canvas_qr.height),qrcode.width=canvas_qr.width,qrcode.height=canvas_qr.height;try{qrcode.imagedata=context.getImageData(0,0,canvas_qr.width,canvas_qr.height)}catch(e){return qrcode.result="Cross domain image reading not supported in your browser! Save it to your computer then drag and drop the file!",void(null!=qrcode.callback&&qrcode.callback(qrcode.result))}try{qrcode.result=qrcode.process(context)}catch(e){console.log(e),qrcode.result="error decoding QR Code"}null!=qrcode.callback&&qrcode.callback(qrcode.result)},image.src=src},qrcode.isUrl=function(s){var regexp=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return regexp.test(s)},qrcode.decode_url=function(s){var escaped="";try{escaped=escape(s)}catch(e){console.log(e),escaped=s}var ret="";try{ret=decodeURIComponent(escaped)}catch(e){console.log(e),ret=escaped}return ret},qrcode.decode_utf8=function(s){return qrcode.isUrl(s)?qrcode.decode_url(s):s},qrcode.process=function(ctx){var start=(new Date).getTime(),image=qrcode.grayScaleToBitmap(qrcode.grayscale());if(qrcode.debug){for(var y=0;y=gray?!0:!1}return ret},qrcode.getMiddleBrightnessPerArea=function(image){for(var numSqrtArea=4,areaWidth=Math.floor(qrcode.width/numSqrtArea),areaHeight=Math.floor(qrcode.height/numSqrtArea),minmax=new Array(numSqrtArea),i=0;numSqrtArea>i;i++){minmax[i]=new Array(numSqrtArea);for(var i2=0;numSqrtArea>i2;i2++)minmax[i][i2]=new Array(0,0)}for(var ay=0;numSqrtArea>ay;ay++)for(var ax=0;numSqrtArea>ax;ax++){minmax[ax][ay][0]=255;for(var dy=0;areaHeight>dy;dy++)for(var dx=0;areaWidth>dx;dx++){var target=image[areaWidth*ax+dx+(areaHeight*ay+dy)*qrcode.width];targetminmax[ax][ay][1]&&(minmax[ax][ay][1]=target)}}for(var middle=new Array(numSqrtArea),i3=0;numSqrtArea>i3;i3++)middle[i3]=new Array(numSqrtArea);for(var ay=0;numSqrtArea>ay;ay++)for(var ax=0;numSqrtArea>ax;ax++)middle[ax][ay]=Math.floor((minmax[ax][ay][0]+minmax[ax][ay][1])/2);return middle},qrcode.grayScaleToBitmap=function(grayScale){for(var middle=qrcode.getMiddleBrightnessPerArea(grayScale),sqrtNumArea=middle.length,areaWidth=Math.floor(qrcode.width/sqrtNumArea),areaHeight=Math.floor(qrcode.height/sqrtNumArea),bitmap=new Array(qrcode.height*qrcode.width),ay=0;sqrtNumArea>ay;ay++)for(var ax=0;sqrtNumArea>ax;ax++)for(var dy=0;areaHeight>dy;dy++)for(var dx=0;areaWidth>dx;dx++)bitmap[areaWidth*ax+dx+(areaHeight*ay+dy)*qrcode.width]=grayScale[areaWidth*ax+dx+(areaHeight*ay+dy)*qrcode.width]from?this.length+from:from,this.push.apply(this,rest)};var MIN_SKIP=3,MAX_MODULES=57,INTEGER_MATH_SHIFT=8,CENTER_QUORUM=2;qrcode.orderBestPatterns=function(patterns){function distance(pattern1,pattern2){return xDiff=pattern1.X-pattern2.X,yDiff=pattern1.Y-pattern2.Y,Math.sqrt(xDiff*xDiff+yDiff*yDiff)}function crossProductZ(pointA,pointB,pointC){var bX=pointB.x,bY=pointB.y;return(pointC.x-bX)*(pointA.y-bY)-(pointC.y-bY)*(pointA.x-bX)}var pointA,pointB,pointC,zeroOneDistance=distance(patterns[0],patterns[1]),oneTwoDistance=distance(patterns[1],patterns[2]),zeroTwoDistance=distance(patterns[0],patterns[2]);if(oneTwoDistance>=zeroOneDistance&&oneTwoDistance>=zeroTwoDistance?(pointB=patterns[0],pointA=patterns[1],pointC=patterns[2]):zeroTwoDistance>=oneTwoDistance&&zeroTwoDistance>=zeroOneDistance?(pointB=patterns[1],pointA=patterns[0],pointC=patterns[2]):(pointB=patterns[2],pointA=patterns[0],pointC=patterns[1]),crossProductZ(pointA,pointB,pointC)<0){var temp=pointA;pointA=pointC,pointC=temp}patterns[0]=pointA,patterns[1]=pointB,patterns[2]=pointC},function(a){function b(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function c(a,b){return function(c){return k(a.call(this,c),b)}}function d(a,b){return function(c){return this.lang().ordinal(a.call(this,c),b)}}function e(){}function f(a){w(a),h(this,a)}function g(a){var b=q(a),c=b.year||0,d=b.month||0,e=b.week||0,f=b.day||0,g=b.hour||0,h=b.minute||0,i=b.second||0,j=b.millisecond||0;this._milliseconds=+j+1e3*i+6e4*h+36e5*g,this._days=+f+7*e,this._months=+d+12*c,this._data={},this._bubble()}function h(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return b.hasOwnProperty("toString")&&(a.toString=b.toString),b.hasOwnProperty("valueOf")&&(a.valueOf=b.valueOf),a}function i(a){var b,c={};for(b in a)a.hasOwnProperty(b)&&qb.hasOwnProperty(b)&&(c[b]=a[b]);return c}function j(a){return 0>a?Math.ceil(a):Math.floor(a)}function k(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.lengthd;d++)(c&&a[d]!==b[d]||!c&&s(a[d])!==s(b[d]))&&g++;return g+f}function p(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=Tb[a]||Ub[b]||b}return a}function q(a){var b,c,d={};for(c in a)a.hasOwnProperty(c)&&(b=p(c),b&&(d[b]=a[c]));return d}function r(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}db[b]=function(e,f){var g,h,i=db.fn._lang[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){var b=db().utc().set(d,a);return i.call(db.fn._lang,b,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function s(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function t(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function u(a){return v(a)?366:365}function v(a){return a%4===0&&a%100!==0||a%400===0}function w(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[jb]<0||a._a[jb]>11?jb:a._a[kb]<1||a._a[kb]>t(a._a[ib],a._a[jb])?kb:a._a[lb]<0||a._a[lb]>23?lb:a._a[mb]<0||a._a[mb]>59?mb:a._a[nb]<0||a._a[nb]>59?nb:a._a[ob]<0||a._a[ob]>999?ob:-1,a._pf._overflowDayOfYear&&(ib>b||b>kb)&&(b=kb),a._pf.overflow=b)}function x(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&a._pf.overflow<0&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function y(a){return a?a.toLowerCase().replace("_","-"):a}function z(a,b){return b._isUTC?db(a).zone(b._offset||0):db(a).local()}function A(a,b){return b.abbr=a,pb[a]||(pb[a]=new e),pb[a].set(b),pb[a]}function B(a){delete pb[a]}function C(a){var b,c,d,e,f=0,g=function(a){if(!pb[a]&&rb)try{require("./lang/"+a)}catch(b){}return pb[a]};if(!a)return db.fn._lang;if(!m(a)){if(c=g(a))return c;a=[a]}for(;f0;){if(c=g(e.slice(0,b).join("-")))return c;if(d&&d.length>=b&&o(e,d,!0)>=b-1)break;b--}f++}return db.fn._lang}function D(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function E(a){var b,c,d=a.match(vb);for(b=0,c=d.length;c>b;b++)d[b]=Yb[d[b]]?Yb[d[b]]:D(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function F(a,b){return a.isValid()?(b=G(b,a.lang()),Vb[b]||(Vb[b]=E(b)),Vb[b](a)):a.lang().invalidDate()}function G(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(wb.lastIndex=0;d>=0&&wb.test(a);)a=a.replace(wb,c),wb.lastIndex=0,d-=1;return a}function H(a,b){var c,d=b._strict;switch(a){case"DDDD":return Ib;case"YYYY":case"GGGG":case"gggg":return d?Jb:zb;case"Y":case"G":case"g":return Lb;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?Kb:Ab;case"S":if(d)return Gb;case"SS":if(d)return Hb;case"SSS":if(d)return Ib;case"DDD":return yb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Cb;case"a":case"A":return C(b._l)._meridiemParse;case"X":return Fb;case"Z":case"ZZ":return Db;case"T":return Eb;case"SSSS":return Bb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?Hb:xb;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return xb;default:return c=new RegExp(P(O(a.replace("\\","")),"i"))}}function I(a){a=a||"";var b=a.match(Db)||[],c=b[b.length-1]||[],d=(c+"").match(Qb)||["-",0,0],e=+(60*d[1])+s(d[2]);return"+"===d[0]?-e:e}function J(a,b,c){var d,e=c._a;switch(a){case"M":case"MM":null!=b&&(e[jb]=s(b)-1);break;case"MMM":case"MMMM":d=C(c._l).monthsParse(b),null!=d?e[jb]=d:c._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(e[kb]=s(b));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=s(b));break;case"YY":e[ib]=s(b)+(s(b)>68?1900:2e3);break;case"YYYY":case"YYYYY":case"YYYYYY":e[ib]=s(b); -break;case"a":case"A":c._isPm=C(c._l).isPM(b);break;case"H":case"HH":case"h":case"hh":e[lb]=s(b);break;case"m":case"mm":e[mb]=s(b);break;case"s":case"ss":e[nb]=s(b);break;case"S":case"SS":case"SSS":case"SSSS":e[ob]=s(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=I(b);break;case"w":case"ww":case"W":case"WW":case"d":case"dd":case"ddd":case"dddd":case"e":case"E":a=a.substr(0,1);case"gg":case"gggg":case"GG":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=b)}}function K(a){var b,c,d,e,f,g,h,i,j,k,l=[];if(!a._d){for(d=M(a),a._w&&null==a._a[kb]&&null==a._a[jb]&&(f=function(b){var c=parseInt(b,10);return b?b.length<3?c>68?1900+c:2e3+c:c:null==a._a[ib]?db().weekYear():a._a[ib]},g=a._w,null!=g.GG||null!=g.W||null!=g.E?h=Z(f(g.GG),g.W||1,g.E,4,1):(i=C(a._l),j=null!=g.d?V(g.d,i):null!=g.e?parseInt(g.e,10)+i._week.dow:0,k=parseInt(g.w,10)||1,null!=g.d&&ju(e)&&(a._pf._overflowDayOfYear=!0),c=U(e,0,a._dayOfYear),a._a[jb]=c.getUTCMonth(),a._a[kb]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=l[b]=d[b];for(;7>b;b++)a._a[b]=l[b]=null==a._a[b]?2===b?1:0:a._a[b];l[lb]+=s((a._tzm||0)/60),l[mb]+=s((a._tzm||0)%60),a._d=(a._useUTC?U:T).apply(null,l)}}function L(a){var b;a._d||(b=q(a._i),a._a=[b.year,b.month,b.day,b.hour,b.minute,b.second,b.millisecond],K(a))}function M(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function N(a){a._a=[],a._pf.empty=!0;var b,c,d,e,f,g=C(a._l),h=""+a._i,i=h.length,j=0;for(d=G(a._f,g).match(vb)||[],b=0;b0&&a._pf.unusedInput.push(f),h=h.slice(h.indexOf(c)+c.length),j+=c.length),Yb[e]?(c?a._pf.empty=!1:a._pf.unusedTokens.push(e),J(e,c,a)):a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=i-j,h.length>0&&a._pf.unusedInput.push(h),a._isPm&&a._a[lb]<12&&(a._a[lb]+=12),a._isPm===!1&&12===a._a[lb]&&(a._a[lb]=0),K(a),w(a)}function O(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function P(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(a){var c,d,e,f,g;if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(f=0;fg)&&(e=g,d=c));h(a,d||c)}function R(a){var b,c,d=a._i,e=Mb.exec(d);if(e){for(a._pf.iso=!0,b=0,c=Ob.length;c>b;b++)if(Ob[b][1].exec(d)){a._f=Ob[b][0]+(e[6]||" ");break}for(b=0,c=Pb.length;c>b;b++)if(Pb[b][1].exec(d)){a._f+=Pb[b][0];break}d.match(Db)&&(a._f+="Z"),N(a)}else a._d=new Date(d)}function S(b){var c=b._i,d=sb.exec(c);c===a?b._d=new Date:d?b._d=new Date(+d[1]):"string"==typeof c?R(b):m(c)?(b._a=c.slice(0),K(b)):n(c)?b._d=new Date(+c):"object"==typeof c?L(b):b._d=new Date(c)}function T(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function U(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function V(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function W(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function X(a,b,c){var d=hb(Math.abs(a)/1e3),e=hb(d/60),f=hb(e/60),g=hb(f/24),h=hb(g/365),i=45>d&&["s",d]||1===e&&["m"]||45>e&&["mm",e]||1===f&&["h"]||22>f&&["hh",f]||1===g&&["d"]||25>=g&&["dd",g]||45>=g&&["M"]||345>g&&["MM",hb(g/30)]||1===h&&["y"]||["yy",h];return i[2]=b,i[3]=a>0,i[4]=c,W.apply({},i)}function Y(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=db(a).add("d",f),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function Z(a,b,c,d,e){var f,g,h=U(a,0,1).getUTCDay();return c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:u(a-1)+g}}function $(a){var b=a._i,c=a._f;return null===b?db.invalid({nullInput:!0}):("string"==typeof b&&(a._i=b=C().preparse(b)),db.isMoment(b)?(a=i(b),a._d=new Date(+b._d)):c?m(c)?Q(a):N(a):S(a),new f(a))}function _(a,b){db.fn[a]=db.fn[a+"s"]=function(a){var c=this._isUTC?"UTC":"";return null!=a?(this._d["set"+c+b](a),db.updateOffset(this),this):this._d["get"+c+b]()}}function ab(a){db.duration.fn[a]=function(){return this._data[a]}}function bb(a,b){db.duration.fn["as"+a]=function(){return+this/b}}function cb(a){var b=!1,c=db;"undefined"==typeof ender&&(a?(gb.moment=function(){return!b&&console&&console.warn&&(b=!0,console.warn("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.")),c.apply(null,arguments)},h(gb.moment,c)):gb.moment=db)}for(var db,eb,fb="2.5.1",gb=this,hb=Math.round,ib=0,jb=1,kb=2,lb=3,mb=4,nb=5,ob=6,pb={},qb={_isAMomentObject:null,_i:null,_f:null,_l:null,_strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},rb="undefined"!=typeof module&&module.exports&&"undefined"!=typeof require,sb=/^\/?Date\((\-?\d+)/i,tb=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,ub=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,vb=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,wb=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,xb=/\d\d?/,yb=/\d{1,3}/,zb=/\d{1,4}/,Ab=/[+\-]?\d{1,6}/,Bb=/\d+/,Cb=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Db=/Z|[\+\-]\d\d:?\d\d/gi,Eb=/T/i,Fb=/[\+\-]?\d+(\.\d{1,3})?/,Gb=/\d/,Hb=/\d\d/,Ib=/\d{3}/,Jb=/\d{4}/,Kb=/[+-]?\d{6}/,Lb=/[+-]?\d+/,Mb=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Nb="YYYY-MM-DDTHH:mm:ssZ",Ob=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Pb=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Qb=/([\+\-]|\d\d)/gi,Rb="Date|Hours|Minutes|Seconds|Milliseconds".split("|"),Sb={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},Tb={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},Ub={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},Vb={},Wb="DDD w W M D d".split(" "),Xb="M D H h m s w W".split(" "),Yb={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return k(this.year()%100,2)},YYYY:function(){return k(this.year(),4)},YYYYY:function(){return k(this.year(),5)},YYYYYY:function(){var a=this.year(),b=a>=0?"+":"-";return b+k(Math.abs(a),6)},gg:function(){return k(this.weekYear()%100,2)},gggg:function(){return k(this.weekYear(),4)},ggggg:function(){return k(this.weekYear(),5)},GG:function(){return k(this.isoWeekYear()%100,2)},GGGG:function(){return k(this.isoWeekYear(),4)},GGGGG:function(){return k(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return s(this.milliseconds()/100)},SS:function(){return k(s(this.milliseconds()/10),2)},SSS:function(){return k(this.milliseconds(),3)},SSSS:function(){return k(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+k(s(a/60),2)+":"+k(s(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+k(s(a/60),2)+k(s(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},Zb=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];Wb.length;)eb=Wb.pop(),Yb[eb+"o"]=d(Yb[eb],eb);for(;Xb.length;)eb=Xb.pop(),Yb[eb+eb]=c(Yb[eb],2);for(Yb.DDDD=c(Yb.DDD,3),h(e.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c,d;for(this._monthsParse||(this._monthsParse=[]),b=0;12>b;b++)if(this._monthsParse[b]||(c=db.utc([2e3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=db([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return Y(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),db=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=c,g._f=d,g._l=e,g._strict=f,g._isUTC=!1,g._pf=b(),$(g)},db.utc=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=c,g._f=d,g._strict=f,g._pf=b(),$(g).utc()},db.unix=function(a){return db(1e3*a)},db.duration=function(a,b){var c,d,e,f=a,h=null;return db.isDuration(a)?f={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(f={},b?f[b]=a:f.milliseconds=a):(h=tb.exec(a))?(c="-"===h[1]?-1:1,f={y:0,d:s(h[kb])*c,h:s(h[lb])*c,m:s(h[mb])*c,s:s(h[nb])*c,ms:s(h[ob])*c}):(h=ub.exec(a))&&(c="-"===h[1]?-1:1,e=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*c},f={y:e(h[2]),M:e(h[3]),d:e(h[4]),h:e(h[5]),m:e(h[6]),s:e(h[7]),w:e(h[8])}),d=new g(f),db.isDuration(a)&&a.hasOwnProperty("_lang")&&(d._lang=a._lang),d},db.version=fb,db.defaultFormat=Nb,db.updateOffset=function(){},db.lang=function(a,b){var c;return a?(b?A(y(a),b):null===b?(B(a),a="en"):pb[a]||C(a),c=db.duration.fn._lang=db.fn._lang=C(a),c._abbr):db.fn._lang._abbr},db.langData=function(a){return a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr),C(a)},db.isMoment=function(a){return a instanceof f||null!=a&&a.hasOwnProperty("_isAMomentObject")},db.isDuration=function(a){return a instanceof g},eb=Zb.length-1;eb>=0;--eb)r(Zb[eb]);for(db.normalizeUnits=function(a){return p(a)},db.invalid=function(a){var b=db.utc(0/0);return null!=a?h(b._pf,a):b._pf.userInvalidated=!0,b},db.parseZone=function(a){return db(a).parseZone()},h(db.fn=f.prototype,{clone:function(){return db(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=db(this).utc();return 00:!1},parsingFlags:function(){return h({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(a){var b=F(this,a||db.defaultFormat);return this.lang().postformat(b)},add:function(a,b){var c;return c="string"==typeof a?db.duration(+b,a):db.duration(a,b),l(this,c,1),this},subtract:function(a,b){var c;return c="string"==typeof a?db.duration(+b,a):db.duration(a,b),l(this,c,-1),this},diff:function(a,b,c){var d,e,f=z(a,this),g=6e4*(this.zone()-f.zone());return b=p(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+f.daysInMonth()),e=12*(this.year()-f.year())+(this.month()-f.month()),e+=(this-db(this).startOf("month")-(f-db(f).startOf("month")))/d,e-=6e4*(this.zone()-db(this).startOf("month").zone()-(f.zone()-db(f).startOf("month").zone()))/d,"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:j(e)},from:function(a,b){return db.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(db(),a)},calendar:function(){var a=z(db(),this).startOf("day"),b=this.diff(a,"days",!0),c=-6>b?"sameElse":-1>b?"lastWeek":0>b?"lastDay":1>b?"sameDay":2>b?"nextDay":7>b?"nextWeek":"sameElse";return this.format(this.lang().calendar(c,this))},isLeapYear:function(){return v(this.year())},isDST:function(){return this.zone()+db(a).startOf(b)},isBefore:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+db(a).startOf(b)},isSame:function(a,b){return b=b||"ms",+this.clone().startOf(b)===+z(a,this).startOf(b)},min:function(a){return a=db.apply(null,arguments),this>a?this:a},max:function(a){return a=db.apply(null,arguments),a>this?this:a},zone:function(a){var b=this._offset||0;return null==a?this._isUTC?b:this._d.getTimezoneOffset():("string"==typeof a&&(a=I(a)),Math.abs(a)<16&&(a=60*a),this._offset=a,this._isUTC=!0,b!==a&&l(this,db.duration(b-a,"m"),1,!0),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?db(a).zone():0,(this.zone()-a)%60===0},daysInMonth:function(){return t(this.year(),this.month())},dayOfYear:function(a){var b=hb((db(this).startOf("day")-db(this).startOf("year"))/864e5)+1;return null==a?b:this.add("d",a-b)},quarter:function(){return Math.ceil((this.month()+1)/3)},weekYear:function(a){var b=Y(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=Y(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=Y(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this.day()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},get:function(a){return a=p(a),this[a]()},set:function(a,b){return a=p(a),"function"==typeof this[a]&&this[a](b),this},lang:function(b){return b===a?this._lang:(this._lang=C(b),this)}}),eb=0;eb=10}var d,e={bridge:null,version:"0.0.0",disabled:null,outdated:null,ready:null},f={},g=0,h={},i=0,j={},k=null,l=null,m=function(){var a,b,c,d,e="ZeroClipboard.swf";if(document.currentScript&&(d=document.currentScript.src));else{var f=document.getElementsByTagName("script");if("readyState"in f[0])for(a=f.length;a--&&("interactive"!==f[a].readyState||!(d=f[a].src)););else if("loading"===document.readyState)d=f[f.length-1].src;else{for(a=f.length;a--;){if(c=f[a].src,!c){b=null;break}if(c=c.split("#")[0].split("?")[0],c=c.slice(0,c.lastIndexOf("/")+1),null==b)b=c;else if(b!==c){b=null;break}}null!==b&&(d=b)}}return d&&(d=d.split("#")[0].split("?")[0],e=d.slice(0,d.lastIndexOf("/")+1)+e),e}(),n=function(){var a=/\-([a-z])/g,b=function(a,b){return b.toUpperCase()};return function(c){return c.replace(a,b)}}(),o=function(b,c){var d,e,f;return a.getComputedStyle?d=a.getComputedStyle(b,null).getPropertyValue(c):(e=n(c),d=b.currentStyle?b.currentStyle[e]:b.style[e]),"cursor"!==c||d&&"auto"!==d||(f=b.tagName.toLowerCase(),"a"!==f)?d:"pointer"},p=function(b){b||(b=a.event);var c;this!==a?c=this:b.target?c=b.target:b.srcElement&&(c=b.srcElement),K.activate(c)},q=function(a,b,c){a&&1===a.nodeType&&(a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c))},r=function(a,b,c){a&&1===a.nodeType&&(a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&a.detachEvent("on"+b,c))},s=function(a,b){if(!a||1!==a.nodeType)return a;if(a.classList)return a.classList.contains(b)||a.classList.add(b),a;if(b&&"string"==typeof b){var c=(b||"").split(/\s+/);if(1===a.nodeType)if(a.className){for(var d=" "+a.className+" ",e=a.className,f=0,g=c.length;g>f;f++)d.indexOf(" "+c[f]+" ")<0&&(e+=" "+c[f]);a.className=e.replace(/^\s+|\s+$/g,"")}else a.className=b}return a},t=function(a,b){if(!a||1!==a.nodeType)return a;if(a.classList)return a.classList.contains(b)&&a.classList.remove(b),a;if(b&&"string"==typeof b||void 0===b){var c=(b||"").split(/\s+/);if(1===a.nodeType&&a.className)if(b){for(var d=(" "+a.className+" ").replace(/[\n\t]/g," "),e=0,f=c.length;f>e;e++)d=d.replace(" "+c[e]+" "," ");a.className=d.replace(/^\s+|\s+$/g,"")}else a.className=""}return a},u=function(){var a,b,c,d=1;return"function"==typeof document.body.getBoundingClientRect&&(a=document.body.getBoundingClientRect(),b=a.right-a.left,c=document.body.offsetWidth,d=Math.round(b/c*100)/100),d},v=function(b,c){var d={left:0,top:0,width:0,height:0,zIndex:B(c)-1};if(b.getBoundingClientRect){var e,f,g,h=b.getBoundingClientRect();"pageXOffset"in a&&"pageYOffset"in a?(e=a.pageXOffset,f=a.pageYOffset):(g=u(),e=Math.round(document.documentElement.scrollLeft/g),f=Math.round(document.documentElement.scrollTop/g));var i=document.documentElement.clientLeft||0,j=document.documentElement.clientTop||0;d.left=h.left+e-i,d.top=h.top+f-j,d.width="width"in h?h.width:h.right-h.left,d.height="height"in h?h.height:h.bottom-h.top}return d},w=function(a,b){var c=null==b||b&&b.cacheBust===!0&&b.useNoCache===!0;return c?(-1===a.indexOf("?")?"?":"&")+"noCache="+(new Date).getTime():""},x=function(b){var c,d,e,f=[],g=[],h=[];if(b.trustedOrigins&&("string"==typeof b.trustedOrigins?g.push(b.trustedOrigins):"object"==typeof b.trustedOrigins&&"length"in b.trustedOrigins&&(g=g.concat(b.trustedOrigins))),b.trustedDomains&&("string"==typeof b.trustedDomains?g.push(b.trustedDomains):"object"==typeof b.trustedDomains&&"length"in b.trustedDomains&&(g=g.concat(b.trustedDomains))),g.length)for(c=0,d=g.length;d>c;c++)if(g.hasOwnProperty(c)&&g[c]&&"string"==typeof g[c]){if(e=E(g[c]),!e)continue;if("*"===e){h=[e];break}h.push.apply(h,[e,"//"+e,a.location.protocol+"//"+e])}return h.length&&f.push("trustedOrigins="+encodeURIComponent(h.join(","))),"string"==typeof b.jsModuleId&&b.jsModuleId&&f.push("jsModuleId="+encodeURIComponent(b.jsModuleId)),f.join("&")},y=function(a,b,c){if("function"==typeof b.indexOf)return b.indexOf(a,c);var d,e=b.length;for("undefined"==typeof c?c=0:0>c&&(c=e+c),d=c;e>d;d++)if(b.hasOwnProperty(d)&&b[d]===a)return d;return-1},z=function(a){if("string"==typeof a)throw new TypeError("ZeroClipboard doesn't accept query strings.");return a.length?a:[a]},A=function(b,c,d,e){e?a.setTimeout(function(){b.apply(c,d)},0):b.apply(c,d)},B=function(a){var b,c;return a&&("number"==typeof a&&a>0?b=a:"string"==typeof a&&(c=parseInt(a,10))&&!isNaN(c)&&c>0&&(b=c)),b||("number"==typeof N.zIndex&&N.zIndex>0?b=N.zIndex:"string"==typeof N.zIndex&&(c=parseInt(N.zIndex,10))&&!isNaN(c)&&c>0&&(b=c)),b||0},C=function(a,b){if(a&&b!==!1&&"undefined"!=typeof console&&console&&(console.warn||console.log)){var c="`"+a+"` is deprecated. See docs for more info:\n https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/instructions.md#deprecations";console.warn?console.warn(c):console.log(c)}},D=function(){var a,b,c,d,e,f,g=arguments[0]||{};for(a=1,b=arguments.length;b>a;a++)if(null!=(c=arguments[a]))for(d in c)if(c.hasOwnProperty(d)){if(e=g[d],f=c[d],g===f)continue;void 0!==f&&(g[d]=f)}return g},E=function(a){if(null==a||""===a)return null;if(a=a.replace(/^\s+|\s+$/g,""),""===a)return null;var b=a.indexOf("//");a=-1===b?a:a.slice(b+2);var c=a.indexOf("/");return a=-1===c?a:-1===b||0===c?null:a.slice(0,c),a&&".swf"===a.slice(-4).toLowerCase()?null:a||null},F=function(){var a=function(a,b){var c,d,e;if(null!=a&&"*"!==b[0]&&("string"==typeof a&&(a=[a]),"object"==typeof a&&"length"in a))for(c=0,d=a.length;d>c;c++)if(a.hasOwnProperty(c)&&(e=E(a[c]))){if("*"===e){b.length=0,b.push("*");break}-1===y(e,b)&&b.push(e)}},b={always:"always",samedomain:"sameDomain",never:"never"};return function(c,d){var e,f=d.allowScriptAccess;if("string"==typeof f&&(e=f.toLowerCase())&&/^always|samedomain|never$/.test(e))return b[e];var g=E(d.moviePath);null===g&&(g=c);var h=[];a(d.trustedOrigins,h),a(d.trustedDomains,h);var i=h.length;if(i>0){if(1===i&&"*"===h[0])return"always";if(-1!==y(c,h))return 1===i&&c===g?"sameDomain":"always"}return"never"}}(),G=function(a){if(null==a)return[];if(Object.keys)return Object.keys(a);var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b},H=function(a){if(a)for(var b in a)a.hasOwnProperty(b)&&delete a[b];return a},I=function(){try{return document.activeElement}catch(a){}return null},J=function(){var a=!1;if("boolean"==typeof e.disabled)a=e.disabled===!1;else{if("function"==typeof ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")&&(a=!0)}catch(b){}!a&&navigator.mimeTypes["application/x-shockwave-flash"]&&(a=!0)}return a},K=function(a,b){return this instanceof K?(this.id=""+g++,h[this.id]={instance:this,elements:[],handlers:{}},a&&this.clip(a),"undefined"!=typeof b&&(C("new ZeroClipboard(elements, options)",N.debug),K.config(b)),this.options=K.config(),"boolean"!=typeof e.disabled&&(e.disabled=!J()),void(e.disabled===!1&&e.outdated!==!0&&null===e.bridge&&(e.outdated=!1,e.ready=!1,O()))):new K(a,b)};K.prototype.setText=function(a){return a&&""!==a&&(f["text/plain"]=a,e.ready===!0&&e.bridge&&"function"==typeof e.bridge.setText?e.bridge.setText(a):e.ready=!1),this},K.prototype.setSize=function(a,b){return e.ready===!0&&e.bridge&&"function"==typeof e.bridge.setSize?e.bridge.setSize(a,b):e.ready=!1,this};var L=function(a){e.ready===!0&&e.bridge&&"function"==typeof e.bridge.setHandCursor?e.bridge.setHandCursor(a):e.ready=!1};K.prototype.destroy=function(){this.unclip(),this.off(),delete h[this.id]};var M=function(){var a,b,c,d=[],e=G(h);for(a=0,b=e.length;b>a;a++)c=h[e[a]].instance,c&&c instanceof K&&d.push(c);return d};K.version="1.3.5";var N={swfPath:m,trustedDomains:a.location.host?[a.location.host]:[],cacheBust:!0,forceHandCursor:!1,zIndex:999999999,debug:!0,title:null,autoActivate:!0};K.config=function(a){if("object"==typeof a&&null!==a&&D(N,a),"string"!=typeof a||!a){var b={};for(var c in N)N.hasOwnProperty(c)&&(b[c]="object"==typeof N[c]&&null!==N[c]?"length"in N[c]?N[c].slice(0):D({},N[c]):N[c]);return b}return N.hasOwnProperty(a)?N[a]:void 0},K.destroy=function(){K.deactivate();for(var a in h)if(h.hasOwnProperty(a)&&h[a]){var b=h[a].instance;b&&"function"==typeof b.destroy&&b.destroy()}var c=P(e.bridge);c&&c.parentNode&&(c.parentNode.removeChild(c),e.ready=null,e.bridge=null)},K.activate=function(a){d&&(t(d,N.hoverClass),t(d,N.activeClass)),d=a,s(a,N.hoverClass),Q();var b=N.title||a.getAttribute("title");if(b){var c=P(e.bridge);c&&c.setAttribute("title",b)}var f=N.forceHandCursor===!0||"pointer"===o(a,"cursor");L(f)},K.deactivate=function(){var a=P(e.bridge);a&&(a.style.left="0px",a.style.top="-9999px",a.removeAttribute("title")),d&&(t(d,N.hoverClass),t(d,N.activeClass),d=null)};var O=function(){var b,c,d=document.getElementById("global-zeroclipboard-html-bridge");if(!d){var f=K.config();f.jsModuleId="string"==typeof k&&k||"string"==typeof l&&l||null;var g=F(a.location.host,N),h=x(f),i=N.moviePath+w(N.moviePath,N),j=' ';d=document.createElement("div"),d.id="global-zeroclipboard-html-bridge",d.setAttribute("class","global-zeroclipboard-container"),d.style.position="absolute",d.style.left="0px",d.style.top="-9999px",d.style.width="15px",d.style.height="15px",d.style.zIndex=""+B(N.zIndex),document.body.appendChild(d),d.innerHTML=j}b=document["global-zeroclipboard-flash-bridge"],b&&(c=b.length)&&(b=b[c-1]),e.bridge=b||d.children[0].lastElementChild},P=function(a){for(var b=/^OBJECT|EMBED$/,c=a&&a.parentNode;c&&b.test(c.nodeName)&&c.parentNode;)c=c.parentNode;return c||null},Q=function(){if(d){var a=v(d,N.zIndex),b=P(e.bridge);b&&(b.style.top=a.top+"px",b.style.left=a.left+"px",b.style.width=a.width+"px",b.style.height=a.height+"px",b.style.zIndex=a.zIndex+1),e.ready===!0&&e.bridge&&"function"==typeof e.bridge.setSize?e.bridge.setSize(a.width,a.height):e.ready=!1}return this};K.prototype.on=function(a,b){var c,d,f,g={},i=h[this.id]&&h[this.id].handlers;if("string"==typeof a&&a)f=a.toLowerCase().split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof b)for(c in a)a.hasOwnProperty(c)&&"string"==typeof c&&c&&"function"==typeof a[c]&&this.on(c,a[c]);if(f&&f.length){for(c=0,d=f.length;d>c;c++)a=f[c].replace(/^on/,""),g[a]=!0,i[a]||(i[a]=[]),i[a].push(b);g.noflash&&e.disabled&&T.call(this,"noflash",{}),g.wrongflash&&e.outdated&&T.call(this,"wrongflash",{flashVersion:e.version}),g.load&&e.ready&&T.call(this,"load",{flashVersion:e.version}) -}return this},K.prototype.off=function(a,b){var c,d,e,f,g,i=h[this.id]&&h[this.id].handlers;if(0===arguments.length)f=G(i);else if("string"==typeof a&&a)f=a.split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof b)for(c in a)a.hasOwnProperty(c)&&"string"==typeof c&&c&&"function"==typeof a[c]&&this.off(c,a[c]);if(f&&f.length)for(c=0,d=f.length;d>c;c++)if(a=f[c].toLowerCase().replace(/^on/,""),g=i[a],g&&g.length)if(b)for(e=y(b,g);-1!==e;)g.splice(e,1),e=y(b,g,e);else i[a].length=0;return this},K.prototype.handlers=function(a){var b,c=null,d=h[this.id]&&h[this.id].handlers;if(d){if("string"==typeof a&&a)return d[a]?d[a].slice(0):null;c={};for(b in d)d.hasOwnProperty(b)&&d[b]&&(c[b]=d[b].slice(0))}return c};var R=function(b,c,d,e){var f=h[this.id]&&h[this.id].handlers[b];if(f&&f.length){var g,i,j,k=c||this;for(g=0,i=f.length;i>g;g++)j=f[g],c=k,"string"==typeof j&&"function"==typeof a[j]&&(j=a[j]),"object"==typeof j&&j&&"function"==typeof j.handleEvent&&(c=j,j=j.handleEvent),"function"==typeof j&&A(j,c,d,e)}return this};K.prototype.clip=function(a){a=z(a);for(var b=0;bd;d++)f=h[c[d]].instance,f&&f instanceof K&&g.push(f);return g};N.hoverClass="zeroclipboard-is-hover",N.activeClass="zeroclipboard-is-active",N.trustedOrigins=null,N.allowScriptAccess=null,N.useNoCache=!0,N.moviePath="ZeroClipboard.swf",K.detectFlashSupport=function(){return C("ZeroClipboard.detectFlashSupport",N.debug),J()},K.dispatch=function(a,b){if("string"==typeof a&&a){var c=a.toLowerCase().replace(/^on/,"");if(c)for(var e=d&&N.autoActivate===!0?S(d):M(),f=0,g=e.length;g>f;f++)T.call(e[f],c,b)}},K.prototype.setHandCursor=function(a){return C("ZeroClipboard.prototype.setHandCursor",N.debug),a="boolean"==typeof a?a:!!a,L(a),N.forceHandCursor=a,this},K.prototype.reposition=function(){return C("ZeroClipboard.prototype.reposition",N.debug),Q()},K.prototype.receiveEvent=function(a,b){if(C("ZeroClipboard.prototype.receiveEvent",N.debug),"string"==typeof a&&a){var c=a.toLowerCase().replace(/^on/,"");c&&T.call(this,c,b)}},K.prototype.setCurrent=function(a){return C("ZeroClipboard.prototype.setCurrent",N.debug),K.activate(a),this},K.prototype.resetBridge=function(){return C("ZeroClipboard.prototype.resetBridge",N.debug),K.deactivate(),this},K.prototype.setTitle=function(a){if(C("ZeroClipboard.prototype.setTitle",N.debug),a=a||N.title||d&&d.getAttribute("title")){var b=P(e.bridge);b&&b.setAttribute("title",a)}return this},K.setDefaults=function(a){C("ZeroClipboard.setDefaults",N.debug),K.config(a)},K.prototype.addEventListener=function(a,b){return C("ZeroClipboard.prototype.addEventListener",N.debug),this.on(a,b)},K.prototype.removeEventListener=function(a,b){return C("ZeroClipboard.prototype.removeEventListener",N.debug),this.off(a,b)},K.prototype.ready=function(){return C("ZeroClipboard.prototype.ready",N.debug),e.ready===!0};var T=function(a,g){a=a.toLowerCase().replace(/^on/,"");var h=g&&g.flashVersion&&b(g.flashVersion)||null,i=d,j=!0;switch(a){case"load":if(h){if(!c(h))return void T.call(this,"onWrongFlash",{flashVersion:h});e.outdated=!1,e.ready=!0,e.version=h}break;case"wrongflash":h&&!c(h)&&(e.outdated=!0,e.ready=!1,e.version=h);break;case"mouseover":s(i,N.hoverClass);break;case"mouseout":N.autoActivate===!0&&K.deactivate();break;case"mousedown":s(i,N.activeClass);break;case"mouseup":t(i,N.activeClass);break;case"datarequested":if(i){var k=i.getAttribute("data-clipboard-target"),l=k?document.getElementById(k):null;if(l){var m=l.value||l.textContent||l.innerText;m&&this.setText(m)}else{var n=i.getAttribute("data-clipboard-text");n&&this.setText(n)}}j=!1;break;case"complete":H(f),i&&i!==I()&&i.focus&&i.focus()}var o=i,p=[this,g];return R.call(this,a,o,p,j)};"function"==typeof define&&define.amd?define(["require","exports","module"],function(a,b,c){return k=c&&c.id||null,K}):"object"==typeof module&&module&&"object"==typeof module.exports&&module.exports&&"function"==typeof a.require?(l=module.id||null,module.exports=K):a.ZeroClipboard=K}(function(){return this}()); \ No newline at end of file +break;case"a":case"A":c._isPm=C(c._l).isPM(b);break;case"H":case"HH":case"h":case"hh":e[lb]=s(b);break;case"m":case"mm":e[mb]=s(b);break;case"s":case"ss":e[nb]=s(b);break;case"S":case"SS":case"SSS":case"SSSS":e[ob]=s(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=I(b);break;case"w":case"ww":case"W":case"WW":case"d":case"dd":case"ddd":case"dddd":case"e":case"E":a=a.substr(0,1);case"gg":case"gggg":case"GG":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=b)}}function K(a){var b,c,d,e,f,g,h,i,j,k,l=[];if(!a._d){for(d=M(a),a._w&&null==a._a[kb]&&null==a._a[jb]&&(f=function(b){var c=parseInt(b,10);return b?b.length<3?c>68?1900+c:2e3+c:c:null==a._a[ib]?db().weekYear():a._a[ib]},g=a._w,null!=g.GG||null!=g.W||null!=g.E?h=Z(f(g.GG),g.W||1,g.E,4,1):(i=C(a._l),j=null!=g.d?V(g.d,i):null!=g.e?parseInt(g.e,10)+i._week.dow:0,k=parseInt(g.w,10)||1,null!=g.d&&ju(e)&&(a._pf._overflowDayOfYear=!0),c=U(e,0,a._dayOfYear),a._a[jb]=c.getUTCMonth(),a._a[kb]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=l[b]=d[b];for(;7>b;b++)a._a[b]=l[b]=null==a._a[b]?2===b?1:0:a._a[b];l[lb]+=s((a._tzm||0)/60),l[mb]+=s((a._tzm||0)%60),a._d=(a._useUTC?U:T).apply(null,l)}}function L(a){var b;a._d||(b=q(a._i),a._a=[b.year,b.month,b.day,b.hour,b.minute,b.second,b.millisecond],K(a))}function M(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function N(a){a._a=[],a._pf.empty=!0;var b,c,d,e,f,g=C(a._l),h=""+a._i,i=h.length,j=0;for(d=G(a._f,g).match(vb)||[],b=0;b0&&a._pf.unusedInput.push(f),h=h.slice(h.indexOf(c)+c.length),j+=c.length),Yb[e]?(c?a._pf.empty=!1:a._pf.unusedTokens.push(e),J(e,c,a)):a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=i-j,h.length>0&&a._pf.unusedInput.push(h),a._isPm&&a._a[lb]<12&&(a._a[lb]+=12),a._isPm===!1&&12===a._a[lb]&&(a._a[lb]=0),K(a),w(a)}function O(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function P(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(a){var c,d,e,f,g;if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(f=0;fg)&&(e=g,d=c));h(a,d||c)}function R(a){var b,c,d=a._i,e=Mb.exec(d);if(e){for(a._pf.iso=!0,b=0,c=Ob.length;c>b;b++)if(Ob[b][1].exec(d)){a._f=Ob[b][0]+(e[6]||" ");break}for(b=0,c=Pb.length;c>b;b++)if(Pb[b][1].exec(d)){a._f+=Pb[b][0];break}d.match(Db)&&(a._f+="Z"),N(a)}else a._d=new Date(d)}function S(b){var c=b._i,d=sb.exec(c);c===a?b._d=new Date:d?b._d=new Date(+d[1]):"string"==typeof c?R(b):m(c)?(b._a=c.slice(0),K(b)):n(c)?b._d=new Date(+c):"object"==typeof c?L(b):b._d=new Date(c)}function T(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function U(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function V(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function W(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function X(a,b,c){var d=hb(Math.abs(a)/1e3),e=hb(d/60),f=hb(e/60),g=hb(f/24),h=hb(g/365),i=45>d&&["s",d]||1===e&&["m"]||45>e&&["mm",e]||1===f&&["h"]||22>f&&["hh",f]||1===g&&["d"]||25>=g&&["dd",g]||45>=g&&["M"]||345>g&&["MM",hb(g/30)]||1===h&&["y"]||["yy",h];return i[2]=b,i[3]=a>0,i[4]=c,W.apply({},i)}function Y(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=db(a).add("d",f),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function Z(a,b,c,d,e){var f,g,h=U(a,0,1).getUTCDay();return c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:u(a-1)+g}}function $(a){var b=a._i,c=a._f;return null===b?db.invalid({nullInput:!0}):("string"==typeof b&&(a._i=b=C().preparse(b)),db.isMoment(b)?(a=i(b),a._d=new Date(+b._d)):c?m(c)?Q(a):N(a):S(a),new f(a))}function _(a,b){db.fn[a]=db.fn[a+"s"]=function(a){var c=this._isUTC?"UTC":"";return null!=a?(this._d["set"+c+b](a),db.updateOffset(this),this):this._d["get"+c+b]()}}function ab(a){db.duration.fn[a]=function(){return this._data[a]}}function bb(a,b){db.duration.fn["as"+a]=function(){return+this/b}}function cb(a){var b=!1,c=db;"undefined"==typeof ender&&(a?(gb.moment=function(){return!b&&console&&console.warn&&(b=!0,console.warn("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.")),c.apply(null,arguments)},h(gb.moment,c)):gb.moment=db)}for(var db,eb,fb="2.5.1",gb=this,hb=Math.round,ib=0,jb=1,kb=2,lb=3,mb=4,nb=5,ob=6,pb={},qb={_isAMomentObject:null,_i:null,_f:null,_l:null,_strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},rb="undefined"!=typeof module&&module.exports&&"undefined"!=typeof require,sb=/^\/?Date\((\-?\d+)/i,tb=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,ub=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,vb=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,wb=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,xb=/\d\d?/,yb=/\d{1,3}/,zb=/\d{1,4}/,Ab=/[+\-]?\d{1,6}/,Bb=/\d+/,Cb=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Db=/Z|[\+\-]\d\d:?\d\d/gi,Eb=/T/i,Fb=/[\+\-]?\d+(\.\d{1,3})?/,Gb=/\d/,Hb=/\d\d/,Ib=/\d{3}/,Jb=/\d{4}/,Kb=/[+-]?\d{6}/,Lb=/[+-]?\d+/,Mb=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Nb="YYYY-MM-DDTHH:mm:ssZ",Ob=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Pb=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Qb=/([\+\-]|\d\d)/gi,Rb="Date|Hours|Minutes|Seconds|Milliseconds".split("|"),Sb={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},Tb={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},Ub={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},Vb={},Wb="DDD w W M D d".split(" "),Xb="M D H h m s w W".split(" "),Yb={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return k(this.year()%100,2)},YYYY:function(){return k(this.year(),4)},YYYYY:function(){return k(this.year(),5)},YYYYYY:function(){var a=this.year(),b=a>=0?"+":"-";return b+k(Math.abs(a),6)},gg:function(){return k(this.weekYear()%100,2)},gggg:function(){return k(this.weekYear(),4)},ggggg:function(){return k(this.weekYear(),5)},GG:function(){return k(this.isoWeekYear()%100,2)},GGGG:function(){return k(this.isoWeekYear(),4)},GGGGG:function(){return k(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return s(this.milliseconds()/100)},SS:function(){return k(s(this.milliseconds()/10),2)},SSS:function(){return k(this.milliseconds(),3)},SSSS:function(){return k(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+k(s(a/60),2)+":"+k(s(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+k(s(a/60),2)+k(s(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},Zb=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];Wb.length;)eb=Wb.pop(),Yb[eb+"o"]=d(Yb[eb],eb);for(;Xb.length;)eb=Xb.pop(),Yb[eb+eb]=c(Yb[eb],2);for(Yb.DDDD=c(Yb.DDD,3),h(e.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c,d;for(this._monthsParse||(this._monthsParse=[]),b=0;12>b;b++)if(this._monthsParse[b]||(c=db.utc([2e3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=db([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return Y(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),db=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=c,g._f=d,g._l=e,g._strict=f,g._isUTC=!1,g._pf=b(),$(g)},db.utc=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=c,g._f=d,g._strict=f,g._pf=b(),$(g).utc()},db.unix=function(a){return db(1e3*a)},db.duration=function(a,b){var c,d,e,f=a,h=null;return db.isDuration(a)?f={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(f={},b?f[b]=a:f.milliseconds=a):(h=tb.exec(a))?(c="-"===h[1]?-1:1,f={y:0,d:s(h[kb])*c,h:s(h[lb])*c,m:s(h[mb])*c,s:s(h[nb])*c,ms:s(h[ob])*c}):(h=ub.exec(a))&&(c="-"===h[1]?-1:1,e=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*c},f={y:e(h[2]),M:e(h[3]),d:e(h[4]),h:e(h[5]),m:e(h[6]),s:e(h[7]),w:e(h[8])}),d=new g(f),db.isDuration(a)&&a.hasOwnProperty("_lang")&&(d._lang=a._lang),d},db.version=fb,db.defaultFormat=Nb,db.updateOffset=function(){},db.lang=function(a,b){var c;return a?(b?A(y(a),b):null===b?(B(a),a="en"):pb[a]||C(a),c=db.duration.fn._lang=db.fn._lang=C(a),c._abbr):db.fn._lang._abbr},db.langData=function(a){return a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr),C(a)},db.isMoment=function(a){return a instanceof f||null!=a&&a.hasOwnProperty("_isAMomentObject")},db.isDuration=function(a){return a instanceof g},eb=Zb.length-1;eb>=0;--eb)r(Zb[eb]);for(db.normalizeUnits=function(a){return p(a)},db.invalid=function(a){var b=db.utc(0/0);return null!=a?h(b._pf,a):b._pf.userInvalidated=!0,b},db.parseZone=function(a){return db(a).parseZone()},h(db.fn=f.prototype,{clone:function(){return db(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=db(this).utc();return 00:!1},parsingFlags:function(){return h({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(a){var b=F(this,a||db.defaultFormat);return this.lang().postformat(b)},add:function(a,b){var c;return c="string"==typeof a?db.duration(+b,a):db.duration(a,b),l(this,c,1),this},subtract:function(a,b){var c;return c="string"==typeof a?db.duration(+b,a):db.duration(a,b),l(this,c,-1),this},diff:function(a,b,c){var d,e,f=z(a,this),g=6e4*(this.zone()-f.zone());return b=p(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+f.daysInMonth()),e=12*(this.year()-f.year())+(this.month()-f.month()),e+=(this-db(this).startOf("month")-(f-db(f).startOf("month")))/d,e-=6e4*(this.zone()-db(this).startOf("month").zone()-(f.zone()-db(f).startOf("month").zone()))/d,"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:j(e)},from:function(a,b){return db.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(db(),a)},calendar:function(){var a=z(db(),this).startOf("day"),b=this.diff(a,"days",!0),c=-6>b?"sameElse":-1>b?"lastWeek":0>b?"lastDay":1>b?"sameDay":2>b?"nextDay":7>b?"nextWeek":"sameElse";return this.format(this.lang().calendar(c,this))},isLeapYear:function(){return v(this.year())},isDST:function(){return this.zone()+db(a).startOf(b)},isBefore:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+db(a).startOf(b)},isSame:function(a,b){return b=b||"ms",+this.clone().startOf(b)===+z(a,this).startOf(b)},min:function(a){return a=db.apply(null,arguments),this>a?this:a},max:function(a){return a=db.apply(null,arguments),a>this?this:a},zone:function(a){var b=this._offset||0;return null==a?this._isUTC?b:this._d.getTimezoneOffset():("string"==typeof a&&(a=I(a)),Math.abs(a)<16&&(a=60*a),this._offset=a,this._isUTC=!0,b!==a&&l(this,db.duration(b-a,"m"),1,!0),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?db(a).zone():0,(this.zone()-a)%60===0},daysInMonth:function(){return t(this.year(),this.month())},dayOfYear:function(a){var b=hb((db(this).startOf("day")-db(this).startOf("year"))/864e5)+1;return null==a?b:this.add("d",a-b)},quarter:function(){return Math.ceil((this.month()+1)/3)},weekYear:function(a){var b=Y(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=Y(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=Y(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this.day()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},get:function(a){return a=p(a),this[a]()},set:function(a,b){return a=p(a),"function"==typeof this[a]&&this[a](b),this},lang:function(b){return b===a?this._lang:(this._lang=C(b),this)}}),eb=0;eb=10}var d,e={bridge:null,version:"0.0.0",disabled:null,outdated:null,ready:null},f={},g=0,h={},i=0,j={},k=null,l=null,m=function(){var a,b,c,d,e="ZeroClipboard.swf";if(document.currentScript&&(d=document.currentScript.src));else{var f=document.getElementsByTagName("script");if("readyState"in f[0])for(a=f.length;a--&&("interactive"!==f[a].readyState||!(d=f[a].src)););else if("loading"===document.readyState)d=f[f.length-1].src;else{for(a=f.length;a--;){if(c=f[a].src,!c){b=null;break}if(c=c.split("#")[0].split("?")[0],c=c.slice(0,c.lastIndexOf("/")+1),null==b)b=c;else if(b!==c){b=null;break}}null!==b&&(d=b)}}return d&&(d=d.split("#")[0].split("?")[0],e=d.slice(0,d.lastIndexOf("/")+1)+e),e}(),n=function(){var a=/\-([a-z])/g,b=function(a,b){return b.toUpperCase()};return function(c){return c.replace(a,b)}}(),o=function(b,c){var d,e,f;return a.getComputedStyle?d=a.getComputedStyle(b,null).getPropertyValue(c):(e=n(c),d=b.currentStyle?b.currentStyle[e]:b.style[e]),"cursor"!==c||d&&"auto"!==d||(f=b.tagName.toLowerCase(),"a"!==f)?d:"pointer"},p=function(b){b||(b=a.event);var c;this!==a?c=this:b.target?c=b.target:b.srcElement&&(c=b.srcElement),K.activate(c)},q=function(a,b,c){a&&1===a.nodeType&&(a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c))},r=function(a,b,c){a&&1===a.nodeType&&(a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&a.detachEvent("on"+b,c))},s=function(a,b){if(!a||1!==a.nodeType)return a;if(a.classList)return a.classList.contains(b)||a.classList.add(b),a;if(b&&"string"==typeof b){var c=(b||"").split(/\s+/);if(1===a.nodeType)if(a.className){for(var d=" "+a.className+" ",e=a.className,f=0,g=c.length;g>f;f++)d.indexOf(" "+c[f]+" ")<0&&(e+=" "+c[f]);a.className=e.replace(/^\s+|\s+$/g,"")}else a.className=b}return a},t=function(a,b){if(!a||1!==a.nodeType)return a;if(a.classList)return a.classList.contains(b)&&a.classList.remove(b),a;if(b&&"string"==typeof b||void 0===b){var c=(b||"").split(/\s+/);if(1===a.nodeType&&a.className)if(b){for(var d=(" "+a.className+" ").replace(/[\n\t]/g," "),e=0,f=c.length;f>e;e++)d=d.replace(" "+c[e]+" "," ");a.className=d.replace(/^\s+|\s+$/g,"")}else a.className=""}return a},u=function(){var a,b,c,d=1;return"function"==typeof document.body.getBoundingClientRect&&(a=document.body.getBoundingClientRect(),b=a.right-a.left,c=document.body.offsetWidth,d=Math.round(b/c*100)/100),d},v=function(b,c){var d={left:0,top:0,width:0,height:0,zIndex:B(c)-1};if(b.getBoundingClientRect){var e,f,g,h=b.getBoundingClientRect();"pageXOffset"in a&&"pageYOffset"in a?(e=a.pageXOffset,f=a.pageYOffset):(g=u(),e=Math.round(document.documentElement.scrollLeft/g),f=Math.round(document.documentElement.scrollTop/g));var i=document.documentElement.clientLeft||0,j=document.documentElement.clientTop||0;d.left=h.left+e-i,d.top=h.top+f-j,d.width="width"in h?h.width:h.right-h.left,d.height="height"in h?h.height:h.bottom-h.top}return d},w=function(a,b){var c=null==b||b&&b.cacheBust===!0&&b.useNoCache===!0;return c?(-1===a.indexOf("?")?"?":"&")+"noCache="+(new Date).getTime():""},x=function(b){var c,d,e,f=[],g=[],h=[];if(b.trustedOrigins&&("string"==typeof b.trustedOrigins?g.push(b.trustedOrigins):"object"==typeof b.trustedOrigins&&"length"in b.trustedOrigins&&(g=g.concat(b.trustedOrigins))),b.trustedDomains&&("string"==typeof b.trustedDomains?g.push(b.trustedDomains):"object"==typeof b.trustedDomains&&"length"in b.trustedDomains&&(g=g.concat(b.trustedDomains))),g.length)for(c=0,d=g.length;d>c;c++)if(g.hasOwnProperty(c)&&g[c]&&"string"==typeof g[c]){if(e=E(g[c]),!e)continue;if("*"===e){h=[e];break}h.push.apply(h,[e,"//"+e,a.location.protocol+"//"+e])}return h.length&&f.push("trustedOrigins="+encodeURIComponent(h.join(","))),"string"==typeof b.jsModuleId&&b.jsModuleId&&f.push("jsModuleId="+encodeURIComponent(b.jsModuleId)),f.join("&")},y=function(a,b,c){if("function"==typeof b.indexOf)return b.indexOf(a,c);var d,e=b.length;for("undefined"==typeof c?c=0:0>c&&(c=e+c),d=c;e>d;d++)if(b.hasOwnProperty(d)&&b[d]===a)return d;return-1},z=function(a){if("string"==typeof a)throw new TypeError("ZeroClipboard doesn't accept query strings.");return a.length?a:[a]},A=function(b,c,d,e){e?a.setTimeout(function(){b.apply(c,d)},0):b.apply(c,d)},B=function(a){var b,c;return a&&("number"==typeof a&&a>0?b=a:"string"==typeof a&&(c=parseInt(a,10))&&!isNaN(c)&&c>0&&(b=c)),b||("number"==typeof N.zIndex&&N.zIndex>0?b=N.zIndex:"string"==typeof N.zIndex&&(c=parseInt(N.zIndex,10))&&!isNaN(c)&&c>0&&(b=c)),b||0},C=function(a,b){if(a&&b!==!1&&"undefined"!=typeof console&&console&&(console.warn||console.log)){var c="`"+a+"` is deprecated. See docs for more info:\n https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/instructions.md#deprecations";console.warn?console.warn(c):console.log(c)}},D=function(){var a,b,c,d,e,f,g=arguments[0]||{};for(a=1,b=arguments.length;b>a;a++)if(null!=(c=arguments[a]))for(d in c)if(c.hasOwnProperty(d)){if(e=g[d],f=c[d],g===f)continue;void 0!==f&&(g[d]=f)}return g},E=function(a){if(null==a||""===a)return null;if(a=a.replace(/^\s+|\s+$/g,""),""===a)return null;var b=a.indexOf("//");a=-1===b?a:a.slice(b+2);var c=a.indexOf("/");return a=-1===c?a:-1===b||0===c?null:a.slice(0,c),a&&".swf"===a.slice(-4).toLowerCase()?null:a||null},F=function(){var a=function(a,b){var c,d,e;if(null!=a&&"*"!==b[0]&&("string"==typeof a&&(a=[a]),"object"==typeof a&&"length"in a))for(c=0,d=a.length;d>c;c++)if(a.hasOwnProperty(c)&&(e=E(a[c]))){if("*"===e){b.length=0,b.push("*");break}-1===y(e,b)&&b.push(e)}},b={always:"always",samedomain:"sameDomain",never:"never"};return function(c,d){var e,f=d.allowScriptAccess;if("string"==typeof f&&(e=f.toLowerCase())&&/^always|samedomain|never$/.test(e))return b[e];var g=E(d.moviePath);null===g&&(g=c);var h=[];a(d.trustedOrigins,h),a(d.trustedDomains,h);var i=h.length;if(i>0){if(1===i&&"*"===h[0])return"always";if(-1!==y(c,h))return 1===i&&c===g?"sameDomain":"always"}return"never"}}(),G=function(a){if(null==a)return[];if(Object.keys)return Object.keys(a);var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b},H=function(a){if(a)for(var b in a)a.hasOwnProperty(b)&&delete a[b];return a},I=function(){try{return document.activeElement}catch(a){}return null},J=function(){var a=!1;if("boolean"==typeof e.disabled)a=e.disabled===!1;else{if("function"==typeof ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")&&(a=!0)}catch(b){}!a&&navigator.mimeTypes["application/x-shockwave-flash"]&&(a=!0)}return a},K=function(a,b){return this instanceof K?(this.id=""+g++,h[this.id]={instance:this,elements:[],handlers:{}},a&&this.clip(a),"undefined"!=typeof b&&(C("new ZeroClipboard(elements, options)",N.debug),K.config(b)),this.options=K.config(),"boolean"!=typeof e.disabled&&(e.disabled=!J()),void(e.disabled===!1&&e.outdated!==!0&&null===e.bridge&&(e.outdated=!1,e.ready=!1,O()))):new K(a,b)};K.prototype.setText=function(a){return a&&""!==a&&(f["text/plain"]=a,e.ready===!0&&e.bridge&&"function"==typeof e.bridge.setText?e.bridge.setText(a):e.ready=!1),this},K.prototype.setSize=function(a,b){return e.ready===!0&&e.bridge&&"function"==typeof e.bridge.setSize?e.bridge.setSize(a,b):e.ready=!1,this};var L=function(a){e.ready===!0&&e.bridge&&"function"==typeof e.bridge.setHandCursor?e.bridge.setHandCursor(a):e.ready=!1};K.prototype.destroy=function(){this.unclip(),this.off(),delete h[this.id]};var M=function(){var a,b,c,d=[],e=G(h);for(a=0,b=e.length;b>a;a++)c=h[e[a]].instance,c&&c instanceof K&&d.push(c);return d};K.version="1.3.5";var N={swfPath:m,trustedDomains:a.location.host?[a.location.host]:[],cacheBust:!0,forceHandCursor:!1,zIndex:999999999,debug:!0,title:null,autoActivate:!0};K.config=function(a){if("object"==typeof a&&null!==a&&D(N,a),"string"!=typeof a||!a){var b={};for(var c in N)N.hasOwnProperty(c)&&(b[c]="object"==typeof N[c]&&null!==N[c]?"length"in N[c]?N[c].slice(0):D({},N[c]):N[c]);return b}return N.hasOwnProperty(a)?N[a]:void 0},K.destroy=function(){K.deactivate();for(var a in h)if(h.hasOwnProperty(a)&&h[a]){var b=h[a].instance;b&&"function"==typeof b.destroy&&b.destroy()}var c=P(e.bridge);c&&c.parentNode&&(c.parentNode.removeChild(c),e.ready=null,e.bridge=null)},K.activate=function(a){d&&(t(d,N.hoverClass),t(d,N.activeClass)),d=a,s(a,N.hoverClass),Q();var b=N.title||a.getAttribute("title");if(b){var c=P(e.bridge);c&&c.setAttribute("title",b)}var f=N.forceHandCursor===!0||"pointer"===o(a,"cursor");L(f)},K.deactivate=function(){var a=P(e.bridge);a&&(a.style.left="0px",a.style.top="-9999px",a.removeAttribute("title")),d&&(t(d,N.hoverClass),t(d,N.activeClass),d=null)};var O=function(){var b,c,d=document.getElementById("global-zeroclipboard-html-bridge");if(!d){var f=K.config();f.jsModuleId="string"==typeof k&&k||"string"==typeof l&&l||null;var g=F(a.location.host,N),h=x(f),i=N.moviePath+w(N.moviePath,N),j=' '; +d=document.createElement("div"),d.id="global-zeroclipboard-html-bridge",d.setAttribute("class","global-zeroclipboard-container"),d.style.position="absolute",d.style.left="0px",d.style.top="-9999px",d.style.width="15px",d.style.height="15px",d.style.zIndex=""+B(N.zIndex),document.body.appendChild(d),d.innerHTML=j}b=document["global-zeroclipboard-flash-bridge"],b&&(c=b.length)&&(b=b[c-1]),e.bridge=b||d.children[0].lastElementChild},P=function(a){for(var b=/^OBJECT|EMBED$/,c=a&&a.parentNode;c&&b.test(c.nodeName)&&c.parentNode;)c=c.parentNode;return c||null},Q=function(){if(d){var a=v(d,N.zIndex),b=P(e.bridge);b&&(b.style.top=a.top+"px",b.style.left=a.left+"px",b.style.width=a.width+"px",b.style.height=a.height+"px",b.style.zIndex=a.zIndex+1),e.ready===!0&&e.bridge&&"function"==typeof e.bridge.setSize?e.bridge.setSize(a.width,a.height):e.ready=!1}return this};K.prototype.on=function(a,b){var c,d,f,g={},i=h[this.id]&&h[this.id].handlers;if("string"==typeof a&&a)f=a.toLowerCase().split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof b)for(c in a)a.hasOwnProperty(c)&&"string"==typeof c&&c&&"function"==typeof a[c]&&this.on(c,a[c]);if(f&&f.length){for(c=0,d=f.length;d>c;c++)a=f[c].replace(/^on/,""),g[a]=!0,i[a]||(i[a]=[]),i[a].push(b);g.noflash&&e.disabled&&T.call(this,"noflash",{}),g.wrongflash&&e.outdated&&T.call(this,"wrongflash",{flashVersion:e.version}),g.load&&e.ready&&T.call(this,"load",{flashVersion:e.version})}return this},K.prototype.off=function(a,b){var c,d,e,f,g,i=h[this.id]&&h[this.id].handlers;if(0===arguments.length)f=G(i);else if("string"==typeof a&&a)f=a.split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof b)for(c in a)a.hasOwnProperty(c)&&"string"==typeof c&&c&&"function"==typeof a[c]&&this.off(c,a[c]);if(f&&f.length)for(c=0,d=f.length;d>c;c++)if(a=f[c].toLowerCase().replace(/^on/,""),g=i[a],g&&g.length)if(b)for(e=y(b,g);-1!==e;)g.splice(e,1),e=y(b,g,e);else i[a].length=0;return this},K.prototype.handlers=function(a){var b,c=null,d=h[this.id]&&h[this.id].handlers;if(d){if("string"==typeof a&&a)return d[a]?d[a].slice(0):null;c={};for(b in d)d.hasOwnProperty(b)&&d[b]&&(c[b]=d[b].slice(0))}return c};var R=function(b,c,d,e){var f=h[this.id]&&h[this.id].handlers[b];if(f&&f.length){var g,i,j,k=c||this;for(g=0,i=f.length;i>g;g++)j=f[g],c=k,"string"==typeof j&&"function"==typeof a[j]&&(j=a[j]),"object"==typeof j&&j&&"function"==typeof j.handleEvent&&(c=j,j=j.handleEvent),"function"==typeof j&&A(j,c,d,e)}return this};K.prototype.clip=function(a){a=z(a);for(var b=0;bd;d++)f=h[c[d]].instance,f&&f instanceof K&&g.push(f);return g};N.hoverClass="zeroclipboard-is-hover",N.activeClass="zeroclipboard-is-active",N.trustedOrigins=null,N.allowScriptAccess=null,N.useNoCache=!0,N.moviePath="ZeroClipboard.swf",K.detectFlashSupport=function(){return C("ZeroClipboard.detectFlashSupport",N.debug),J()},K.dispatch=function(a,b){if("string"==typeof a&&a){var c=a.toLowerCase().replace(/^on/,"");if(c)for(var e=d&&N.autoActivate===!0?S(d):M(),f=0,g=e.length;g>f;f++)T.call(e[f],c,b)}},K.prototype.setHandCursor=function(a){return C("ZeroClipboard.prototype.setHandCursor",N.debug),a="boolean"==typeof a?a:!!a,L(a),N.forceHandCursor=a,this},K.prototype.reposition=function(){return C("ZeroClipboard.prototype.reposition",N.debug),Q()},K.prototype.receiveEvent=function(a,b){if(C("ZeroClipboard.prototype.receiveEvent",N.debug),"string"==typeof a&&a){var c=a.toLowerCase().replace(/^on/,"");c&&T.call(this,c,b)}},K.prototype.setCurrent=function(a){return C("ZeroClipboard.prototype.setCurrent",N.debug),K.activate(a),this},K.prototype.resetBridge=function(){return C("ZeroClipboard.prototype.resetBridge",N.debug),K.deactivate(),this},K.prototype.setTitle=function(a){if(C("ZeroClipboard.prototype.setTitle",N.debug),a=a||N.title||d&&d.getAttribute("title")){var b=P(e.bridge);b&&b.setAttribute("title",a)}return this},K.setDefaults=function(a){C("ZeroClipboard.setDefaults",N.debug),K.config(a)},K.prototype.addEventListener=function(a,b){return C("ZeroClipboard.prototype.addEventListener",N.debug),this.on(a,b)},K.prototype.removeEventListener=function(a,b){return C("ZeroClipboard.prototype.removeEventListener",N.debug),this.off(a,b)},K.prototype.ready=function(){return C("ZeroClipboard.prototype.ready",N.debug),e.ready===!0};var T=function(a,g){a=a.toLowerCase().replace(/^on/,"");var h=g&&g.flashVersion&&b(g.flashVersion)||null,i=d,j=!0;switch(a){case"load":if(h){if(!c(h))return void T.call(this,"onWrongFlash",{flashVersion:h});e.outdated=!1,e.ready=!0,e.version=h}break;case"wrongflash":h&&!c(h)&&(e.outdated=!0,e.ready=!1,e.version=h);break;case"mouseover":s(i,N.hoverClass);break;case"mouseout":N.autoActivate===!0&&K.deactivate();break;case"mousedown":s(i,N.activeClass);break;case"mouseup":t(i,N.activeClass);break;case"datarequested":if(i){var k=i.getAttribute("data-clipboard-target"),l=k?document.getElementById(k):null;if(l){var m=l.value||l.textContent||l.innerText;m&&this.setText(m)}else{var n=i.getAttribute("data-clipboard-text");n&&this.setText(n)}}j=!1;break;case"complete":H(f),i&&i!==I()&&i.focus&&i.focus()}var o=i,p=[this,g];return R.call(this,a,o,p,j)};"function"==typeof define&&define.amd?define(["require","exports","module"],function(a,b,c){return k=c&&c.id||null,K}):"object"==typeof module&&module&&"object"==typeof module.exports&&module.exports&&"function"==typeof a.require?(l=module.id||null,module.exports=K):a.ZeroClipboard=K}(function(){return this}()); \ No newline at end of file diff --git a/public/src/js/app.js b/public/src/js/app.js index 5185f39..b3ca435 100644 --- a/public/src/js/app.js +++ b/public/src/js/app.js @@ -11,6 +11,7 @@ angular.module('insight',[ 'ui.route', 'monospaced.qrcode', 'gettext', + 'angularMoment', 'insight.system', 'insight.socket', 'insight.blocks', diff --git a/public/src/js/config.js b/public/src/js/config.js index ed2ce2e..fdb6dcb 100644 --- a/public/src/js/config.js +++ b/public/src/js/config.js @@ -47,8 +47,9 @@ angular.module('insight') $locationProvider.html5Mode(true); $locationProvider.hashPrefix('!'); }) - .run(function($rootScope, $route, $location, $routeParams, $anchorScroll, ngProgress, gettextCatalog) { + .run(function($rootScope, $route, $location, $routeParams, $anchorScroll, ngProgress, gettextCatalog, amMoment) { gettextCatalog.currentLanguage = defaultLanguage; + amMoment.changeLanguage(defaultLanguage); $rootScope.$on('$routeChangeStart', function() { ngProgress.start(); }); diff --git a/public/src/js/controllers/footer.js b/public/src/js/controllers/footer.js index 4c419d2..58a34d4 100644 --- a/public/src/js/controllers/footer.js +++ b/public/src/js/controllers/footer.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('insight.system').controller('FooterController', - function($scope, $route, $templateCache, gettextCatalog, Version) { + function($scope, $route, $templateCache, gettextCatalog, amMoment, Version) { $scope.defaultLanguage = defaultLanguage; @@ -24,6 +24,7 @@ angular.module('insight.system').controller('FooterController', $scope.setLanguage = function(isoCode) { gettextCatalog.currentLanguage = $scope.defaultLanguage = defaultLanguage = isoCode; + amMoment.changeLanguage(isoCode); localStorage.setItem('insight-language', isoCode); var currentPageTemplate = $route.current.templateUrl; $templateCache.remove(currentPageTemplate);