Dist alındı

parent 98692a69
/*! ulakbus-ui 2016-10-14 */
/*! ulakbus-ui 2016-10-21 */
"use strict";angular.module("ulakbus",["angular-loading-bar","ngRoute","ngSanitize","ngCookies","ulakbus.formService","ulakbus.messaging","ulakbus.dashboard","ulakbus.auth","ulakbus.error_pages","ulakbus.crud","ulakbus.debug","ulakbus.devSettings","ulakbus.version","gettext","markdown","templates-prod"]).constant("RESTURL",function(){var backendurl=location.href.indexOf("nightly")>-1?"//nightly.api.ulakbus.net/":"//api.ulakbus.net/";if(document.cookie.indexOf("backendurl")>-1){var cookiearray=document.cookie.split(";");angular.forEach(cookiearray,function(item){item.indexOf("backendurl")>-1&&(backendurl=item.split("=")[1],"/"!==backendurl.slice(-1)&&(backendurl+="/"),"http"!==backendurl.substring(0,4)&&(backendurl="http://"+backendurl))})}if(location.href.indexOf("backendurl")>-1){var urlfromqstr=location.href.split("?")[1].split("=")[1];backendurl=decodeURIComponent(urlfromqstr.replace(/\+/g," ")),"/"!==backendurl.slice(-1)&&(backendurl+="/"),"http"!==backendurl.substring(0,4)&&(backendurl="http://"+backendurl),document.cookie="backendurl="+backendurl,window.location.href=window.location.href.split("?")[0]}return{url:backendurl}}()).factory("IsOnline",function($window,$document,$rootScope){var isOnlineService={};isOnlineService.status=!0;var offlineMask=angular.element('<div class="body-mask" style="z-index: 2010; opacity: 0.6"><div class="alert alert-danger text-center" role="alert" style="z-index: 2011; position: relative">İnternet bağlantınız kesilmiştir. Bağlantı sağlandığında kaldığınız yerden devam edebilirsiniz.</div></div>'),body=$document.find("body").eq(0);return isOnlineService.set_status=function(state){state!=isOnlineService.status&&(state?(offlineMask.remove(),$rootScope.current_user===!0&&window.location.reload()):body.append(offlineMask)),isOnlineService.status=state},isOnlineService.get_status=function(){return isOnlineService.status},isOnlineService.status=navigator.onLine,$window.addEventListener("offline",function(){isOnlineService.set_status(!1)}),$window.addEventListener("online",function(){isOnlineService.set_status(!0)}),isOnlineService}).constant("toastr",window.toastr).constant("WS",window.WebSocket).config(function($logProvider){$logProvider.debugEnabled(!1)}).config(function(markdownProvider){}),angular.module("ulakbus").config(["$routeProvider",function($routeProvider,$route){$routeProvider.when("/login",{templateUrl:"components/auth/login.html",controller:"LoginController"}).when("/dashboard",{templateUrl:"components/dashboard/dashboard.html",controller:"DashController"}).when("/dev/settings",{templateUrl:"components/devSettings/devSettings.html",controller:"DevSettingsController"}).when("/debug/list",{templateUrl:"components/debug/debug.html",controller:"DebugController"}).when("/admin/bpmnmanager",{templateUrl:"components/admin/bpmn_manager.html",controller:"BpmnManagerController"}).when("/newdesigns",{templateUrl:"components/uitemplates/base.html",controller:"NewDesignsCtrl"}).when("/formservicepg",{templateUrl:"components/uitemplates/form_service_pg.html",controller:"FormServicePg"}).when("/:wf/",{templateUrl:"components/crud/templates/crud-preload.html",controller:"CRUDController"}).when("/cwf/:wf/:token",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDController"}).when("/:wf/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormController"}).when("/:wf/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormController"}).when("/:wf/:model",{templateUrl:"components/crud/templates/crud-preload.html",controller:"CRUDController"}).when("/:wf/:model/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormController"}).when("/:wf/:model/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormController"}).otherwise({redirectTo:"/dashboard"})}]).run(function($rootScope,AuthService){AuthService.check_auth(),$rootScope.loggedInUser=!1,$rootScope.loginAttempt=0,$rootScope.websocketIsOpen=!1,$rootScope.current_user=!0,$rootScope.$on("$routeChangeStart",function(event,next,current){})}).config(["$httpProvider",function($httpProvider){$httpProvider.defaults.withCredentials=!0}]).run(function(gettextCatalog){gettextCatalog.setCurrentLanguage("tr"),gettextCatalog.debug=!0}).config(["cfpLoadingBarProvider",function(cfpLoadingBarProvider){cfpLoadingBarProvider.includeBar=!1,cfpLoadingBarProvider.parentSelector="loaderdiv",cfpLoadingBarProvider.spinnerTemplate='<div class="loader">Loading...</div>'}]),angular.module("ulakbus").config(["$httpProvider",function($httpProvider){$httpProvider.interceptors.push(function(ErrorService,$q,$rootScope,$location,$timeout,$log,toastr){return{request:function(config){return"POST"===config.method&&(config.headers["Content-Type"]="text/plain"),config},response:function(response){return response.data._debug_queries&&response.data._debug_queries.length>0&&($rootScope.debug_queries=$rootScope.debug_queries||[],$rootScope.debug_queries.push({url:response.config.url,queries:response.data._debug_queries})),response.data.is_login===!1&&($rootScope.loggedInUser=response.data.is_login,$location.path("/login")),response.data.is_login===!0&&($rootScope.loggedInUser=!0,$rootScope.loginAttempt=1,"/login"===$location.path()&&$location.path("/dashboard")),response.data.notify&&toastr.info(response.data.notify),response},responseError:function(rejection){return ErrorService.handle(rejection,"http"),$q.reject(rejection)}}})}]),angular.module("ulakbus.formService",["ui.bootstrap"]).service("Moment",function(){return window.moment}).factory("Generator",function($http,$q,$timeout,$sce,$location,$route,$compile,$log,RESTURL,$rootScope,Moment,WSOps,FormConstraints,$uibModal,$filter,Utils){var generator={};return generator.makeUrl=function(scope){var getparams=scope.form_params.param?"?"+scope.form_params.param+"="+scope.form_params.id:"";return RESTURL.url+scope.url+getparams},generator.generate=function(scope,data){return $log.debug("data before generation:",data),data.forms?(angular.forEach(data.forms,function(value,key){scope[key]=data.forms[key]}),scope.client_cmd=data.client_cmd,scope.token=data.token,scope.initialModel=angular.copy(scope.model),generator.prepareFormItems(scope),scope.object_id=scope.form_params.object_id,$log.debug("scope at after generate",scope),scope):scope},generator.group=function(scope){if(!scope.grouping)return scope;var newForm=[],extractFormItem=function(itemList){var extractedList=[];return angular.forEach(itemList,function(value,key){var item=getFormItem(value);item&&extractedList.push(item)}),$log.debug("extractedList: ",extractedList),extractedList},getFormItem=function(item){var formItem;return scope.form.indexOf(item)>-1?(formItem=scope.form[scope.form.indexOf(item)],scope.form.splice(scope.form.indexOf(item),1),formItem):(angular.forEach(scope.form,function(value,key){if(value.key===item)return formItem=value,void scope.form.splice(key,1)}),formItem)},makeGroup=function(itemsToGroup){var subItems=[];return angular.forEach(itemsToGroup,function(value,key){subItems.push({type:"fieldset",items:extractFormItem(value.items),title:value.group_title})}),subItems};return angular.forEach(scope.grouping,function(value,key){newForm.push({type:"fieldset",items:makeGroup(value.groups),htmlClass:"col-md-"+value.layout,title:value.group_title})}),newForm.length>0&&($log.debug("grouped form: ",newForm),$log.debug("rest of form: ",scope.form),$log.debug("form united: ",newForm.concat(scope.form))),scope.form=newForm.concat(scope.form),scope},generator.constraints=function(scope){return angular.forEach(scope.form,function(v,k){try{var cons=scope.forms.constraints[v]||scope.forms.constraints[v.key];angular.isDefined(cons)&&(v.constructor===String?scope.form[k]={key:v,validationMessage:{form_cons:cons.val_msg},$validators:{form_cons:function(value){return FormConstraints[cons.cons](value,cons.val,v)}}}:(v.key=v.key,v.validationMessage=angular.extend({form_cons:cons.val_msg},v.validationMessage),v.$validators=angular.extend({form_cons:function(value){return FormConstraints[cons.cons](value,cons.val,v.key)}},v.$asyncValidators)))}catch(e){$log.error(e.message)}}),generator.group(scope)},generator.prepareFormItems=function(scope){angular.forEach(scope.form,function(value,key){if("help"===value.type){var markdown=$filter("markdown");value.helpvalue=markdown(value.helpvalue)}"select"===value.type&&(scope.schema.properties[value.key].type="select",scope.schema.properties[value.key].titleMap=value.titleMap,scope.form[key]=value.key)});var _buttons=function(scope,v,k){var buttonPositions=scope.modalElements?scope.modalElements.buttonPositions:{bottom:"move-to-bottom",top:"move-to-top",none:""},workOnForm=scope.modalElements?scope.modalElements.workOnForm:"formgenerated",workOnDiv=scope.modalElements?scope.modalElements.workOnDiv:"",buttonClass=buttonPositions[v.position]||buttonPositions.bottom,redirectTo=!scope.modalElements;scope.form[scope.form.indexOf(k)]={type:v.type,title:v.title,style:(v.style||"btn-danger")+" hide bottom-margined "+buttonClass,onClick:function(){delete scope.form_params.cmd,delete scope.form_params.flow,v.cmd&&(scope.form_params.cmd=v.cmd),v.flow&&(scope.form_params.flow=v.flow),v.wf&&(delete scope.form_params.cmd,scope.form_params.wf=v.wf),scope.model[k]=1,scope.modalElements?scope.submitModalForm():!v.form_validate&&angular.isDefined(v.form_validate)?generator.submit(scope,redirectTo):(scope.$broadcast("schemaFormValidate"),scope[workOnForm].$valid?(generator.submit(scope,redirectTo),scope.$broadcast("disposeModal")):$timeout(function(){var firsterror=angular.element(document.querySelectorAll("input.ng-invalid"))[0];firsterror.focus()}))}},$timeout(function(){var selectorBottom=".buttons-on-bottom"+workOnDiv,buttonsToBottom=angular.element(document.querySelector("."+buttonClass));angular.element(document.querySelector(selectorBottom)).append(buttonsToBottom),buttonsToBottom.removeClass("hide")},500)},_numbers=function(scope,v,k){v.type="number",v.validationMessage={max:"bu alan -2147483647 ve 2147483647 arasında olmalıdır."},v.$validators={max:function(value){return 2147483647>value>-2147483647}},scope.model[k]=parseInt(scope.model[k])},_node_default=function(scope,v,k){scope[v.type]=scope[v.type]||{},scope[v.type][k]=angular.copy({title:v.title,form:[],schema:{properties:{},properties_list:[],required:[],title:v.title,type:"object",formType:v.type,model_name:k,inline_edit:scope.inline_edit},buttons:v.buttons,url:scope.url,wf:v.wf||scope.wf,quick_add:v.quick_add,quick_add_view:v.quick_add_view,quick_add_model:v.quick_add_model,quick_add_field:v.quick_add_field,nodeModelChange:function(item){}}),angular.forEach(v.schema,function(item){scope[v.type][k].schema.properties[item.name]=angular.copy(item),"idx"!=item.name&&scope[v.type][k].schema.properties_list.push(scope[v.type][k].schema.properties[item.name]),angular.isDefined(item.wf)&&(scope[v.type][k].schema.properties[item.name].wf=angular.copy(item.wf)),item.required===!0&&"idx"!==item.name&&scope[v.type][k].schema.required.push(angular.copy(item.name)),"idx"!==item.name&&scope[v.type][k].form.push(item.name);try{"date"===item.type}catch(e){$log.debug("Error: ",e.message)}}),$timeout(function(){if("ListNode"==v.type){var list=scope[v.type][k];list.items=angular.copy(scope.model[k]||[]),angular.forEach(list.items,function(node,fieldName){Object.keys(node).length&&angular.forEach(node,function(prop,propName){var propInSchema=list.schema.properties[propName];try{"date"===propInSchema.type&&(node[propName]=generator.dateformatter(prop),list.model[fieldName][propName]=generator.dateformatter(prop)),"select"===propInSchema.type&&(node[propName]=generator.item_from_array(prop.toString(),list.schema.properties[propName].titleMap)),propInSchema.titleMap&&(node[propName]={key:prop,unicode:generator.item_from_array(prop,propInSchema.titleMap)})}catch(e){$log.debug("Field is not date")}})})}}),scope.model[k]=scope.model[k]||[],scope[v.type][k].model=scope.model[k],scope[v.type][k].lengthModels=scope.model[k]?1:0},_node_filter_interface=function(scope,v,k){var formitem=scope.form[scope.form.indexOf(k)],modelScope={form_params:{wf:v.wf||scope.wf||scope.form_params.wf,model:v.model_name||v.schema[0].model_name,cmd:v.list_cmd||"select_list",query:""}};scope.generateTitleMap=function(modelScope){generator.get_list(modelScope).then(function(res){formitem.titleMap=[],angular.forEach(res.objects,function(item){"-1"!==item&&formitem.titleMap.push({value:item.key,name:item.value})}),formitem.filteredItems=generator.get_diff_array(angular.copy(formitem.titleMap),angular.copy(formitem.selectedFilteredItems),1)})};var modelItems=[],modelKeys=[];angular.forEach(scope.model[k],function(value,mkey){modelItems.push({value:value[v.schema[0].name].key,name:value[v.schema[0].name].unicode});var modelKey={};modelKey[v.schema[0].name]=value[v.schema[0].name].key,modelKeys.push(modelKey)}),scope.model[k]=angular.copy(modelKeys),formitem={type:"template",templateUrl:"shared/templates/multiselect.html",title:v.title,formName:k,wf:v.wf||scope.wf,add_cmd:v.add_cmd,name:v.model_name||v.schema[0].model_name,model_name:v.model_name||v.schema[0].model_name,filterValue:"",selected_item:{},filteredItems:[],selectedFilteredItems:modelItems,titleMap:scope.generateTitleMap(modelScope),appendFiltered:function(filterValue){filterValue.length>2&&(formitem.filteredItems=[],angular.forEach(formitem.titleMap,function(value,key){value.name.indexOf(filterValue)>-1&&formitem.filteredItems.push(formitem.titleMap[key])})),filterValue<=2&&(formitem.filteredItems=formitem.titleMap),formitem.filteredItems=generator.get_diff_array(formitem.filteredItems,formitem.selectedFilteredItems)},select:function(selectedItemsModel){selectedItemsModel&&(formitem.selectedFilteredItems=formitem.selectedFilteredItems.concat(selectedItemsModel),formitem.appendFiltered(formitem.filterValue),scope.model[k]=(scope.model[k]||[]).concat(formitem.dataToModel(selectedItemsModel)))},deselect:function(selectedFilteredItemsModel){selectedFilteredItemsModel&&(formitem.selectedFilteredItems=generator.get_diff_array(angular.copy(formitem.selectedFilteredItems),angular.copy(selectedFilteredItemsModel)),formitem.appendFiltered(formitem.filterValue),formitem.filteredItems=formitem.filteredItems.concat(selectedFilteredItemsModel),scope.model[k]=generator.get_diff_array(scope.model[k]||[],formitem.dataToModel(selectedFilteredItemsModel)))},dataToModel:function(data){var dataValues=[];return angular.forEach(data,function(value,key){var dataKey={};dataKey[v.schema[0].name]=value.value,dataValues.push(dataKey)}),dataValues}},scope.form[scope.form.indexOf(k)]=formitem},generate_fields={button:{default:_buttons},submit:{default:_buttons},file:{default:function(scope,v,k){scope.form[scope.form.indexOf(k)]={type:"template",title:v.title,templateUrl:"shared/templates/filefield.html",name:k,key:k,fileInsert:function(){$scope.$broadcast("schemaForm.error."+k,"tv4-302",!0)},imageSrc:scope.model[k]?$rootScope.settings.static_url+scope.model[k]:"",avatar:"avatar"===k},v.type="string"}},select:{default:function(scope,v,k){scope.form[scope.form.indexOf(k)]={type:"template",title:v.title,templateUrl:"shared/templates/select.html",name:k,key:k,titleMap:v.titleMap}}},confirm:{default:function(scope,v,k){scope.form[scope.form.indexOf(k)]={type:"template",title:v.title,confirm_message:v.confirm_message,templateUrl:"shared/templates/confirm.html",name:k,key:k,style:v.style,buttons:v.buttons,modalInstance:"",modalFunction:function(){delete scope.form_params.cmd,delete scope.form_params.flow,v.cmd&&(scope.form_params.cmd=v.cmd),v.flow&&(scope.form_params.flow=v.flow),v.wf&&(delete scope.form_params.cmd,scope.form_params.wf=v.wf);var modalInstance=$uibModal.open({animation:!0,templateUrl:"shared/templates/confirmModalContent.html",controller:"ModalController",resolve:{items:function(){var newscope={form:{title:v.title,confirm_message:v.confirm_message,buttons:v.buttons,onClick:function(cmd){modalInstance.dismiss(),cmd&&generator.submit(scope,!1)}}};return newscope}}})},openModal:function(){var workOnForm=scope.modalElements?scope.modalElements.workOnForm:"formgenerated";!v.form_validate&&angular.isDefined(v.form_validate)?this.modalFunction():(scope.$broadcast("schemaFormValidate"),scope[workOnForm].$valid?this.modalFunction():$timeout(function(){var firsterror=angular.element(document.querySelectorAll("input.ng-invalid"))[0];firsterror.focus()}))}}}},date:{default:function(scope,v,k){$log.debug("date:",scope.model[k]),scope.model[k]=generator.dateformatter(scope.model[k]),scope.form[scope.form.indexOf(k)]={key:k,name:k,title:v.title,type:"template",templateUrl:"shared/templates/datefield.html",validationMessage:{dateNotValid:"Girdiğiniz tarih geçerli değildir. <i>orn: '01.01.2015'<i/>",302:"Bu alan zorunludur."},$asyncValidators:{dateNotValid:function(value){var deferred=$q.defer();return $timeout(function(){if(scope.model[k]=angular.copy(generator.dateformatter(value)),scope.schema.required.indexOf(k)>-1&&deferred.resolve(),value.constructor===Date)deferred.resolve();else{var dateValue=d=value.split(".");isNaN(Date.parse(value))||3!==dateValue.length?deferred.reject():deferred.resolve()}}),deferred.promise}},disabled:!1,is_disabled:function(){return this.disabled},status:{opened:!1},open:function($event){this.disabled=!0,scope.model[k]=Moment(scope.model[k],"DD.MM.YYYY").toDate();var that=this;$timeout(function(){that.status.opened=!0},100)},format:"dd.MM.yyyy",onSelect:function(){this.disabled=!1,scope.model[k]=angular.copy(generator.dateformatter(scope.model[k]))}}}},int:{default:_numbers},boolean:{default:function(scope,v,k){}},string:{default:function(scope,v,k){}},typeahead:{default:function(scope,v,k){scope.form[scope.form.indexOf(k)]={type:"template",title:v.title,titleMap:v.titleMap,templateUrl:"shared/templates/typeahead.html",name:k,key:k,onDropdownSelect:function(item,inputname){scope.model[k]=item.value,$timeout(function(){document.querySelector("input[name="+inputname+"]").value=item.name})}},v.type="string"},custom:function(scope,v,k){scope.form[scope.form.indexOf(k)]={type:"template",title:v.title,widget:v.widget,getTitleMap:function(viewValue){var searchData={form_params:{url:v.wf,wf:v.wf,view:v.view,query:viewValue}};generator.get_list(searchData).then(function(res){return res})},templateUrl:"shared/templates/typeahead.html",name:k,key:k,onDropdownSelect:function(item,inputname){scope.model[k]=item.value,$timeout(function(){document.querySelector("input[name="+inputname+"]").value=item.name})}},v.type="string"}},text_general:{default:function(scope,v,k){v.type="string",v["x-schema-form"]={type:"textarea"}}},float:{default:_numbers},model:{default:function(scope,v,k){var formitem=scope.form[scope.form.indexOf(k)],modelScope={url:v.wf,wf:v.wf,form_params:{wf:v.wf,model:v.model_name,cmd:v.list_cmd}},generateTitleMap=function(modelScope){return generator.get_list(modelScope).then(function(res){return formitem.titleMap=[],angular.forEach(res.objects,function(item){item!==-1?formitem.titleMap.push({value:item.key,name:item.value}):formitem.focusToInput=!0}),formitem.titleMap})};formitem={type:"template",templateUrl:"shared/templates/foreignKey.html",formName:k,title:v.title,wf:v.wf,add_cmd:v.add_cmd,name:k,key:k,model_name:v.model_name,selected_item:{},titleMap:[],onSelect:function(item,inputname){scope.model[k]=item.value,$timeout(function(){document.querySelector("input[name="+inputname+"]").value=item.name})},onDropdownSelect:function(item,inputname){scope.model[k]=item.value,$timeout(function(){document.querySelector("input[name="+inputname+"]").value=item.name})},getTitleMap:function(viewValue){return modelScope.form_params.query=viewValue,generateTitleMap(modelScope)},getDropdownTitleMap:function(){delete modelScope.form_params.query,formitem.gettingTitleMap=!0,generateTitleMap(modelScope).then(function(data){formitem.titleMap=data,formitem.gettingTitleMap=!1})}},scope.form[scope.form.indexOf(k)]=formitem,scope.model[k]&&generator.get_list({url:"crud",form_params:{wf:v.wf,model:v.model_name,object_id:scope.model[k],cmd:"object_name"}}).then(function(data){try{$timeout(function(){document.querySelector("input[name="+k+"]").value=data.object_name},200)}catch(e){document.querySelector("input[name="+k+"]").value=data.object_name,$log.debug("exception",e)}})}},Node:{default:_node_default,filter_interface:_node_filter_interface},ListNode:{default:_node_default,filter_interface:_node_filter_interface}};angular.forEach(scope.schema.properties,function(v,k){if("form_params"in scope&&k==scope.form_params.param)return scope.model[k]=scope.form_params.id,void scope.form.splice(scope.form.indexOf(k),1);try{generate_fields[v.type][v.widget||"default"](scope,v,k)}catch(e){console.log(v.type)}}),$log.debug("scope at after prepareformitems",scope),generator.constraints(scope)},generator.dateformatter=function(formObject){var ndate=new Date(formObject);if(isNaN(ndate))return"";var newdatearray=Moment(ndate).format("DD.MM.YYYY");return $log.debug("date formatted: ",newdatearray),newdatearray},generator.doItemAction=function($scope,key,todo,mode){$scope.form_params.cmd=todo.cmd,$scope.form_params.wf=$scope.wf,todo.wf&&($scope.url=todo.wf,$scope.form_params.wf=todo.wf,delete $scope.token,delete $scope.form_params.model,delete $scope.form_params.cmd),todo.object_key?$scope.form_params[todo.object_key]=key:$scope.form_params.object_id=key,$scope.form_params.param=$scope.param,$scope.form_params.id=$scope.param_id,$scope.form_params.token=$scope.token;var _do={normal:function(){return $log.debug("normal mode starts"),generator.get_wf($scope)},modal:function(){$log.debug("modal mode starts");var modalInstance=$uibModal.open({animation:!0,backdrop:"static",keyboard:!1,templateUrl:"shared/templates/confirmModalContent.html",controller:"ModalController",size:"",resolve:{items:function(){var newscope={form:{buttons:[{text:"Evet",style:"btn-success",cmd:"confirm"},{text:"Hayir",style:"btn-warning",dismiss:!0}],title:todo.name,confirm_message:"Islemi onayliyor musunuz?",onClick:function(cmd){if(modalInstance.close(),"confirm"===cmd&&angular.isDefined(cmd))return modalInstance.close(),generator.get_wf($scope)}}};return newscope}}})},new:function(){$log.debug("new mode is not not ready")}};return _do[mode]()},generator.button_switch=function(position){var buttons=angular.element(document.querySelectorAll("button")),positions={true:"enabled",false:"disabled"};angular.forEach(buttons,function(button,key){button[positions[position]]=!0}),$log.debug("buttons >> ",positions[position])},generator.get_form=function(scope){return $rootScope.websocketIsOpen===!0?WSOps.request(scope.form_params).then(function(data){return generator.generate(scope,data)}):void $timeout(function(){generator.get_form(scope)},500)},generator.get_list=function(scope){return $rootScope.websocketIsOpen===!0?WSOps.request(scope.form_params).then(function(data){return data}):void $timeout(function(){generator.get_list(scope)},500)},generator.get_wf=function(scope){$rootScope.websocketIsOpen===!0?WSOps.request(scope.form_params).then(function(data){return generator.pathDecider(data.client_cmd||["list"],scope,data)}):$timeout(function(){generator.get_wf(scope)},500)},generator.pageData={},generator.getPageData=function(){return generator.pageData},generator.setPageData=function(value){generator.pageData=value},generator.pathDecider=function(client_cmd,$scope,data){function redirectTo(scope,page){var pathUrl="/"+scope.form_params.wf;return pathUrl+=scope.form_params.model?"/"+scope.form_params.model+"/do/"+page:"/do/"+page,$location.path()===pathUrl?$route.reload():void $location.path(pathUrl)}function dispatchClientCmd(){data[$scope.form_params.param]=$scope.form_params.id,data.model=$scope.form_params.model,data.wf=$scope.form_params.wf,data.param=$scope.form_params.param,data.param_id=$scope.form_params.id,data.pageData=!0,generator.setPageData(data),redirectTo($scope,client_cmd[0])}dispatchClientCmd()},generator.get_diff=function(oldObj,newObj){var result={};return angular.forEach(newObj,function(value,key){oldObj[key]?oldObj[key].constructor!==newObj[key].constructor||newObj[key].constructor!==Object&&newObj[key].constructor!==Array?oldObj[key]!=newObj[key]&&(result[key]=angular.copy(newObj[key])):angular.forEach(value,function(v,k){oldObj[key][k]!=value[k]&&(result[key][k]=angular.copy(value[k]))}):result[key]=angular.copy(newObj[key])}),result},generator.get_diff_array=function(array1,array2,way){var result=[];return angular.forEach(array1,function(value,key){1===way?angular.toJson(array2).indexOf(value.value)<0&&result.push(value):angular.toJson(array2).indexOf(angular.toJson(value))<0&&result.push(value)}),result},generator.item_from_array=function(item,array){var result=item;return angular.forEach(array,function(value,key){value.value===item&&(result=value.name)}),result},generator.submit=function($scope,redirectTo,dontProcessReply){angular.forEach($scope.ListNode,function(value,key){$scope.model[key]=value.model}),angular.forEach($scope.Node,function(value,key){$scope.model[key]=value.model});var send_data={form:$scope.model,object_key:$scope.object_key,token:$scope.token,model:$scope.form_params.model,wf:$scope.form_params.wf,cmd:$scope.form_params.cmd,flow:$scope.form_params.flow,object_id:$scope.object_id,filter:$scope.filter,query:$scope.form_params.query};return $rootScope.websocketIsOpen===!0?WSOps.request(send_data).then(function(data){return dontProcessReply?data:generator.pathDecider(data.client_cmd||["list"],$scope,data)}):void $timeout(function(){generator.scope($scope,redirectTo)},500)},generator}).controller("ModalController",function($scope,$uibModalInstance,Generator,items,$timeout,Utils){angular.forEach(items,function(value,key){$scope[key]=items[key]}),$scope.$on("disposeModal",function(){$scope.cancel()}),$scope.$on("modalFormLocator",function(event){$timeout(function(){Utils.iterate($scope.model,function(modelValue,k){if(!angular.isUndefined($scope.edit)){var unicode=$scope.items[$scope.edit][k].unicode;unicode&&(document.querySelector("input[name="+k+"]").value=unicode)}})}),$scope.linkedModelForm=event.targetScope.linkedModelForm}),$scope.$on("submitModalForm",function(){$scope.onSubmit($scope.linkedModelForm)}),$scope.$on("validateModalDate",function(event,field){$scope.$broadcast("schemaForm.error."+field,"tv4-302",!0)}),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid&&$uibModalInstance.close($scope)},$scope.onNodeSubmit=function(){$scope.$broadcast("schemaFormValidate"),$scope.modalForm.$valid&&$uibModalInstance.close($scope)},$scope.cancel=function(){$uibModalInstance.dismiss("cancel")}}).directive("modalForNodes",function($uibModal,Generator,Utils){return{link:function(scope,element,attributes){element.on("click",function(){var modalInstance=$uibModal.open({animation:!0,backdrop:"static",keyboard:!1,templateUrl:"shared/templates/listnodeModalContent.html",controller:"ModalController",size:"lg",resolve:{items:function(){var attribs=attributes.modalForNodes.split(","),node=angular.copy(scope.$parent[attribs[1]][attribs[0]]);"add"===attribs[2]&&(node.model={}),attribs[3]&&(node.model=node.model[attribs[3]]),node.edit=attribs[3],scope.node.schema.wf=scope.node.url,angular.forEach(scope.node.schema.properties,function(value,key){angular.isDefined(scope.node.schema.properties[key].wf)||(scope.node.schema.properties[key].wf=scope.node.url),scope.node.schema.properties[key].list_cmd="select_list"});var newscope={wf:scope.node.wf,url:scope.node.url,form_params:{model:scope.node.schema.model_name},edit:attribs[3]};return Generator.generate(newscope,{forms:scope.node}),newscope.model=newscope.model[node.edit]||{},newscope}}});modalInstance.result.then(function(childmodel,key){var listNodeItem=scope.$parent[childmodel.schema.formType][childmodel.schema.model_name];if("Node"===childmodel.schema.formType&&(listNodeItem.model=angular.copy(childmodel.model),listNodeItem.lengthModels+=1),"ListNode"===childmodel.schema.formType){var reformattedModel={};angular.forEach(childmodel.model,function(value,key){key.indexOf("_id")>-1?(angular.isObject(value)&&value.value&&(value=value.value,childmodel.model[key]=value),angular.forEach(childmodel.form,function(v,k){if(v.formName===key){var unicodeValue=v.titleMap.find(function(element,index,array){if(element.value===value)return element});unicodeValue&&(unicodeValue=unicodeValue.name,reformattedModel[key]={key:value,unicode:unicodeValue})}})):reformattedModel[key]={key:key,unicode:Generator.item_from_array(value,childmodel.schema.properties[key].titleMap)}}),childmodel.edit?(listNodeItem.model[childmodel.edit]=childmodel.model,Object.keys(reformattedModel).length>0?listNodeItem.items[childmodel.edit]=reformattedModel:listNodeItem.items[childmodel.edit]=angular.copy(childmodel.model)):(listNodeItem.model.push(angular.copy(childmodel.model)),Object.keys(reformattedModel).length>0?listNodeItem.items.push(reformattedModel):listNodeItem.items.push(angular.copy(childmodel.model))),listNodeItem.lengthModels+=1}})})}}}).directive("addModalForLinkedModel",function($uibModal,$rootScope,$route,Generator){return{link:function(scope,element,attributes){element.on("click",function(){var modalInstance=$uibModal.open({animation:!0,backdrop:"static",keyboard:!1,templateUrl:"shared/templates/linkedModelModalContent.html",controller:"ModalController",size:"lg",resolve:{items:function(){var formName=attributes.addModalForLinkedModel;return Generator.get_form({form_params:{wf:scope.form.wf,model:scope.form.model_name,cmd:scope.form.add_cmd},modalElements:{buttonPositions:{bottom:"move-to-bottom-modal",top:"move-to-top-modal",none:""},workOnForm:"linkedModelForm",workOnDiv:"-modal"+formName},submitModalForm:function(){$rootScope.$broadcast("submitModalForm")},validateModalDate:function(field){$rootScope.$broadcast("validateModalDate",field)},formName:formName})}}});modalInstance.result.then(function(childscope,key){var formName=childscope.formName;Generator.submit(childscope,!1,!0).then(function(data){var item={value:data.forms.model.object_key,name:data.forms.model.unicode};scope.form.titleMap.push(item),scope.form.onSelect(item,formName)})})})}}}).directive("modalFormLocator",function(){return{link:function(scope){scope.$emit("modalFormLocator")}}}),angular.module("ulakbus").factory("FormConstraints",function($q,$log,$timeout){var cond=function(condition){return!condition},cond_generator=function(){return{lt:function(a,b){return!(a<b)},gt:function(a,b){return!(a>b)}}},cond_multiple=function(val1,val2,condition){var valid=!0;return angular.forEach(val2,function(value,key){inputval=angular.element(document.querySelector("#"+value)).val(),cond_generator()[condition](val1,inputval)&&(valid=!1)}),valid},fo_co={};return fo_co.lt=function(value,ref_val,input_name){return cond(value>ref_val)},fo_co.lt_date=function(value,ref_val,input_name){return cond(value>ref_val)},fo_co.ltm=function(value,ref_vals,input_name){return cond_multiple(value,ref_vals,"lt")},fo_co.gt=function(value,ref_val,input_name){return cond(value<ref_val)},fo_co.gt_date=function(value,ref_val,input_name){return cond(value<ref_val)},fo_co.gtm=function(value,ref_vals,input_name){return cond_multiple(value,ref_vals,"gt")},fo_co.selectbox_fields=function(value,fields,input_name){var form_items=angular.element(document.querySelectorAll("bootstrap-decorator"));angular.forEach(form_items,function(v,k){angular.element(v).removeClass("hide");var checkpoint;try{checkpoint=angular.isDefined(v.querySelector("input"))&&null!==v.querySelector("input")?v.querySelector("input").name:v.querySelector("select").name,checkpoint!==input_name[0]&&checkpoint!==fields[value][0]&&(angular.element(v).addClass("hide"),$log.debug(checkpoint,fields[value],angular.isDefined(fields[checkpoint])))}catch(e){$log.error(e.message)}})},fo_co}),angular.module("ulakbus").factory("ErrorService",function(toastr,$rootScope,$location,$log){
var error_service={};return error_service.handle=function(rejection,prtcl){var errorInModal;"http"===prtcl&&(errorInModal=!!rejection.data&&"error"in rejection.data),"ws"===prtcl&&(rejection.status=rejection.status||rejection.code,rejection.data={error:rejection.error,title:rejection.title},errorInModal=!0);var errorModal=function(){if(0===$rootScope.loginAttempt&&"http"===prtcl)return void $log.debug("not logged in, no alert message triggered");var codefield="";if(rejection.data.error&&(codefield="<p><pre>"+rejection.data.error+"</pre></p>"),$('<div class="modal"><div class="modal-dialog" style="width:100%;" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" id="exampleModalLabel">Error Status: '+rejection.status+"<br>Error Title: "+rejection.data.title+'</h4></div><div class="modal-body"><div class="alert alert-danger"><strong>'+rejection.data.description+"</strong>"+codefield+'</div></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Kapat</button></div></div></div></div>').modal(),!rejection.no_highlight)try{$("pre:not(.hljs)").each(function(i,block){hljs.highlightBlock(block)})}catch(e){$log.debug("Exception: ",e.message)}},errorInAlertBox=function(alertContent){errorInModal?errorModal():$rootScope.loginAttempt>0&&toastr.error(alertContent.msg,alertContent.title)},errorForAlertBox={title:rejection.status,msg:rejection.data?rejection.data.description:"Error",type:"error"},errorDispatch={"-1":function(){$log.error("-1 returned:",rejection)},400:function(){$location.reload()},401:function(){return"/login"!==$location.path()?window.location.reload():void $log.debug("show errors on login form")},403:function(){rejection.data.is_login===!0&&($rootScope.loggedInUser=!0,"/login"===$location.path()&&$location.path("/dashboard"))},404:function(){errorInAlertBox(errorForAlertBox)},500:function(){errorInAlertBox(errorForAlertBox)},503:function(){rejection.data={description:"Servise erişilemiyor."},errorInAlertBox(errorForAlertBox)}};errorDispatch[rejection.status||rejection.code]()},error_service}),angular.module("ulakbus").controller("KeyListenController",function($scope,action_service){$scope.keylog=[0,1],$scope.down=function(e){angular.forEach(action_service.combinations,function(value,key){action_service.equal(value,$scope.keylog.concat([e.keyCode]))&&action_service.acts[key]()}),$scope.keylog.shift(),$scope.keylog.push(e.keyCode)},$scope.$on("user_ready",function(){$scope.user_ready=!0}),$scope.user_ready=!1}).factory("action_service",function($uibModal,$log){var actions={};return actions.equal=function(a,b){return!(a<b||b<a)},actions.combinations={open_inspector:[91,16,75]},actions.acts={open_inspector:function(){var modalInstance=$uibModal.open({animation:!0,templateUrl:"shared/templates/actionsModalContent.html",controller:"ActionsModalController",resolve:{items:function(){return document.querySelectorAll(".navbar-collapse a, #side-user-menu a, .dropdown-menu li a")}}});modalInstance.result.then(function(selectedItem){$log.info("resirect to:",selectedItem),location.hash=selectedItem.value})}},actions}).controller("ActionsModalController",function($scope,$uibModalInstance,items){$scope.actions=[],angular.forEach(items,function(value,key){value.children[1]||$scope.actions.push({name:value.innerHTML,value:value.hash})}),$scope.doThis=function(item){$uibModalInstance.close(item)},$scope.cancel=function(){$uibModalInstance.dismiss("cancel")}}),angular.module("ulakbus").service("WSUri",function(RESTURL){var base=RESTURL.url.replace("http","ws");return{url:base+"ws"}}).factory("WSOps",function(WSUri,$q,$log,$rootScope,$timeout,$document,ErrorService,WS,IsOnline,DevSettings){$rootScope.$on("ws_turn_on",function(){generate_ws()});var websocket,refresh_count=0,refresh_websocket=refresh_count<5?1e3:5e3,isSupported=function(){return"WebSocket"in window},generate_ws=function(){if(isSupported())$log.info("Openning web socket..."),websocket=new WS(WSUri.url),websocket.onopen=function(evt){wsOps.onOpen(evt),refresh_count=0},websocket.onclose=function(evt){wsOps.onClose(evt),wsOps.loggedOut!==!0&&$timeout(function(){generate_ws(),refresh_count+=1},refresh_websocket)},websocket.onmessage=function(evt){wsOps.onMessage(evt)},websocket.onerror=function(evt){wsOps.onError(evt)};else{var error={error:"Tarayıcınız websocket desteklememektedir. Lütfen güncel bir tarayıcı kullanınız.",code:500,title:"Uyumsuz Tarayıcı",no_highlight:!0};ErrorService.handle(error,"ws")}},wsOps={},pingCounter=0,checkPing=function(){pingCounter>2&&(websocket.close(),$log.debug("websocket not pong"),pingCounter=0)},keepAlivePing=function(interval){return setInterval(function(){$rootScope.websocketIsOpen&&IsOnline.get_status()&&"on"===DevSettings.settings.keepAlive&&(wsOps.doSend(angular.toJson({data:{view:"ping"}})),pingCounter+=1,checkPing())},interval)};wsOps.onOpen=function(evt){$rootScope.websocketIsOpen=!0,$log.info("CONNECTED",evt),keepAlivePing(2e4),wsOps.loggedOut=!1},wsOps.onClose=function(event){$rootScope.websocketIsOpen=!1,$log.info("DISCONNECTED",event)},wsOps.callbacks={},wsOps.onMessage=function(event){var msg_methods={init:function(data){if(angular.isDefined(wsOps.callbacks[data.callbackID])){var callback=wsOps.callbacks[data.callbackID];delete wsOps.callbacks[data.callbackID],callback.resolve(data)}else"pong"!=data.msg&&$log.info("Data without callback: %o",data),"pong"===msg_data.msg&&(pingCounter-=1)},error:function(){return ErrorService.handle(msg_data,"ws")},message:function(){var type={1:"notifications",11:"notifications",111:"notifications",2:"message",3:"message",4:"message"};$timeout(function(){$rootScope.$broadcast(type[msg_data.type],msg_data)})},dashboard:function(){var callback=wsOps.callbacks[msg_data.callbackID];delete wsOps.callbacks[msg_data.callbackID],callback.resolve(msg_data)},task_list:function(){$rootScope.$broadcast("task_list",msg_data.task_list)},channel_subscription:function(){$timeout(function(){$rootScope.$broadcast("channel_change","add",msg_data)})},user_status:function(){$timeout(function(){$rootScope.$broadcast("channel_change","status",msg_data)})}},do_action=function(options){var args=[].slice.call(arguments,0),action="init";return"function"==typeof msg_methods[args[1]]&&(action=args[1],args.shift()),msg_methods[action](args[0])},msg_data=angular.fromJson(event.data);msg_data.error&&(msg_data.cmd="error"),do_action(msg_data,msg_data.cmd),"pong"!=msg_data.msg&&$log.info("MESSAGE:",event,"Data:",angular.copy(msg_data))},wsOps.onError=function(evt){$log.error("ERROR :: "+evt)},wsOps.doSend=function(data){websocket.send(data),$log.info("SENT:",data)},wsOps.request=function(data){if($rootScope.websocketIsOpen){var request={callbackID:Math.random().toString(36).substring(7),data:data},deferred=$q.defer();return wsOps.callbacks[request.callbackID]=deferred,websocket.send(angular.toJson(request)),$log.info("SENT:",data),deferred.promise.then(function(response){return request.response=response,response})}$timeout(function(){wsOps.request(data)},1e3)},wsOps.close=function(){wsOps.loggedOut=!0,websocket.close(),$log.info("CLOSED")};var mask=angular.element('<div class="body-mask"><div class="loader"></div></div>');mask.css({zIndex:"2010",opacity:"0.6"});$document.find("body").eq(0);return wsOps}),angular.module("ulakbus").service("Utils",function(){function hasEqualProperties(obj1,obj2){var result=!0;for(var prop in obj2)obj2.hasOwnProperty(prop)&&(result=result&&obj2[prop]==obj1[prop]);return result}this.groupBy=function(list,propName,initialObject){return initialObject||(initialObject={}),list.reduce(function(acc,item){return(acc[item[propName]]=acc[item[propName]]||[]).push(item),acc},initialObject)},this.deleteWhere=function(list,condition){for(var i=0;i<list.length;i++)if(hasEqualProperties(list[i],condition))return list.splice(i,1),list[i]},this.findWhere=function(list,condition){for(var i=0;i<list.length;i++)if(hasEqualProperties(list[i],condition))return list[i]},this.iterate=function(collection,callback){angular.forEach(collection,function(val,key){key.indexOf&&0==key.indexOf("$$")||callback(val,key)})}}).filter("formatJson",function(){return function(val){try{return JSON.stringify(val,null,4)}catch(e){return val}}}),angular.module("ulakbus").directive("logout",function($http,$location,RESTURL,AuthService){return{link:function($scope,$element,$rootScope){$element.on("click",function(){AuthService.logout()})}}}).directive("headerNotification",function($rootScope,$uibModal,MessagingService){return{templateUrl:"shared/templates/directives/header-notification.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$log){$scope.count=MessagingService.get_unread_counters(),$scope.showMessagesWindow=function(type){return"notifications"==type?MessagingService.get_notifications_channel_key().then(function(channelKey){return MessagingService.show_messaging_window(channelKey)}):void MessagingService.show_messaging_window()}}}}).directive("searchDirective",function(Generator,$log,$rootScope){return{templateUrl:"shared/templates/directives/search.html",restrict:"E",replace:!0,link:function($scope){$scope.searchForm=[{key:"searchbox",htmlClass:"pull-left"},{type:"submit",title:"Ara",style:"btn-info",htmlClass:"pull-left"}],$scope.searchSchema={type:"object",properties:{searchbox:{type:"string",minLength:2,title:"Ara","x-schema-form":{placeholder:"Arama kriteri giriniz..."}}},required:[]},$scope.searchModel={searchbox:""},$scope.searchSubmit=function(form){if($scope.$broadcast("schemaFormValidate"),form.$valid){var searchparams={token:$scope.$parent.token,object_id:$scope.$parent.object_id,form_params:{wf:$scope.$parent.wf,model:$scope.$parent.form_params.model,cmd:$scope.$parent.reload_cmd,flow:$scope.$parent.form_params.flow,query:$scope.searchModel.searchbox}};Generator.submit(searchparams)}}}}}).directive("sortDirective",function(Generator,$log){return{templateUrl:"shared/templates/directives/sort.html",restrict:"E",replace:!0,link:function($scope){$scope.titleMap=[{value:"artan",name:"Artan"},{value:"azalan",name:"Azalan"}],$scope.sortForm=[{key:"sortbox",htmlClass:"pull-left",type:"select",titleMap:$scope.titleMap},{type:"submit",title:"Sırala",htmlClass:"pull-left"}],$scope.sortSchema={type:"object",properties:{sortbox:{type:"select",title:"Sırala"}},required:["sortbox"]},$scope.sortModel={sortbox:""},$scope.sortSubmit=function(form){if($scope.$broadcast("schemaFormValidate"),form.$valid){var sortparams={url:$scope.wf,token:$scope.$parent.token,object_id:$scope.$parent.object_id,form_params:{model:$scope.$parent.form_params.model,cmd:$scope.$parent.reload_cmd,flow:$scope.$parent.form_params.flow,param:"sort",id:$scope.sortModel.sortbox}};Generator.submit(sortparams)}}}}}).directive("collapseMenu",function($timeout,$window,$cookies){return{templateUrl:"shared/templates/directives/menuCollapse.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope){$rootScope.collapsed=!1,$rootScope.sidebarPinned=$cookies.get("sidebarPinned")||1,$scope.collapseToggle=function(){$window.innerWidth>"768"&&($rootScope.collapsed===!1?(jQuery(".sidebar").css("width","62px"),jQuery(".manager-view").css("width","calc(100% - 62px)"),$rootScope.collapsed=!0,$rootScope.sidebarPinned=0,$cookies.put("sidebarPinned",0)):(jQuery("span.menu-text, span.arrow, .sidebar footer").fadeIn(400),jQuery(".sidebar").css("width","250px"),jQuery(".manager-view").css("width","calc(100% - 250px)"),$rootScope.collapsed=!1,$rootScope.sidebarPinned=1,$cookies.put("sidebarPinned",1)))},$timeout(function(){"0"===$cookies.get("sidebarPinned")&&$scope.collapseToggle()})}}}).directive("headerSubMenu",function($location){return{templateUrl:"shared/templates/directives/header-sub-menu.html",restrict:"E",replace:!0,link:function($scope){$scope.style="width:calc(100% - 300px);",$scope.$on("$routeChangeStart",function(){$scope.style="/dashboard"===$location.path()?"width:calc(100% - 300px);":"width:%100 !important;"})}}}).directive("headerBreadcrumb",function($location){return{templateUrl:"shared/templates/directives/header-breadcrumb.html",restrict:"E",replace:!1,link:function($scope){$scope.goBack=function(){$location.state()}}}}).directive("sidebar",["$location",function(){return{templateUrl:"shared/templates/directives/sidebar.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope,$cookies,$route,AuthService,WSOps,RESTURL,$log,$location,$window,$timeout){$scope.prepareMenu=function(menuItems){var newMenuItems={};return angular.forEach(menuItems,function(value,key){angular.forEach(value,function(v,k){newMenuItems[k]=v})}),newMenuItems};var generate_dashboard=function(){if($rootScope.current_user===!0)if($rootScope.websocketIsOpen){var sidebarmenu=$("#side-menu");sidebarmenu.metisMenu(),WSOps.request({view:"dashboard"}).then(function(data){function reGroupMenuItems(items,baseCategory){var newItems={};return angular.forEach(items,function(value,key){newItems[value.kategori]=newItems[value.kategori]||[],newItems[value.kategori].push(value)}),newItems}$scope.allMenuItems=angular.copy(data),angular.forEach($scope.allMenuItems,function(value,key){"current_user"!==key&&"settings"!==key&&($scope.allMenuItems[key]=reGroupMenuItems(value,key))}),$rootScope.quick_menu=reGroupMenuItems(data.quick_menu,"quick_menus"),$rootScope.quick_menu=data.quick_menu,delete data.quick_menu,$log.debug("quick menu",$rootScope.quick_menu),$rootScope.$broadcast("authz",data),$rootScope.searchInputs=data,data.current_user,$rootScope.current_user=data.current_user,(data.ogrenci||data.personel)&&($rootScope.current_user.can_search=!0),$rootScope.settings=data.settings,$scope.menuItems=$scope.prepareMenu({other:$scope.allMenuItems.other}),$timeout(function(){sidebarmenu.metisMenu()})})}else $timeout(function(){generate_dashboard()},500)};$scope.$on("generate_dashboard",function(){generate_dashboard()}),$scope.$on("menuitems",function(event,data){var menu={};menu[data]=$scope.allMenuItems[data],$rootScope.$broadcast("usermenuitems",$scope.prepareMenu(menu))}),$scope.$on("selectedUser",function($event,data){$scope.selectedUser=data}),$scope.deselectUser=function(){delete $scope.selectedUser,delete $scope.selectedMenuItems},$rootScope.$watch(function($rootScope){return $rootScope.section},function(newindex,oldindex){newindex>-1&&($scope.menuItems=[$scope.allMenuItems[newindex]],$scope.collapseVar=0)}),$scope.selectedMenu=$location.path(),$scope.collapseVar=0,$scope.multiCollapseVar=0,$scope.check=function(x){x===$scope.collapseVar?$scope.collapseVar=0:$scope.collapseVar=x},$scope.breadcrumb=function(itemlist,$event){$rootScope.breadcrumblinks=itemlist},$scope.multiCheck=function(y){y===$scope.multiCollapseVar?$scope.multiCollapseVar=0:$scope.multiCollapseVar=y}}}}]).directive("rightSidebar",["$location",function(){return{templateUrl:"shared/templates/directives/right-sidebar.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope,$cookies,$route,$http,RESTURL,$log,$location,$window,$timeout){var sidebarUserMenu=$("#side-user-menu");sidebarUserMenu.metisMenu(),$scope.$on("usermenuitems",function(event,data){$scope.selectedMenuItems=data,$timeout(function(){sidebarUserMenu.metisMenu()}),jQuery(".right-sidebar").css("width","300px"),jQuery(".manager-view-inner").css("width","calc(100% - 300px)")}),$scope.$on("selectedUser",function($event,data){$scope.selectedUser=data}),$scope.deselectUser=function(){jQuery(".right-sidebar").css("width","0px"),jQuery(".manager-view-inner").css("width",""),delete $scope.selectedUser,delete $scope.selectedMenuItems},$rootScope.$watch(function($rootScope){return $rootScope.section},function(newindex,oldindex){newindex>-1&&($scope.menuItems=[$scope.allMenuItems[newindex]],$scope.collapseVar=0)}),$scope.selectedMenu=$location.path(),$scope.collapseVar=0,$scope.multiCollapseVar=0,$scope.check=function(x){x===$scope.collapseVar?$scope.collapseVar=0:$scope.collapseVar=x},$scope.multiCheck=function(y){y===$scope.multiCollapseVar?$scope.multiCollapseVar=0:$scope.multiCollapseVar=y}}}}]).directive("stats",function(){return{templateUrl:"shared/templates/directives/stats.html",restrict:"E",replace:!0,scope:{model:"=",comments:"@",number:"@",name:"@",colour:"@",details:"@",type:"@",goto:"@"}}}).directive("notifications",function(){return{templateUrl:"shared/templates/directives/notifications.html",restrict:"E",replace:!0}}).directive("msgbox",function(){return{templateUrl:"shared/templates/directives/msgbox.html",restrict:"E",replace:!1}}).directive("alertBox",function($timeout){return{templateUrl:"shared/templates/directives/alert.html",restrict:"E",replace:!0,link:function($scope){$scope.$on("alertBox",function($event,data){$timeout(function(){delete $scope.alerts},5e3),$scope.alerts=[data]})}}}).directive("sidebarSearch",function(){return{templateUrl:"shared/templates/directives/sidebar-search.html",restrict:"E",replace:!0,scope:{},controller:function($scope){$scope.selectedMenu="home"}}}).directive("fileread",function($timeout){return{scope:{fileread:"="},link:function(scope,element,attributes){element.bind("change",function(changeEvent){var reader=new FileReader;reader.onload=function(loadEvent){scope.$apply(function(){scope.fileread=loadEvent.target.result}),$timeout(function(){scope.$parent.model[changeEvent.target.name]={file_name:changeEvent.target.files[0].name,file_content:scope.$parent.model[changeEvent.target.name]},document.querySelector("#image-preview").src=URL.createObjectURL(changeEvent.target.files[0])})},reader.readAsDataURL(changeEvent.target.files[0])})}}}).directive("timetableActionSelector",function($timeout){return $("html").on("click",function(e){var target=$(e.target);return target.parents().is(".action-selector")?void target.parents(".action-selector").children(".popover").toggleClass("ng-hide"):target.hasClass("action-selector")?void target.children(".popover").toggleClass("ng-hide"):void $(".course-prg-scheduler .action-selector>.popover").toggleClass("ng-hide",!0)}),{templateUrl:"shared/templates/directives/timetable-action-selector.html",scope:{externalModel:"=ngModel",onChange:"&ngChange"},link:function(iScope,iElem,iAttrs){var valueToClassMap={1:"action-indicator_appropriate",2:"action-indicator_uncertain",3:"action-indicator_busy"};iAttrs.hasOwnProperty("readonly")&&iAttrs.$observe("readonly",function(v){v&&"false"==v&&(v=!1),iScope.readonly=v}),iScope.$watch("externalModel",function(value){iScope.value=valueToClassMap[value]}),iScope.setModelValue=function(value){var oldValue=iScope.externalModel;iScope.externalModel=value,$timeout(function(){iScope.onChange&&value!=oldValue&&iScope.onChange()})}}}}).directive("onEnterPressed",function(){return{link:function(scope,element,attrs){element.bind("keydown keypress",function(event){13!==event.which||event.ctrlKey||(scope.$apply(function(){scope.$eval(attrs.onEnterPressed)}),event.preventDefault())}),scope.$on("$destroy",function(){element.unbind("keydown keypress")})}}}).directive("onEscPressed",function(){return{link:function(scope,element,attrs){element.bind("keydown keypress",function(event){27===event.which&&(scope.$apply(function(){scope.$eval(attrs.onEscPressed)}),event.preventDefault())}),scope.$on("$destroy",function(){element.unbind("keydown keypress")})}}}),angular.module("ulakbus.auth",["ngRoute","ngCookies"]).controller("LoginController",function($scope,$q,$timeout,$location,$routeParams,$rootScope,$log,WSOps,Generator,AuthService){$scope.url="login",$scope.form_params={},$scope.form_params.clear_wf=1;try{WSOps.close()}catch(e){$log.error(e.message)}AuthService.get_form($scope).then(function(data){data.login&&$location.path("/"),$scope.form=[{key:"username",type:"string",title:"Kullanıcı Adı"},{key:"password",type:"password",title:"Şifre"},{type:"submit",title:"Giriş Yap"}]}),$scope.loggingIn=!1,$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid?($scope.loggingIn=!0,$rootScope.loginAttempt=1,Generator.button_switch(!1),AuthService.login($scope.url,$scope.model).success(function(data){$scope.message=data.title,$scope.loggingIn=!1}).error(function(data){$scope.message=data.title,$scope.loggingIn=!1}).then(function(){$scope.loggingIn=!1,Generator.button_switch(!0)})):$log.debug("not valid")},$log.debug("login attempt: ",$rootScope.loginAttempt)}),angular.module("ulakbus.auth").factory("AuthService",function($http,$rootScope,$location,$log,$route,Generator,RESTURL,WSOps){var authService={};return authService.get_form=function(scope){return $http.post(Generator.makeUrl(scope),scope.form_params).success(function(data,status,headers,config){return"upgrade"===data.cmd?($rootScope.loggedInUser=!0,$rootScope.$broadcast("user_ready"),$rootScope.$broadcast("ws_turn_on"),$location.path("/dashboard")):"retry"!==data.cmd?(angular.isDefined(data.forms)&&"/login"!==$location.path()&&$location.path("/login"),Generator.generate(scope,data)):void $location.path("/login")})},authService.login=function(url,credentials){return credentials.cmd="do",$http.post(RESTURL.url+url,credentials).success(function(data,status,headers,config){if(Generator.button_switch(!0),"upgrade"===data.cmd&&($rootScope.loggedInUser=!0,$rootScope.$broadcast("user_ready"),$rootScope.$broadcast("ws_turn_on"),$location.path("/dashboard")),403===data.status_code)return data.title="İşlem başarısız oldu. Lütfen girdiğiniz bilgileri kontrol ediniz.",data}).error(function(data,status,headers,config){return data.title="İşlem başarısız oldu. Lütfen girdiğiniz bilgileri kontrol ediniz.",data})},authService.logout=function(){$rootScope.loginAttempt=0,WSOps.request({wf:"logout"}).then(function(data){$rootScope.loggedInUser=!1,$rootScope.current_user=!0,$log.debug("loggedout"),$location.path("/login"),WSOps.close()})},authService.check_auth=function(){var post_data={url:"login",form_params:{}};return authService.get_form(post_data)},authService}),angular.module("ulakbus.dashboard",[]).config(function($uibTooltipProvider){$uibTooltipProvider.setTriggers({click:"mouseleave"})}).controller("DashController",function($scope,$rootScope,$routeParams,$route,$timeout,$http,$cookies,RESTURL,Generator,WSOps){$rootScope.$broadcast("generate_dashboard"),$scope.section=function(section_index){$rootScope.section=section_index},$scope.$on("authz",function(event,data){$rootScope.searchInputs=data}),$scope.keyword={student:"",staff:""},$scope.students=[],$scope.staffs=[],$scope.search=function(where){($scope.keyword.staff.length>2||$scope.keyword.student.length>2)&&$timeout(function(){"personel"===where&&$scope.getItems(where,$scope.keyword.staff).then(function(data){$scope.staffs=data.results}),"ogrenci"===where&&$scope.getItems(where,$scope.keyword.student).then(function(data){$scope.students=data.results})},500)},$scope.getItems=function(where,what){return $scope.showResults=!0,WSOps.request({view:where+"_ara",query:what})},$scope.userPopover={templateUrl:"components/dashboard/user-info.html"},$scope.get_info=function(type,key){Generator.get_list({url:"crud",form_params:{wf:"crud",model:type,object_id:key,cmd:"show"}}).then(function(data){$scope.userPopover.name=data.object.Ad+" "+data.object.Soyad,$scope.userPopover.tcno=data.object["TC Kimlik No"],$scope.userPopover.image=data.object.Avatar||"img/sample-profile-pic.jpg"})},$scope.select=function(who,type){$rootScope.$broadcast("selectedUser",{name:who[0],tcno:who[1],key:who[2]}),$rootScope.$broadcast("menuitems",type),$scope.showResults=!1},$scope.$on("notifications",function(event,data){$scope.notifications=data}),$scope.$on("selectedUser",function($event,data){$scope.selectedUser=data}),$scope.deselectUser=function(){delete $scope.selectedUser,delete $scope.selectedMenuItems},$scope.markAsRead=function(items){$rootScope.$broadcast("markasread",items)}}),angular.module("ulakbus.crud",["schemaForm","ui.bootstrap","ulakbus.formService"]).config(function(sfErrorMessageProvider){sfErrorMessageProvider.setDefaultMessage(302,"Bu alan zorunludur."),sfErrorMessageProvider.setDefaultMessage(200,"En az {{schema.minLength}} değer giriniz."),sfErrorMessageProvider.setDefaultMessage(201,"En fazla {{schema.minLength}} değer giriniz.")}).service("CrudUtility",function($log,$rootScope){return{generateParam:function(scope,routeParams,cmd){return scope.url=routeParams.wf,angular.forEach(routeParams,function(value,key){key.indexOf("_id")>-1&&"param_id"!==key&&(scope.param=key,scope.param_id=value)}),scope.form_params={model:routeParams.model,param:scope.param||routeParams.param,id:scope.param_id||routeParams.param_id,wf:routeParams.wf,object_id:routeParams.key,filters:{},token:routeParams.token},scope.param_id&&(scope.form_params.filters[scope.param]={values:[scope.param_id],type:"check"}),scope.model=scope.form_params.model,scope.wf=scope.form_params.wf,scope.param=scope.form_params.param,scope.param_id=scope.form_params.id,scope},listPageItems:function(scope,pageData){angular.forEach(pageData,function(value,key){scope[key]=value}),scope.meta.selective_listing===!0?angular.forEach(scope.objects,function(_v,_k){angular.forEach(_v.objects,function(value,key){if(_v.selected===!0&&(scope.selected_key=_k),key>0){var linkIndexes={};angular.forEach(value.actions,function(v,k){"link"===v.show_as&&(linkIndexes=v)}),angular.forEach(value.fields,function(v,k){try{value.actions.length>0&&linkIndexes.fields?scope.objects[_k][key].fields[k]={type:linkIndexes.fields.indexOf(k)>-1?"link":"str",content:v,cmd:linkIndexes.cmd,mode:linkIndexes.mode}:scope.objects[_k].objects[key].fields[k]={type:"str",content:v}}catch(e){$log.error(e),scope.objects[_k].objects[key].fields[k]={type:"str",content:v}}})}})}):angular.forEach(scope.objects,function(value,key){if(key>0){var linkIndexes={};angular.forEach(value.actions,function(v,k){"link"===v.show_as&&(linkIndexes=v)}),angular.forEach(value.fields,function(v,k){value.actions.length>0&&linkIndexes.fields?scope.objects[key].fields[k]={type:linkIndexes.fields.indexOf(k)>-1?"link":"str",content:v,cmd:linkIndexes.cmd,mode:linkIndexes.mode}:scope.objects[key].fields[k]={type:"str",content:v}})}}),$log.debug(scope.objects)}}}).controller("CRUDController",function($scope,$routeParams,$location,Generator,CrudUtility){return $location.url().indexOf("?=")>0?$location.url($location.url().replace("?=","")):(CrudUtility.generateParam($scope,$routeParams),void Generator.get_wf($scope))}).controller("CRUDListFormController",function($scope,$rootScope,$location,$sce,$http,$log,$uibModal,$timeout,Generator,$routeParams,CrudUtility){$scope.show_crud=!1,$scope.$on("$viewContentLoaded",function(){$timeout(function(){$scope.show_crud=!0},500)}),$scope.wf_step=$routeParams.step,$scope.paginate=function(reloadData){$scope.form_params.cmd=$scope.reload_cmd,$scope.form_params=angular.extend($scope.form_params,reloadData),$log.debug("reload data",$scope),Generator.get_wf($scope)},$scope.$on("reload_cmd",function(event,data){$scope.reload_cmd=data,$scope.reloadCmd()}),$scope.$on("updateObjects",function($event,data){$scope.objects=data,CrudUtility.listPageItems($scope,{objects:$scope.objects})}),$scope.$on("formLocator",function(event){$scope.formgenerated=event.targetScope.formgenerated}),$scope.remove=function(item,type,index){$scope[type][item.title].model.splice(index,1),$scope[type][item.title].items.splice(index,1)},$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid&&Generator.submit($scope)},$scope.do_action=function(key,todo){Generator.doItemAction($scope,key,todo,todo.mode||"normal")},$scope.getNumber=function(num){return new Array(num)},$scope.markdownWorkaround=function(value){return value.replace("\n","<br>")},$scope.datepickerstatuses={},$scope.inline_datepicker_status=function(field){return $scope.datepickerstatuses[field]||!1},$scope.openDatepicker=function(field){$scope.datepickerstatuses[field]=!0},$scope.createListObjects=function(){$scope.object.constructor===Array?$log.debug("new type show object"):$scope.object.type?$scope.object=[$scope.object]:$scope.object=[{type:"table",fields:angular.copy($scope.object)}]},$scope.showCmd=function(){CrudUtility.generateParam($scope,$routeParams,$routeParams.cmd);var pageData=Generator.getPageData();pageData.pageData===!0?($scope.object=pageData.object,Generator.setPageData({pageData:!1})):Generator.get_wf($scope).then(function(res){$scope.object=res.data.object,$scope.model=$routeParams.model}),$scope.createListObjects()},$scope.update_selective_list=function(key){$scope.objects=key.objects},$scope.listFormCmd=function(){var setpageobjects=function(data){CrudUtility.listPageItems($scope,data),Generator.generate($scope,data),Generator.setPageData({pageData:!1})},pageData=Generator.getPageData();pageData.pageData===!0&&($log.debug("pagedata",pageData.pageData),CrudUtility.generateParam($scope,pageData,$routeParams.cmd),setpageobjects(pageData,pageData),$scope.second_client_cmd&&$scope.createListObjects()),void 0!==pageData.pageData&&pageData.pageData!==!1||(CrudUtility.generateParam($scope,$routeParams,$routeParams.cmd),Generator.get_wf($scope)),$scope.object&&$scope.createListObjects(),angular.isDefined($scope.meta.selective_listing)&&($scope.all_objects=angular.copy($scope.objects),$scope.selective_list_key=$scope.all_objects[$scope.selected_key],$scope.objects=$scope.selective_list_key.objects)},$scope.reloadCmd=function(){var pageData=Generator.getPageData();CrudUtility.generateParam($scope,pageData,$routeParams.cmd),$log.debug("reload data",$scope),Generator.get_wf($scope)},$scope.resetCmd=function(){var pageData=Generator.getPageData();CrudUtility.generateParam($scope,pageData,$routeParams.cmd),delete $scope.token,delete $scope.filters,delete $scope.cmd,Generator.get_wf($scope)};var executeCmd={show:$scope.showCmd,list:$scope.listFormCmd,form:$scope.listFormCmd,reload:$scope.reloadCmd,reset:$scope.resetCmd};return executeCmd[$routeParams.cmd]()}).directive("crudListDirective",function(){return{templateUrl:"components/crud/templates/list.html",restrict:"E",replace:!0}}).directive("crudFormDirective",function(){return{templateUrl:"components/crud/templates/form.html",restrict:"E",replace:!0}}).directive("crudShowDirective",function(){return{templateUrl:"components/crud/templates/show.html",restrict:"E",replace:!0}}).directive("formLocator",function(){return{link:function(scope){scope.$emit("formLocator")}}}).directive("crudFilters",function(Generator){return{templateUrl:"components/crud/templates/filter.html",restrict:"E",replace:!0,link:function($scope){$scope.form_params.filters=$scope.form_params.filters||{},$scope.form_params.token=$scope.token,$scope.filterList={},$scope.filterCollapsed={},$scope.$watch("list_filters",function(){angular.forEach($scope.list_filters,function(value,key){$scope.filterList[value.field]={values:value.values||[],type:value.type},$scope.filterCollapsed[value.field]=Object.keys($scope.filterCollapsed).length>0})}),$scope.collapseFilter=function(field){$scope.filterCollapsed[field]=!$scope.filterCollapsed[field]},$scope.status={startOpened:!1,endOpened:!1},$scope.dateFilterOpen=function($event,which){this.status[which]=!0},$scope.format="dd.MM.yyyy",$scope.filterSubmit=function(){angular.forEach($scope.filterList,function(value,key){if(value.model)if("date"===value.type){var dateValues=[null,null];angular.forEach(value.model,function(v,k){dateValues[k]=Generator.dateformatter(v)}),$scope.form_params.filters[key]={values:dateValues,type:value.type}}else $scope.form_params.filters[key]={values:Object.keys(value.model),type:value.type||"check"}}),Generator.get_wf($scope)}}}}).controller("crudTimetableDirectiveCtrl",function($scope,WSOps,$q){function groupBy(list,propName){return list.reduce(function(acc,item){return(acc[item[propName]]=acc[item[propName]]||[]).push(item),acc},{})}$scope.groupBy=groupBy,$scope.get_wf=function(data){var fieldName=$scope.mainFieldName||"ogretim_elemani_zt";
return data.token=$scope.token,data.wf=$scope.wf,WSOps.request(data).then(function(result){return result[fieldName]?result:(Generator.pathDecider(result.client_cmd||["list"],$scope,result),$q.reject())}).then(function(result){return $scope.message=result.notification,result[fieldName]})},$scope.prepareTimetable=function(timetable){var grouped=groupBy(timetable,"saat");for(var day in grouped)if(grouped.hasOwnProperty(day)){var dayItems=grouped[day];grouped[day]=dayItems.sort(function(a,b){return a.gun<b.gun?-1:1})}var acc=[];for(var t in grouped)grouped.hasOwnProperty(t)&&acc.push([t,grouped[t]]);return acc.sort(function(a,b){return a[0]>b[0]?1:-1})}}).directive("crudTimetableDirective",function(){return{templateUrl:"components/crud/templates/timetable.html",restrict:"E",replace:!0,controller:"crudTimetableDirectiveCtrl",link:function(iScope,iElem,iAtrrs){function initLecturer(data){iScope.currentTable={key:data.oe_key,name:data.name,avatar_url:data.avatar_url,totalHours:data.toplam_ders_saati,readonly:data.readonly},iScope.timetable=iScope.prepareTimetable(data.uygunluk_durumu)}var mainFieldName="ogretim_elemani_zt";iScope.mainFieldName=mainFieldName,iScope.tablesList=iScope[mainFieldName].ogretim_elemanlari,iScope.widgetTitle="Öğretim Elemanı Zaman Tablosu",initLecturer(iScope[mainFieldName]),iScope.selectTable=function(lecturer){iScope.loadingTable=!0,iScope.get_wf({cmd:"personel_sec",secili_og_elemani:{key:lecturer.key}}).then(function(response){initLecturer(response)}).finally(function(){iScope.loadingTable=!1})},iScope.changeValue=function(time){iScope.loadingAction=!0,iScope.get_wf({cmd:"degistir",change:{key:time.key,durum:time.durum}}).then(function(table){for(var days=table.uygunluk_durumu,i=0;i<days.length;i++)if(days[i].key==time.key){time.durum=days[i].durum;break}}).finally(function(){iScope.loadingAction=!1})}}}}).directive("crudTimetableDirective2",function(){return{templateUrl:"components/crud/templates/timetable.html",restrict:"E",replace:!0,controller:"crudTimetableDirectiveCtrl",link:function(iScope,iElem,iAtrrs){function initTable(data){iScope.currentTable={key:data.oe_key,name:data.name,avatar_url:data.avatar_url,readonly:data.readonly},iScope.timetable=iScope.prepareTimetable(data.zaman_plani)}var mainFieldName="derslik_zaman_tablosu";iScope.mainFieldName=mainFieldName,iScope.tablesList=iScope[mainFieldName].derslikler,iScope.widgetTitle="Derslik Zaman Tablosu",initTable(iScope[mainFieldName]),iScope.selectTable=function(table){iScope.loadingTable=!0,iScope.get_wf({cmd:"derslik_degistir",secili_derslik:{key:table.key}}).then(function(response){initTable(response)}).finally(function(){iScope.loadingTable=!1})},iScope.changeValue=function(time){iScope.loadingAction=!0,iScope.get_wf({cmd:"degistir",change:{key:time.key,durum:time.durum}}).then(function(table){for(var days=table.uygunluk_durumu,i=0;i<days.length;i++)if(days[i].key==time.key){time.durum=days[i].durum;break}}).finally(function(){iScope.loadingAction=!1})}}}}),angular.module("ulakbus.crud").directive("quickAdd",function(Generator){return{templateUrl:"components/crud/templates/quick_add.html",restrict:"E",replace:!0,scope:{node:"="},controller:function($scope){$scope.kw="",$scope.getTitleMap=function(){return $scope.generateTitleMap($scope.kw)},$scope.generateTitleMap=function(kw){var searchData={form_params:{view:$scope.node.quick_add_view,model:$scope.node.quick_add_model,query:kw}};return angular.isDefined($scope.$parent.form_params.param)&&(searchData.form_params.id=$scope.$parent.form_params.id),Generator.get_list(searchData).then(function(res){var titleMap=[];return angular.forEach(res.objects,function(item){titleMap.push({value:item[0],name:item[1]})}),titleMap})},$scope.onSelect=function(item){var get_first_key=function(){return Object.keys($scope.node.schema.properties)[0]},field=$scope.node.quick_add_field||get_first_key(),f={key:item.value};f[field]=item.name,angular.forEach($scope.node.items[0],function(value,key){angular.isDefined(f[key])||(f[key]=void 0)});try{angular.forEach($scope.node.items,function(value,key){if(value.key===item.value)throw Error()}),$scope.node.model.push(f),$scope.node.items.push(f)}catch(e){alert("bu öğe listede zaten mevcut!!")}}}}}),angular.module("ulakbus.debug",["ngRoute"]).controller("DebugController",function($scope,$rootScope,$location){$scope.debug_queries=$rootScope.debug_queries}),angular.module("ulakbus").factory("DevSettings",function($cookies){var devSettings={};return devSettings.settings={keepAlive:$cookies.get("keepAlive")||"on"},devSettings}),angular.module("ulakbus.devSettings",["ngRoute"]).controller("DevSettingsController",function($scope,$cookies,$rootScope,RESTURL,DevSettings){$scope.backendurl=$cookies.get("backendurl"),$scope.keepAlive=$cookies.get("keepAlive")||"on",$scope.changeSettings=function(what,set){document.cookie=what+"="+set,$scope[what]=set,$rootScope.$broadcast(what,set)},$scope.switchOnOff=function(pinn){return"on"==pinn?"off":"on"},$scope.setbackendurl=function(){$scope.changeSettings("backendurl",$scope.backendurl),RESTURL.url=$scope.backendurl},$scope.setKeepAlive=function(){$scope.changeSettings("keepAlive",$scope.switchOnOff($scope.keepAlive)),DevSettings.settings.keepAlive=$cookies.get("keepAlive")}}),angular.module("ulakbus").config(["$routeProvider",function($routeProvider){$routeProvider.when("/error/500",{templateUrl:"components/error_pages/500.html",controller:"500Controller"}).when("/error/404",{templateUrl:"components/error_pages/404.html",controller:"404Controller"})}]),angular.module("ulakbus.error_pages",["ngRoute"]).controller("500Controller",function($scope,$rootScope,$location){}).controller("404Controller",function($scope,$rootScope,$location){}),angular.module("ulakbus.version",["ulakbus.version.interpolate-filter","ulakbus.version.version-directive"]).value("version","0.1.1"),angular.module("ulakbus.version.interpolate-filter",[]).filter("interpolate",["version",function(version){return function(text){return String(text).replace(/\%VERSION\%/gm,version)}}]),angular.module("ulakbus.version.version-directive",[]).directive("appVersion",["version",function(version){return function(scope,elm,attrs){elm.text(version)}}]),angular.module("ulakbus.messaging",["ui.bootstrap"]).factory("MessagingService",function($q,$timeout,$compile,$log,$rootScope,Moment,WSOps,Utils){function wsReady(){var deferred=$q.defer(),dismissWatcher=$rootScope.$watch("websocketIsOpen",function(isOpen){isOpen&&(dismissWatcher(),deferred.resolve())});return deferred.promise}function wsRequest(outgoing){return wsReady().then(function(){return WSOps.request(outgoing)})}function prepareMessages(messages){for(var i=0;i<messages.length;i++){var message=messages[i];msg.prepareMessage(message)}}function increaseUnread(message,messageType){(messagingAppIsHidden||message.channel_key!=currentChannelKey)&&(message.is_update||checkIfInitialized().then(function(){var channel=channelsMap[message.channel_key];channel&&(channel.unread+=1),unread[messageType].count+=1}))}function decreaseUnread(channel){if(channel=channelsMap[channel.key],channel&&channel.unread){var counter;counter=channel.type==msg.CHANNEL_TYPE.NOTIFICATION?unread.notifications:unread.messages,counter.count-=channel.unread,counter.count<0&&(counter.count=0),channel.unread=0}}function checkIfInitialized(){return channelsLoader?channelsLoader:msg.list_channels()}var notificationsChannelKey,channelsLoader,msg={},channelsMap={},groupedChannels={};msg.CHANNEL_TYPE={PUBLIC:15,DIRECT:10,NOTIFICATION:5},msg.SHOW_MESSAGING_WINDOW_EVENT="show_messaging_window";var currentChannelKey,unread={messages:{count:0},notifications:{count:0}},messagingAppIsHidden=!0;return msg.prepareMessage=function(message){if(message.timestamp){var ts=message.timestamp.replace("Z","");message.moment=Moment(ts)}else message.moment=Moment();return message},msg.get_notifications_channel_key=function(){return checkIfInitialized().then(function(){return notificationsChannelKey})},msg.get_unread_counters=function(){return unread},msg.reset_state=function(){currentChannelKey=null,notificationsChannelKey=null,channelsMap={},groupedChannels={},unread.messages.count=0,unread.notifications.count=0,channelsLoader=!1},msg.toggle_messaging_window_visibility=function(visibility,resetState){messagingAppIsHidden=!visibility,resetState&&msg.reset_state()},msg.show_messaging_window=function(channelKey){$rootScope.$broadcast(msg.SHOW_MESSAGING_WINDOW_EVENT,channelKey)},msg.list_channels=function(){var outgoing={view:"_zops_list_channels"};return channelsLoader=wsRequest(outgoing).then(function(data){var initialGroups={};initialGroups[msg.CHANNEL_TYPE.PUBLIC]=[],initialGroups[msg.CHANNEL_TYPE.DIRECT]=[],initialGroups[msg.CHANNEL_TYPE.NOTIFICATION]=[],groupedChannels=Utils.groupBy(data.channels||[],"type",initialGroups);for(var i=0;i<data.channels.length;i++){var channel=data.channels[i];channelsMap[channel.key]=channel}return notificationsChannelKey=groupedChannels[msg.CHANNEL_TYPE.NOTIFICATION][0].key,{grouped:groupedChannels,channelsMap:channelsMap}})},msg.search_user=function(query){var outgoing={view:"_zops_search_user",query:query};return wsRequest(outgoing).then(function(data){return data.results})},msg.search_unit=function(query){var outgoing={view:"_zops_search_unit",query:query};return wsRequest(outgoing).then(function(data){return data.results})},msg.create_direct_channel=function(key){var outgoing={view:"_zops_create_direct_channel",user_key:key};return wsRequest(outgoing).then(function(result){return $log.info("Create direct channel result: ",result),result})},msg.create_channel=function(name,desription){var outgoing={view:"_zops_create_channel",name:name,description:desription};return wsRequest(outgoing).then(function(result){return $log.info("Channel ",name,"created: ",result),result})},msg.add_members=function(channelKey,members,readOnly){var outgoing={view:"_zops_add_members",channel_key:channelKey,read_only:!!readOnly,members:members};return wsRequest(outgoing).then(function(result){return $log.info("Members ",members," added to channel ",channelKey,": ",result),result})},msg.add_unit_to_channel=function(channelKey,unitKey,readOnly){var outgoing={view:"_zops_add_unit_to_channel",channel_key:channelKey,unit_key:unitKey,read_only:!!readOnly};return wsRequest(outgoing).then(function(result){return $log.info("Unit ",unitKey," added to channel ",channelKey,": ",result),result})},msg.delete_channel=function(channelKey){var outgoing={view:"_zops_delete_channel",channel_key:channelKey};return wsRequest(outgoing).then(function(result){return $log.info("Channel ",channelKey," deleted: ",result),channelsMap[channelKey]&&(channelsMap[channelKey].deleted=!0),result})},msg.edit_channel=function(channelKey,name,desription){var outgoing={view:"_zops_edit_channel",channel_key:channelKey,name:name,description:desription};return wsRequest(outgoing).then(function(result){return $log.info("Channel ",channelKey," edited: ",outgoing,result),result})},msg.pin_channel=function(channelKey){var outgoing={view:"_zops_pin_channel",channel_key:channelKey};return wsRequest(outgoing).then(function(result){return $log.info("Channel ",channelKey," pinned: ",result),result})},msg.show_channel=function(channelKey){var outgoing={view:"_zops_show_channel",key:channelKey};return wsRequest(outgoing).then(function(result){return $log.info("Show channel ",channelKey,": ",result),decreaseUnread(result),currentChannelKey=result.key,prepareMessages(result.last_messages),result})},msg.channel_history=function(channelKey,lastMessageTimestamp){var outgoing={view:"_zops_channel_history",channel_key:channelKey,timestamp:lastMessageTimestamp};return wsRequest(outgoing).then(function(result){return $log.info("Load channel ",channelKey,"history: ",result),prepareMessages(result.messages),result})},msg.get_unread_messages_count=function(){var outgoing={view:"_zops_unread_count"};return wsRequest(outgoing).then(function(result){return $log.info("Get unread messages count: ",result),unread.messages.count=result.messages,unread.notifications.count=result.notifications,result})},msg.report_last_seen_message=function(channelKey,msgKey,timestamp){var outgoing={view:"_zops_report_last_seen_message",channel_key:channelKey,msg_key:msgKey,timestamp:timestamp};return wsRequest(outgoing).then(function(result){return $log.info("Report last seen message ",channelKey,msgKey,timestamp,": ",result),result})},msg.create_message=function(channelKey,msgType,body,attachments){var outgoing={view:"_zops_create_message",message:{channel:channelKey,type:msgType,title:"",receiver:"",body:body,attachments:attachments}};return wsRequest(outgoing).then(function(result){return $log.info("Message sent: ",result),result})},msg.find_message=function(channelKey,query,pageNumber){var outgoing={view:"_zops_search_find_message",channel_key:channelKey,query:query,page:pageNumber};return wsRequest(outgoing).then(function(result){return $log.info("Find message: ",result),result})},msg.delete_message=function(msgKey){var outgoing={view:"_zops_delete_message",key:msgKey};return wsRequest(outgoing).then(function(result){return $log.info("Delete message ",msgKey,":",result),result})},msg.edit_message=function(msgKey,body){var outgoing={view:"_zops_edit_message",message:{key:msgKey,body:body}};return wsRequest(outgoing).then(function(result){return $log.info("Edit message",msgKey,":",result),result})},msg.flag_message=function(msgKey,flag){var outgoing={view:"_zops_flag_message",key:msgKey,flag:flag};return wsRequest(outgoing).then(function(result){return $log.info("Flag message ",msgKey,flag,":",result),result})},msg.get_message_actions=function(msgKey){var outgoing={view:"_zops_get_message_actions",key:msgKey};return wsRequest(outgoing).then(function(result){return $log.info("Get message actions",msgKey,":",result),result})},msg.add_to_favorites=function(msgKey){var outgoing={view:"_zops_add_to_favorites",key:msgKey};return wsRequest(outgoing).then(function(result){return $log.info("Add message ",msgKey," to favorites: ",result),result})},msg.remove_from_favorites=function(msgKey){var outgoing={view:"_zops_remove_to_favorites",key:msgKey};return wsRequest(outgoing).then(function(result){return $log.info("Remove message ",msgKey," from favorites: ",result),result})},msg.list_favorites=function(channelKey){var outgoing={view:"_zops_list_favorites",channel_key:channelKey};return wsRequest(outgoing).then(function(result){return $log.info("List favorites for channel",channelKey,": ",result),result})},$rootScope.$on("message",function(e,message){increaseUnread(message,"messages")}),$rootScope.$on("notifications",function(e,message){increaseUnread(message,"notifications")}),$rootScope.$on("channel_change",function(e,action,channel){checkIfInitialized().then(function(){if("add"==action){var group=groupedChannels[channel.type];return channelsMap[channel.key]||(channelsMap[channel.key]=channel),group.push(channel)}if("status"==action){var localChannel=channelsMap[channel.channel_key];localChannel&&(localChannel.is_online=channel.is_online)}})}),$rootScope.$watch("loggedInUser",function(value){value||msg.reset_state()}),$rootScope.$on("user_ready",function(){msg.get_unread_messages_count()}),msg}).service("MessagingPopup",function($q,$compile,$http,$rootScope){function compile(template,config){var originalContent,element,resultDeferred=$q.defer(),scope=config.scope||$rootScope.$new(!0),rootElement=config.rootElement;return config.inplaceEditor&&(originalContent=rootElement.text(),scope.content=originalContent),scope.done=function(result){resultDeferred.resolve.apply(this,arguments)},scope.cancel=function(){resultDeferred.reject.apply(this,arguments)},config.link&&config.link(scope),element=$compile(template)(scope),rootElement.empty(),rootElement.append(element),resultDeferred.promise._done=scope.done,resultDeferred.promise._cancel=scope.cancel,resultDeferred.promise.finally(function(){config.inplaceEditor?rootElement.text(scope.content):rootElement.empty(),scope.$destroy()})}this.show=function(config){return config.templateUrl?$http({method:"GET",url:config.templateUrl,cache:!0}).then(function(result){return compile(result.data,config)}):compile(config.template,config)}}),angular.module("ulakbus.messaging").directive("messaging",function(Generator,MessagingService,$log,$rootScope,MessagingPopup,Utils,$q,$timeout){function getKey(channel){if(channel){if(!angular.isObject(channel))return channel;var channelKey=channel.channel_key;return!channelKey&&channel.hasOwnProperty("key")&&(channelKey=channel.key),channelKey}}function searchWrapper(scope,promiseWrapper){scope.loading=!0,scope.searchResult=[],promiseWrapper().then(function(result){scope.searchResult=result}).finally(function(){scope.loading=!1})}return{templateUrl:"components/messaging/templates/index.html",restrict:"E",scope:{},link:function(iScope,iElem,iAttrs){function reset(){iScope.selectedChannel=null,iScope.allMessagesLoaded=!1,iScope.publicChannels=[],iScope.notificationsChannel=[],iScope.directChannels=[]}function editChannelPopup(channel){return MessagingPopup.show({templateUrl:"components/messaging/templates/create_channel.html",rootElement:popupRootElement,link:function(scope){scope.channel=channel||{},scope.title="Kanalı düzenle",scope.actionTitle="Düzenle",channel||(scope.title="Yeni Kanal Oluştur",scope.actionTitle="Oluştur")}})}function getMessageElementByKey(key){return $("#msg-"+key)}function updateLastMessage(message){if(!message&&iScope.selectedChannel&&iScope.selectedChannel.messages.length>0){var last=iScope.selectedChannel.messages.length-1;return iScope.lastMessage=iScope.selectedChannel.messages[last]}return iScope.lastMessage=message}function appendMessage(channel,message){channel&&getKey(message)==getKey(channel)&&channel.messages&&channel.messages.push(message),updateLastMessage(message),reportLastSeenMessage()}function updateMessage(message){if(message.channel_key==getKey(iScope.selectedChannel)){var storedMessage=Utils.findWhere(iScope.selectedChannel.messages,{key:message.key});if(storedMessage){angular.extend(storedMessage,message);var msgElement=getMessageElementByKey(message.key);msgElement&&msgElement.text(message.content)}}}function updateAndSelect(channelKey){return channelKey=getKey(channelKey),iScope.updateChannelsList().then(function(){return iScope.selectChannel(channelKey)})}function deleteMessageLocally(messageKey){iScope.selectedChannel&&Utils.deleteWhere(iScope.selectedChannel.messages,{key:messageKey})}function reportLastSeenMessage(){if(iScope.lastMessage&&iScope.selectedChannel){var ts=iScope.lastMessage.moment.format("YYYY-MM-DDTHH:mm:ss");MessagingService.report_last_seen_message(getKey(iScope.selectedChannel),iScope.lastMessage.key,ts)}}function selectChannel(channelKey,silent){return silent||(iScope.loadingChannel=!0),MessagingService.show_channel(channelKey).finally(function(){iScope.loadingChannel=!1})}iScope.chatAppIsHidden=!0,$rootScope.$watch("loggedInUser",function(v){iScope.loggedIn=v,reset()}),iScope.shared={};var popupRootElement=$(iElem).find(".popup-placeholder");iScope.deleteConfirmation=function(title){return MessagingPopup.show({templateUrl:"components/messaging/templates/delete_confirmation.html",link:function(scope){scope.title=title||"Silmek istediğinize emin misiniz?"},rootElement:popupRootElement})},iScope.updateChannelsList=function(){return MessagingService.list_channels().then(function(channels){var groupedChannels=channels.grouped;iScope.publicChannels=groupedChannels[MessagingService.CHANNEL_TYPE.PUBLIC],iScope.notificationsChannel=groupedChannels[MessagingService.CHANNEL_TYPE.NOTIFICATION][0],iScope.directChannels=groupedChannels[MessagingService.CHANNEL_TYPE.DIRECT]})},iScope.createDirectChannel=function(user){var key=user[1];MessagingService.create_direct_channel(key).then(function(result){updateAndSelect(getKey(result))})},iScope.hideApp=function(){iScope.chatAppIsHidden=!0,MessagingService.toggle_messaging_window_visibility(!1)},iScope.showApp=function(){return iScope.chatAppIsHidden=!1,MessagingService.toggle_messaging_window_visibility(!0),iScope.updateChannelsList()},iScope.searchUser=function(){MessagingPopup.show({templateUrl:"components/messaging/templates/search_user.html",rootElement:popupRootElement,link:function(scope){scope.onChange=function(query){searchWrapper(scope,function(){return MessagingService.search_user(query)})},scope.onChange("")}}).then(function(user){return iScope.createDirectChannel(user)})},iScope.createChannel=function(){return editChannelPopup().then(function(channel){return MessagingService.create_channel(channel.name,channel.description||"").then(function(newChannel){updateAndSelect(newChannel)})})},iScope.applyChannelAction=function(channel,action){var actionView=action[1];switch(actionView){case"_zops_pin_channel":MessagingService.pin_channel(getKey(channel));break;case"_zops_delete_channel":iScope.deleteConfirmation("Kanalı silmek istediğinize emin misiniz?").then(function(){MessagingService.delete_channel(getKey(channel)).then(function(){iScope.selectedChannel=null})});break;case"_zops_edit_channel":editChannelPopup(channel).then(function(channelData){return MessagingService.edit_channel(getKey(channelData),channelData.name,channelData.description||"")});break;case"_zops_add_members":MessagingPopup.show({templateUrl:"components/messaging/templates/add_user_unit.html",rootElement:popupRootElement,link:function(scope){scope.title="Kanala kullanıcı ekle",scope.placeholder="Eklemek için kullanıcı ara",scope.onChange=function(query){searchWrapper(scope,function(){return MessagingService.search_user(query)})},scope.onChange("")}}).then(function(user){var userKey=user.key,channelKey=getKey(channel);return MessagingService.add_members(channelKey,[userKey],user.readonly)});break;case"_zops_add_unit_to_channel":MessagingPopup.show({templateUrl:"components/messaging/templates/add_user_unit.html",rootElement:popupRootElement,link:function(scope){scope.title="Birim Ekle",scope.placeholder="Kanala eklemek için birim ara",scope.onChange=function(query){searchWrapper(scope,function(){return MessagingService.search_unit(query)})},scope.onChange("")}}).then(function(unit){var unitKey=unit.key,channelKey=getKey(channel);return MessagingService.add_members(channelKey,unitKey,unit.readonly)})}},iScope.selectChannel=function(channel,silent){iScope.allMessagesLoaded=!1;var channelKey=getKey(channel);selectChannel(channelKey,silent).then(function(result){iScope.selectedChannel=result,iScope.selectedChannel.read_only=channel.read_only,iScope.selectedChannel.messages=result.last_messages,iScope.selectedChannel.messages.length<15&&(iScope.allMessagesLoaded=!0),updateLastMessage(channel.messages),reportLastSeenMessage()})},iScope.isChannelSelected=function(channel){return iScope.selectedChannel&&getKey(channel)==getKey(iScope.selectedChannel)},iScope.sendMessage=function(content){if(content){var channelKey=getKey(iScope.selectedChannel),msgType=iScope.selectedChannel.type==MessagingService.CHANNEL_TYPE.DIRECT?2:4;MessagingService.create_message(channelKey,msgType,content).then(function(){iScope.shared.message=""})}},iScope.applyMessageAction=function(message,action){var actionView=action[1];switch(actionView){case"_zops_favorite_message":MessagingService.add_to_favorites(message.key).then(function(){message.actions=null});break;case"_zops_flag_message":MessagingService.flag_message(message.key,!0).then(function(){message.actions=null});break;case"_zops_unflag_message":MessagingService.flag_message(message.key,!1).then(function(){message.actions=null});break;case"_zops_delete_message":iScope.deleteConfirmation("Mesajı silmek istediğinize emin misiniz?").then(function(){return MessagingService.delete_message(message.key).then(function(){deleteMessageLocally(message.key)})});break;case"_zops_edit_message":var messageContainer=getMessageElementByKey(message.key);MessagingPopup.show({templateUrl:"components/messaging/templates/edit_message.html",rootElement:messageContainer,inplaceEditor:!0,link:function(scope){scope.internalContent=scope.content,scope.save=function(){return scope.internalContent?void MessagingService.edit_message(message.key,scope.internalContent).then(function(){scope.content=scope.internalContent,scope.done()}):iScope.applyMessageAction(message,["_","_zops_delete_message"])}}})}},iScope.getMessageActions=function(message){message.actions||MessagingService.get_message_actions(message.key).then(function(result){message.actions=result.actions})},iScope.loadMore=function(){if(!iScope.allMessagesLoaded&&iScope.selectedChannel.messages.length>0){var first=iScope.selectedChannel.messages[0];return MessagingService.channel_history(getKey(iScope.selectedChannel),first.timestamp).then(function(result){var messages=iScope.selectedChannel.messages;return 0==result.messages.length?void(iScope.allMessagesLoaded=!0):(messages.unshift.apply(messages,result.messages),!0)})}},$rootScope.$on("message",function(e,message){message.is_update?updateMessage(message):appendMessage(iScope.selectedChannel,MessagingService.prepareMessage(message))}),$rootScope.$on("notifications",function(e,notification){appendMessage(iScope.selectedChannel,MessagingService.prepareMessage(notification))}),$rootScope.$on("user_ready",function(){reset(),iScope.hideApp()}),$rootScope.$on(MessagingService.SHOW_MESSAGING_WINDOW_EVENT,function(e,channelKey){var showApp=$q.when();iScope.chatAppIsHidden&&(showApp=iScope.showApp()),channelKey&&channelKey!=getKey(iScope.selectedChannel)&&showApp.then(function(){iScope.selectChannel(channelKey)})})}}}).filter("fromNow",function(Moment){return function(datetime){return Moment(datetime).fromNow()}}).directive("scrollDownWhenUpdate",function($timeout){return{link:function(iScope,iElem,iAttrs){var elem=$(iElem);iAttrs.$observe("scrollDownWhenUpdate",function(value){value&&$timeout(function(){elem.scrollTop(elem[0].scrollHeight)},0)})}}}).directive("loadMoreTop",function($compile,$timeout,$q){var loaderTpl=$compile('<div class="loader" style="float: none; margin: auto; margin-top: 10px;" ng-show="loading"></div>');return{scope:{loadMoreCallback:"&loadMoreTop"},link:function(iScope,iElem,iAttrs){function onScroll(){var scrollTop=elem.scrollTop();if(scrollTop<=0&&!iScope.loading&&iScope.loadMoreCallback){var id=elem.find("[id]").first().attr("id");$timeout(function(){iScope.loading=!0}),$q.when(iScope.loadMoreCallback()).finally(function(loaded){$timeout(function(){if(iScope.loading=!1,loaded){var lastTopElem=elem.find("#"+id);if(lastTopElem){var top=lastTopElem.offset().top-elem.offset().top-100;elem.scrollTop(top)}}})})}}var elem=$(iElem);iElem.prepend(angular.element(loaderTpl(iScope))),iScope.loading=!1,elem.scroll(onScroll)}}}).directive("contenteditable",function(){return{require:"?ngModel",scope:{},link:function(iScope,iElem,iAttrs,ngModel){function read(){var html=iElem.text();ngModel.$setViewValue(html)}ngModel&&(ngModel.$render=function(){iElem.text(ngModel.$viewValue||"")},iElem.on("blur keyup change",function(){iScope.$evalAsync(read)}),iScope.$on("$destroy",function(){iElem.off("blur keyup change")}))}}}).directive("autoFocus",function($timeout){function placeCaretAtEnd(el){if(el.focus(),"undefined"!=typeof window.getSelection&&"undefined"!=typeof document.createRange){var range=document.createRange();range.selectNodeContents(el),range.collapse(!1);var sel=window.getSelection();sel.removeAllRanges(),sel.addRange(range)}else if("undefined"!=typeof document.body.createTextRange){var textRange=document.body.createTextRange();textRange.moveToElementText(el),textRange.collapse(!1),textRange.select()}}return{link:function(iScope,iElem){$timeout(function(){placeCaretAtEnd(iElem[0])},500)}}});
\ No newline at end of file
/*! ulakbus-ui 2016-10-14 */
/*! ulakbus-ui 2016-10-21 */
"use strict";if(angular.module("ngLocale",[],["$provide",function($provide){var PLURAL_CATEGORY={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};$provide.value("$locale",{DATETIME_FORMATS:{AMPMS:["ÖÖ","ÖS"],DAY:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],ERANAMES:["Milattan Önce","Milattan Sonra"],ERAS:["MÖ","MS"],FIRSTDAYOFWEEK:0,MONTH:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],SHORTDAY:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"],SHORTMONTH:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],WEEKENDRANGE:[5,6],fullDate:"d MMMM y EEEE",longDate:"d MMMM y",medium:"d MMM y HH:mm:ss",mediumDate:"d MMM y",mediumTime:"HH:mm:ss",short:"d MM y HH:mm",shortDate:"d MM y",shortTime:"HH:mm"},NUMBER_FORMATS:{CURRENCY_SYM:"TL",DECIMAL_SEP:",",GROUP_SEP:".",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-",negSuf:" ¤",posPre:"",posSuf:" ¤"}]},id:"tr",pluralCat:function(n,opt_precision){return 1==n?PLURAL_CATEGORY.ONE:PLURAL_CATEGORY.OTHER}})}]),"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function($){var version=$.fn.jquery.split(" ")[0].split(".");if(version[0]<2&&version[1]<9||1==version[0]&&9==version[1]&&version[2]<1||version[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function($){function transitionEnd(){var el=document.createElement("bootstrap"),transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var name in transEndEventNames)if(void 0!==el.style[name])return{end:transEndEventNames[name]};return!1}$.fn.emulateTransitionEnd=function(duration){var called=!1,$el=this;$(this).one("bsTransitionEnd",function(){called=!0});var callback=function(){called||$($el).trigger($.support.transition.end)};return setTimeout(callback,duration),this},$(function(){$.support.transition=transitionEnd(),$.support.transition&&($.event.special.bsTransitionEnd={bindType:$.support.transition.end,delegateType:$.support.transition.end,handle:function(e){if($(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function($){function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.alert");data||$this.data("bs.alert",data=new Alert(this)),"string"==typeof option&&data[option].call($this)})}var dismiss='[data-dismiss="alert"]',Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.VERSION="3.3.7",Alert.TRANSITION_DURATION=150,Alert.prototype.close=function(e){function removeElement(){$parent.detach().trigger("closed.bs.alert").remove()}var $this=$(this),selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,""));var $parent=$("#"===selector?[]:selector);e&&e.preventDefault(),$parent.length||($parent=$this.closest(".alert")),$parent.trigger(e=$.Event("close.bs.alert")),e.isDefaultPrevented()||($parent.removeClass("in"),$.support.transition&&$parent.hasClass("fade")?$parent.one("bsTransitionEnd",removeElement).emulateTransitionEnd(Alert.TRANSITION_DURATION):removeElement())};var old=$.fn.alert;$.fn.alert=Plugin,$.fn.alert.Constructor=Alert,$.fn.alert.noConflict=function(){return $.fn.alert=old,this},$(document).on("click.bs.alert.data-api",dismiss,Alert.prototype.close)}(jQuery),+function($){function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.button"),options="object"==typeof option&&option;data||$this.data("bs.button",data=new Button(this,options)),"toggle"==option?data.toggle():option&&data.setState(option)})}var Button=function(element,options){this.$element=$(element),this.options=$.extend({},Button.DEFAULTS,options),this.isLoading=!1};Button.VERSION="3.3.7",Button.DEFAULTS={loadingText:"loading..."},Button.prototype.setState=function(state){var d="disabled",$el=this.$element,val=$el.is("input")?"val":"html",data=$el.data();state+="Text",null==data.resetText&&$el.data("resetText",$el[val]()),setTimeout($.proxy(function(){$el[val](null==data[state]?this.options[state]:data[state]),"loadingText"==state?(this.isLoading=!0,$el.addClass(d).attr(d,d).prop(d,!0)):this.isLoading&&(this.isLoading=!1,$el.removeClass(d).removeAttr(d).prop(d,!1))},this),0)},Button.prototype.toggle=function(){var changed=!0,$parent=this.$element.closest('[data-toggle="buttons"]');if($parent.length){var $input=this.$element.find("input");"radio"==$input.prop("type")?($input.prop("checked")&&(changed=!1),$parent.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==$input.prop("type")&&($input.prop("checked")!==this.$element.hasClass("active")&&(changed=!1),this.$element.toggleClass("active")),$input.prop("checked",this.$element.hasClass("active")),changed&&$input.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=Plugin,$.fn.button.Constructor=Button,$.fn.button.noConflict=function(){return $.fn.button=old,this},$(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(e){var $btn=$(e.target).closest(".btn");Plugin.call($btn,"toggle"),$(e.target).is('input[type="radio"], input[type="checkbox"]')||(e.preventDefault(),$btn.is("input,button")?$btn.trigger("focus"):$btn.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){$(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery),+function($){function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.carousel"),options=$.extend({},Carousel.DEFAULTS,$this.data(),"object"==typeof option&&option),action="string"==typeof option?option:options.slide;data||$this.data("bs.carousel",data=new Carousel(this,options)),"number"==typeof option?data.to(option):action?data[action]():options.interval&&data.pause().cycle()})}var Carousel=function(element,options){this.$element=$(element),this.$indicators=this.$element.find(".carousel-indicators"),this.options=options,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",$.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",$.proxy(this.pause,this)).on("mouseleave.bs.carousel",$.proxy(this.cycle,this))};Carousel.VERSION="3.3.7",Carousel.TRANSITION_DURATION=600,Carousel.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},Carousel.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},Carousel.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval)),this},Carousel.prototype.getItemIndex=function(item){return this.$items=item.parent().children(".item"),this.$items.index(item||this.$active)},Carousel.prototype.getItemForDirection=function(direction,active){var activeIndex=this.getItemIndex(active),willWrap="prev"==direction&&0===activeIndex||"next"==direction&&activeIndex==this.$items.length-1;if(willWrap&&!this.options.wrap)return active;var delta="prev"==direction?-1:1,itemIndex=(activeIndex+delta)%this.$items.length;return this.$items.eq(itemIndex)},Carousel.prototype.to=function(pos){var that=this,activeIndex=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(pos>this.$items.length-1||pos<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){that.to(pos)}):activeIndex==pos?this.pause().cycle():this.slide(pos>activeIndex?"next":"prev",this.$items.eq(pos))},Carousel.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&$.support.transition&&(this.$element.trigger($.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},Carousel.prototype.next=function(){if(!this.sliding)return this.slide("next")},Carousel.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},Carousel.prototype.slide=function(type,next){var $active=this.$element.find(".item.active"),$next=next||this.getItemForDirection(type,$active),isCycling=this.interval,direction="next"==type?"left":"right",that=this;if($next.hasClass("active"))return this.sliding=!1;var relatedTarget=$next[0],slideEvent=$.Event("slide.bs.carousel",{relatedTarget:relatedTarget,direction:direction});if(this.$element.trigger(slideEvent),!slideEvent.isDefaultPrevented()){if(this.sliding=!0,isCycling&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var $nextIndicator=$(this.$indicators.children()[this.getItemIndex($next)]);$nextIndicator&&$nextIndicator.addClass("active")}var slidEvent=$.Event("slid.bs.carousel",{relatedTarget:relatedTarget,direction:direction});return $.support.transition&&this.$element.hasClass("slide")?($next.addClass(type),$next[0].offsetWidth,$active.addClass(direction),$next.addClass(direction),$active.one("bsTransitionEnd",function(){$next.removeClass([type,direction].join(" ")).addClass("active"),$active.removeClass(["active",direction].join(" ")),that.sliding=!1,setTimeout(function(){that.$element.trigger(slidEvent)},0)}).emulateTransitionEnd(Carousel.TRANSITION_DURATION)):($active.removeClass("active"),$next.addClass("active"),this.sliding=!1,this.$element.trigger(slidEvent)),isCycling&&this.cycle(),this}};var old=$.fn.carousel;$.fn.carousel=Plugin,$.fn.carousel.Constructor=Carousel,$.fn.carousel.noConflict=function(){return $.fn.carousel=old,this};var clickHandler=function(e){var href,$this=$(this),$target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""));if($target.hasClass("carousel")){var options=$.extend({},$target.data(),$this.data()),slideIndex=$this.attr("data-slide-to");slideIndex&&(options.interval=!1),Plugin.call($target,options),slideIndex&&$target.data("bs.carousel").to(slideIndex),e.preventDefault()}};$(document).on("click.bs.carousel.data-api","[data-slide]",clickHandler).on("click.bs.carousel.data-api","[data-slide-to]",clickHandler),$(window).on("load",function(){$('[data-ride="carousel"]').each(function(){var $carousel=$(this);Plugin.call($carousel,$carousel.data())})})}(jQuery),+function($){function getTargetFromTrigger($trigger){var href,target=$trigger.attr("data-target")||(href=$trigger.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"");return $(target)}function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.collapse"),options=$.extend({},Collapse.DEFAULTS,$this.data(),"object"==typeof option&&option);!data&&options.toggle&&/show|hide/.test(option)&&(options.toggle=!1),data||$this.data("bs.collapse",data=new Collapse(this,options)),"string"==typeof option&&data[option]()})}var Collapse=function(element,options){this.$element=$(element),this.options=$.extend({},Collapse.DEFAULTS,options),this.$trigger=$('[data-toggle="collapse"][href="#'+element.id+'"],[data-toggle="collapse"][data-target="#'+element.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};Collapse.VERSION="3.3.7",Collapse.TRANSITION_DURATION=350,Collapse.DEFAULTS={toggle:!0},Collapse.prototype.dimension=function(){var hasWidth=this.$element.hasClass("width");return hasWidth?"width":"height"},Collapse.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var activesData,actives=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(actives&&actives.length&&(activesData=actives.data("bs.collapse"),activesData&&activesData.transitioning))){var startEvent=$.Event("show.bs.collapse");if(this.$element.trigger(startEvent),!startEvent.isDefaultPrevented()){actives&&actives.length&&(Plugin.call(actives,"hide"),activesData||actives.data("bs.collapse",null));var dimension=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[dimension](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var complete=function(){this.$element.removeClass("collapsing").addClass("collapse in")[dimension](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!$.support.transition)return complete.call(this);var scrollSize=$.camelCase(["scroll",dimension].join("-"));this.$element.one("bsTransitionEnd",$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])}}}},Collapse.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var startEvent=$.Event("hide.bs.collapse");if(this.$element.trigger(startEvent),!startEvent.isDefaultPrevented()){var dimension=this.dimension();this.$element[dimension](this.$element[dimension]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var complete=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return $.support.transition?void this.$element[dimension](0).one("bsTransitionEnd",$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION):complete.call(this)}}},Collapse.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},Collapse.prototype.getParent=function(){return $(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each($.proxy(function(i,element){var $element=$(element);this.addAriaAndCollapsedClass(getTargetFromTrigger($element),$element)},this)).end()},Collapse.prototype.addAriaAndCollapsedClass=function($element,$trigger){var isOpen=$element.hasClass("in");$element.attr("aria-expanded",isOpen),$trigger.toggleClass("collapsed",!isOpen).attr("aria-expanded",isOpen)};var old=$.fn.collapse;$.fn.collapse=Plugin,$.fn.collapse.Constructor=Collapse,$.fn.collapse.noConflict=function(){return $.fn.collapse=old,this},$(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(e){var $this=$(this);$this.attr("data-target")||e.preventDefault();var $target=getTargetFromTrigger($this),data=$target.data("bs.collapse"),option=data?"toggle":$this.data();Plugin.call($target,option)})}(jQuery),+function($){function getParent($this){var selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&/#[A-Za-z]/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,""));var $parent=selector&&$(selector);return $parent&&$parent.length?$parent:$this.parent()}function clearMenus(e){e&&3===e.which||($(backdrop).remove(),$(toggle).each(function(){var $this=$(this),$parent=getParent($this),relatedTarget={relatedTarget:this};$parent.hasClass("open")&&(e&&"click"==e.type&&/input|textarea/i.test(e.target.tagName)&&$.contains($parent[0],e.target)||($parent.trigger(e=$.Event("hide.bs.dropdown",relatedTarget)),e.isDefaultPrevented()||($this.attr("aria-expanded","false"),$parent.removeClass("open").trigger($.Event("hidden.bs.dropdown",relatedTarget)))))}))}function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.dropdown");data||$this.data("bs.dropdown",data=new Dropdown(this)),"string"==typeof option&&data[option].call($this)})}var backdrop=".dropdown-backdrop",toggle='[data-toggle="dropdown"]',Dropdown=function(element){$(element).on("click.bs.dropdown",this.toggle)};Dropdown.VERSION="3.3.7",Dropdown.prototype.toggle=function(e){var $this=$(this);if(!$this.is(".disabled, :disabled")){var $parent=getParent($this),isActive=$parent.hasClass("open");if(clearMenus(),!isActive){"ontouchstart"in document.documentElement&&!$parent.closest(".navbar-nav").length&&$(document.createElement("div")).addClass("dropdown-backdrop").insertAfter($(this)).on("click",clearMenus);var relatedTarget={relatedTarget:this};if($parent.trigger(e=$.Event("show.bs.dropdown",relatedTarget)),e.isDefaultPrevented())return;$this.trigger("focus").attr("aria-expanded","true"),$parent.toggleClass("open").trigger($.Event("shown.bs.dropdown",relatedTarget))}return!1}},Dropdown.prototype.keydown=function(e){if(/(38|40|27|32)/.test(e.which)&&!/input|textarea/i.test(e.target.tagName)){var $this=$(this);if(e.preventDefault(),e.stopPropagation(),!$this.is(".disabled, :disabled")){var $parent=getParent($this),isActive=$parent.hasClass("open");if(!isActive&&27!=e.which||isActive&&27==e.which)return 27==e.which&&$parent.find(toggle).trigger("focus"),$this.trigger("click");var desc=" li:not(.disabled):visible a",$items=$parent.find(".dropdown-menu"+desc);if($items.length){var index=$items.index(e.target);38==e.which&&index>0&&index--,40==e.which&&index<$items.length-1&&index++,~index||(index=0),$items.eq(index).trigger("focus")}}}};var old=$.fn.dropdown;$.fn.dropdown=Plugin,$.fn.dropdown.Constructor=Dropdown,$.fn.dropdown.noConflict=function(){return $.fn.dropdown=old,this},$(document).on("click.bs.dropdown.data-api",clearMenus).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",toggle,Dropdown.prototype.toggle).on("keydown.bs.dropdown.data-api",toggle,Dropdown.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",Dropdown.prototype.keydown)}(jQuery),+function($){function Plugin(option,_relatedTarget){return this.each(function(){var $this=$(this),data=$this.data("bs.modal"),options=$.extend({},Modal.DEFAULTS,$this.data(),"object"==typeof option&&option);data||$this.data("bs.modal",data=new Modal(this,options)),"string"==typeof option?data[option](_relatedTarget):options.show&&data.show(_relatedTarget)})}var Modal=function(element,options){this.options=options,this.$body=$(document.body),this.$element=$(element),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,$.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};Modal.VERSION="3.3.7",Modal.TRANSITION_DURATION=300,Modal.BACKDROP_TRANSITION_DURATION=150,Modal.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},Modal.prototype.toggle=function(_relatedTarget){return this.isShown?this.hide():this.show(_relatedTarget)},Modal.prototype.show=function(_relatedTarget){var that=this,e=$.Event("show.bs.modal",{relatedTarget:_relatedTarget});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',$.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){that.$element.one("mouseup.dismiss.bs.modal",function(e){$(e.target).is(that.$element)&&(that.ignoreBackdropClick=!0)})}),this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass("fade");that.$element.parent().length||that.$element.appendTo(that.$body),that.$element.show().scrollTop(0),that.adjustDialog(),transition&&that.$element[0].offsetWidth,that.$element.addClass("in"),that.enforceFocus();var e=$.Event("shown.bs.modal",{relatedTarget:_relatedTarget});transition?that.$dialog.one("bsTransitionEnd",function(){that.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(Modal.TRANSITION_DURATION):that.$element.trigger("focus").trigger(e)}))},Modal.prototype.hide=function(e){e&&e.preventDefault(),e=$.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),$(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),$.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",$.proxy(this.hideModal,this)).emulateTransitionEnd(Modal.TRANSITION_DURATION):this.hideModal())},Modal.prototype.enforceFocus=function(){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(e){document===e.target||this.$element[0]===e.target||this.$element.has(e.target).length||this.$element.trigger("focus")},this))},Modal.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",$.proxy(function(e){27==e.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},Modal.prototype.resize=function(){this.isShown?$(window).on("resize.bs.modal",$.proxy(this.handleUpdate,this)):$(window).off("resize.bs.modal")},Modal.prototype.hideModal=function(){var that=this;this.$element.hide(),this.backdrop(function(){that.$body.removeClass("modal-open"),that.resetAdjustments(),that.resetScrollbar(),that.$element.trigger("hidden.bs.modal")})},Modal.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},Modal.prototype.backdrop=function(callback){var that=this,animate=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate;if(this.$backdrop=$(document.createElement("div")).addClass("modal-backdrop "+animate).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",$.proxy(function(e){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),doAnimate&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!callback)return;doAnimate?this.$backdrop.one("bsTransitionEnd",callback).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callback()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var callbackRemove=function(){that.removeBackdrop(),callback&&callback()};$.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",callbackRemove).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callbackRemove()}else callback&&callback()},Modal.prototype.handleUpdate=function(){this.adjustDialog()},Modal.prototype.adjustDialog=function(){var modalIsOverflowing=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&modalIsOverflowing?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!modalIsOverflowing?this.scrollbarWidth:""})},Modal.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},Modal.prototype.checkScrollbar=function(){var fullWindowWidth=window.innerWidth;if(!fullWindowWidth){var documentElementRect=document.documentElement.getBoundingClientRect();fullWindowWidth=documentElementRect.right-Math.abs(documentElementRect.left)}this.bodyIsOverflowing=document.body.clientWidth<fullWindowWidth,this.scrollbarWidth=this.measureScrollbar()},Modal.prototype.setScrollbar=function(){var bodyPad=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",bodyPad+this.scrollbarWidth)},Modal.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},Modal.prototype.measureScrollbar=function(){var scrollDiv=document.createElement("div");scrollDiv.className="modal-scrollbar-measure",this.$body.append(scrollDiv);var scrollbarWidth=scrollDiv.offsetWidth-scrollDiv.clientWidth;return this.$body[0].removeChild(scrollDiv),scrollbarWidth};var old=$.fn.modal;$.fn.modal=Plugin,$.fn.modal.Constructor=Modal,$.fn.modal.noConflict=function(){return $.fn.modal=old,this},$(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(e){var $this=$(this),href=$this.attr("href"),$target=$($this.attr("data-target")||href&&href.replace(/.*(?=#[^\s]+$)/,"")),option=$target.data("bs.modal")?"toggle":$.extend({remote:!/#/.test(href)&&href},$target.data(),$this.data());$this.is("a")&&e.preventDefault(),$target.one("show.bs.modal",function(showEvent){showEvent.isDefaultPrevented()||$target.one("hidden.bs.modal",function(){$this.is(":visible")&&$this.trigger("focus")})}),Plugin.call($target,option,this)})}(jQuery),+function($){function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.tooltip"),options="object"==typeof option&&option;!data&&/destroy|hide/.test(option)||(data||$this.data("bs.tooltip",data=new Tooltip(this,options)),"string"==typeof option&&data[option]())})}var Tooltip=function(element,options){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",element,options)};Tooltip.VERSION="3.3.7",Tooltip.TRANSITION_DURATION=150,Tooltip.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},Tooltip.prototype.init=function(type,element,options){if(this.enabled=!0,this.type=type,this.$element=$(element),this.options=this.getOptions(options),this.$viewport=this.options.viewport&&$($.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var triggers=this.options.trigger.split(" "),i=triggers.length;i--;){var trigger=triggers[i];if("click"==trigger)this.$element.on("click."+this.type,this.options.selector,$.proxy(this.toggle,this));else if("manual"!=trigger){var eventIn="hover"==trigger?"mouseenter":"focusin",eventOut="hover"==trigger?"mouseleave":"focusout";this.$element.on(eventIn+"."+this.type,this.options.selector,$.proxy(this.enter,this)),this.$element.on(eventOut+"."+this.type,this.options.selector,$.proxy(this.leave,this))}}this.options.selector?this._options=$.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},Tooltip.prototype.getDefaults=function(){return Tooltip.DEFAULTS},Tooltip.prototype.getOptions=function(options){return options=$.extend({},this.getDefaults(),this.$element.data(),options),options.delay&&"number"==typeof options.delay&&(options.delay={show:options.delay,hide:options.delay}),options},Tooltip.prototype.getDelegateOptions=function(){var options={},defaults=this.getDefaults();return this._options&&$.each(this._options,function(key,value){defaults[key]!=value&&(options[key]=value)}),options},Tooltip.prototype.enter=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data("bs."+this.type);return self||(self=new this.constructor(obj.currentTarget,this.getDelegateOptions()),$(obj.currentTarget).data("bs."+this.type,self)),obj instanceof $.Event&&(self.inState["focusin"==obj.type?"focus":"hover"]=!0),self.tip().hasClass("in")||"in"==self.hoverState?void(self.hoverState="in"):(clearTimeout(self.timeout),self.hoverState="in",self.options.delay&&self.options.delay.show?void(self.timeout=setTimeout(function(){"in"==self.hoverState&&self.show()},self.options.delay.show)):self.show())},Tooltip.prototype.isInStateTrue=function(){for(var key in this.inState)if(this.inState[key])return!0;return!1},Tooltip.prototype.leave=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data("bs."+this.type);if(self||(self=new this.constructor(obj.currentTarget,this.getDelegateOptions()),$(obj.currentTarget).data("bs."+this.type,self)),obj instanceof $.Event&&(self.inState["focusout"==obj.type?"focus":"hover"]=!1),!self.isInStateTrue())return clearTimeout(self.timeout),self.hoverState="out",self.options.delay&&self.options.delay.hide?void(self.timeout=setTimeout(function(){"out"==self.hoverState&&self.hide()},self.options.delay.hide)):self.hide()},Tooltip.prototype.show=function(){var e=$.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var inDom=$.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!inDom)return;var that=this,$tip=this.tip(),tipId=this.getUID(this.type);this.setContent(),$tip.attr("id",tipId),this.$element.attr("aria-describedby",tipId),this.options.animation&&$tip.addClass("fade");var placement="function"==typeof this.options.placement?this.options.placement.call(this,$tip[0],this.$element[0]):this.options.placement,autoToken=/\s?auto?\s?/i,autoPlace=autoToken.test(placement);autoPlace&&(placement=placement.replace(autoToken,"")||"top"),$tip.detach().css({top:0,left:0,display:"block"}).addClass(placement).data("bs."+this.type,this),this.options.container?$tip.appendTo(this.options.container):$tip.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var pos=this.getPosition(),actualWidth=$tip[0].offsetWidth,actualHeight=$tip[0].offsetHeight;if(autoPlace){var orgPlacement=placement,viewportDim=this.getPosition(this.$viewport);placement="bottom"==placement&&pos.bottom+actualHeight>viewportDim.bottom?"top":"top"==placement&&pos.top-actualHeight<viewportDim.top?"bottom":"right"==placement&&pos.right+actualWidth>viewportDim.width?"left":"left"==placement&&pos.left-actualWidth<viewportDim.left?"right":placement,$tip.removeClass(orgPlacement).addClass(placement)}var calculatedOffset=this.getCalculatedOffset(placement,pos,actualWidth,actualHeight);this.applyPlacement(calculatedOffset,placement);var complete=function(){var prevHoverState=that.hoverState;that.$element.trigger("shown.bs."+that.type),that.hoverState=null,"out"==prevHoverState&&that.leave(that)};$.support.transition&&this.$tip.hasClass("fade")?$tip.one("bsTransitionEnd",complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete()}},Tooltip.prototype.applyPlacement=function(offset,placement){var $tip=this.tip(),width=$tip[0].offsetWidth,height=$tip[0].offsetHeight,marginTop=parseInt($tip.css("margin-top"),10),marginLeft=parseInt($tip.css("margin-left"),10);isNaN(marginTop)&&(marginTop=0),isNaN(marginLeft)&&(marginLeft=0),offset.top+=marginTop,offset.left+=marginLeft,$.offset.setOffset($tip[0],$.extend({using:function(props){$tip.css({top:Math.round(props.top),left:Math.round(props.left)})}},offset),0),$tip.addClass("in");var actualWidth=$tip[0].offsetWidth,actualHeight=$tip[0].offsetHeight;"top"==placement&&actualHeight!=height&&(offset.top=offset.top+height-actualHeight);var delta=this.getViewportAdjustedDelta(placement,offset,actualWidth,actualHeight);delta.left?offset.left+=delta.left:offset.top+=delta.top;var isVertical=/top|bottom/.test(placement),arrowDelta=isVertical?2*delta.left-width+actualWidth:2*delta.top-height+actualHeight,arrowOffsetPosition=isVertical?"offsetWidth":"offsetHeight";$tip.offset(offset),this.replaceArrow(arrowDelta,$tip[0][arrowOffsetPosition],isVertical)},Tooltip.prototype.replaceArrow=function(delta,dimension,isVertical){this.arrow().css(isVertical?"left":"top",50*(1-delta/dimension)+"%").css(isVertical?"top":"left","")},Tooltip.prototype.setContent=function(){var $tip=this.tip(),title=this.getTitle();$tip.find(".tooltip-inner")[this.options.html?"html":"text"](title),$tip.removeClass("fade in top bottom left right");
},Tooltip.prototype.hide=function(callback){function complete(){"in"!=that.hoverState&&$tip.detach(),that.$element&&that.$element.removeAttr("aria-describedby").trigger("hidden.bs."+that.type),callback&&callback()}var that=this,$tip=$(this.$tip),e=$.Event("hide.bs."+this.type);if(this.$element.trigger(e),!e.isDefaultPrevented())return $tip.removeClass("in"),$.support.transition&&$tip.hasClass("fade")?$tip.one("bsTransitionEnd",complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete(),this.hoverState=null,this},Tooltip.prototype.fixTitle=function(){var $e=this.$element;($e.attr("title")||"string"!=typeof $e.attr("data-original-title"))&&$e.attr("data-original-title",$e.attr("title")||"").attr("title","")},Tooltip.prototype.hasContent=function(){return this.getTitle()},Tooltip.prototype.getPosition=function($element){$element=$element||this.$element;var el=$element[0],isBody="BODY"==el.tagName,elRect=el.getBoundingClientRect();null==elRect.width&&(elRect=$.extend({},elRect,{width:elRect.right-elRect.left,height:elRect.bottom-elRect.top}));var isSvg=window.SVGElement&&el instanceof window.SVGElement,elOffset=isBody?{top:0,left:0}:isSvg?null:$element.offset(),scroll={scroll:isBody?document.documentElement.scrollTop||document.body.scrollTop:$element.scrollTop()},outerDims=isBody?{width:$(window).width(),height:$(window).height()}:null;return $.extend({},elRect,scroll,outerDims,elOffset)},Tooltip.prototype.getCalculatedOffset=function(placement,pos,actualWidth,actualHeight){return"bottom"==placement?{top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}:"top"==placement?{top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2}:"left"==placement?{top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth}:{top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width}},Tooltip.prototype.getViewportAdjustedDelta=function(placement,pos,actualWidth,actualHeight){var delta={top:0,left:0};if(!this.$viewport)return delta;var viewportPadding=this.options.viewport&&this.options.viewport.padding||0,viewportDimensions=this.getPosition(this.$viewport);if(/right|left/.test(placement)){var topEdgeOffset=pos.top-viewportPadding-viewportDimensions.scroll,bottomEdgeOffset=pos.top+viewportPadding-viewportDimensions.scroll+actualHeight;topEdgeOffset<viewportDimensions.top?delta.top=viewportDimensions.top-topEdgeOffset:bottomEdgeOffset>viewportDimensions.top+viewportDimensions.height&&(delta.top=viewportDimensions.top+viewportDimensions.height-bottomEdgeOffset)}else{var leftEdgeOffset=pos.left-viewportPadding,rightEdgeOffset=pos.left+viewportPadding+actualWidth;leftEdgeOffset<viewportDimensions.left?delta.left=viewportDimensions.left-leftEdgeOffset:rightEdgeOffset>viewportDimensions.right&&(delta.left=viewportDimensions.left+viewportDimensions.width-rightEdgeOffset)}return delta},Tooltip.prototype.getTitle=function(){var title,$e=this.$element,o=this.options;return title=$e.attr("data-original-title")||("function"==typeof o.title?o.title.call($e[0]):o.title)},Tooltip.prototype.getUID=function(prefix){do prefix+=~~(1e6*Math.random());while(document.getElementById(prefix));return prefix},Tooltip.prototype.tip=function(){if(!this.$tip&&(this.$tip=$(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},Tooltip.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},Tooltip.prototype.enable=function(){this.enabled=!0},Tooltip.prototype.disable=function(){this.enabled=!1},Tooltip.prototype.toggleEnabled=function(){this.enabled=!this.enabled},Tooltip.prototype.toggle=function(e){var self=this;e&&(self=$(e.currentTarget).data("bs."+this.type),self||(self=new this.constructor(e.currentTarget,this.getDelegateOptions()),$(e.currentTarget).data("bs."+this.type,self))),e?(self.inState.click=!self.inState.click,self.isInStateTrue()?self.enter(self):self.leave(self)):self.tip().hasClass("in")?self.leave(self):self.enter(self)},Tooltip.prototype.destroy=function(){var that=this;clearTimeout(this.timeout),this.hide(function(){that.$element.off("."+that.type).removeData("bs."+that.type),that.$tip&&that.$tip.detach(),that.$tip=null,that.$arrow=null,that.$viewport=null,that.$element=null})};var old=$.fn.tooltip;$.fn.tooltip=Plugin,$.fn.tooltip.Constructor=Tooltip,$.fn.tooltip.noConflict=function(){return $.fn.tooltip=old,this}}(jQuery),+function($){function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.popover"),options="object"==typeof option&&option;!data&&/destroy|hide/.test(option)||(data||$this.data("bs.popover",data=new Popover(this,options)),"string"==typeof option&&data[option]())})}var Popover=function(element,options){this.init("popover",element,options)};if(!$.fn.tooltip)throw new Error("Popover requires tooltip.js");Popover.VERSION="3.3.7",Popover.DEFAULTS=$.extend({},$.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),Popover.prototype=$.extend({},$.fn.tooltip.Constructor.prototype),Popover.prototype.constructor=Popover,Popover.prototype.getDefaults=function(){return Popover.DEFAULTS},Popover.prototype.setContent=function(){var $tip=this.tip(),title=this.getTitle(),content=this.getContent();$tip.find(".popover-title")[this.options.html?"html":"text"](title),$tip.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof content?"html":"append":"text"](content),$tip.removeClass("fade top bottom left right in"),$tip.find(".popover-title").html()||$tip.find(".popover-title").hide()},Popover.prototype.hasContent=function(){return this.getTitle()||this.getContent()},Popover.prototype.getContent=function(){var $e=this.$element,o=this.options;return $e.attr("data-content")||("function"==typeof o.content?o.content.call($e[0]):o.content)},Popover.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var old=$.fn.popover;$.fn.popover=Plugin,$.fn.popover.Constructor=Popover,$.fn.popover.noConflict=function(){return $.fn.popover=old,this}}(jQuery),+function($){function ScrollSpy(element,options){this.$body=$(document.body),this.$scrollElement=$($(element).is(document.body)?window:element),this.options=$.extend({},ScrollSpy.DEFAULTS,options),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",$.proxy(this.process,this)),this.refresh(),this.process()}function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.scrollspy"),options="object"==typeof option&&option;data||$this.data("bs.scrollspy",data=new ScrollSpy(this,options)),"string"==typeof option&&data[option]()})}ScrollSpy.VERSION="3.3.7",ScrollSpy.DEFAULTS={offset:10},ScrollSpy.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},ScrollSpy.prototype.refresh=function(){var that=this,offsetMethod="offset",offsetBase=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),$.isWindow(this.$scrollElement[0])||(offsetMethod="position",offsetBase=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var $el=$(this),href=$el.data("target")||$el.attr("href"),$href=/^#./.test(href)&&$(href);return $href&&$href.length&&$href.is(":visible")&&[[$href[offsetMethod]().top+offsetBase,href]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){that.offsets.push(this[0]),that.targets.push(this[1])})},ScrollSpy.prototype.process=function(){var i,scrollTop=this.$scrollElement.scrollTop()+this.options.offset,scrollHeight=this.getScrollHeight(),maxScroll=this.options.offset+scrollHeight-this.$scrollElement.height(),offsets=this.offsets,targets=this.targets,activeTarget=this.activeTarget;if(this.scrollHeight!=scrollHeight&&this.refresh(),scrollTop>=maxScroll)return activeTarget!=(i=targets[targets.length-1])&&this.activate(i);if(activeTarget&&scrollTop<offsets[0])return this.activeTarget=null,this.clear();for(i=offsets.length;i--;)activeTarget!=targets[i]&&scrollTop>=offsets[i]&&(void 0===offsets[i+1]||scrollTop<offsets[i+1])&&this.activate(targets[i])},ScrollSpy.prototype.activate=function(target){this.activeTarget=target,this.clear();var selector=this.selector+'[data-target="'+target+'"],'+this.selector+'[href="'+target+'"]',active=$(selector).parents("li").addClass("active");active.parent(".dropdown-menu").length&&(active=active.closest("li.dropdown").addClass("active")),active.trigger("activate.bs.scrollspy")},ScrollSpy.prototype.clear=function(){$(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var old=$.fn.scrollspy;$.fn.scrollspy=Plugin,$.fn.scrollspy.Constructor=ScrollSpy,$.fn.scrollspy.noConflict=function(){return $.fn.scrollspy=old,this},$(window).on("load.bs.scrollspy.data-api",function(){$('[data-spy="scroll"]').each(function(){var $spy=$(this);Plugin.call($spy,$spy.data())})})}(jQuery),+function($){function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.tab");data||$this.data("bs.tab",data=new Tab(this)),"string"==typeof option&&data[option]()})}var Tab=function(element){this.element=$(element)};Tab.VERSION="3.3.7",Tab.TRANSITION_DURATION=150,Tab.prototype.show=function(){var $this=this.element,$ul=$this.closest("ul:not(.dropdown-menu)"),selector=$this.data("target");if(selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")),!$this.parent("li").hasClass("active")){var $previous=$ul.find(".active:last a"),hideEvent=$.Event("hide.bs.tab",{relatedTarget:$this[0]}),showEvent=$.Event("show.bs.tab",{relatedTarget:$previous[0]});if($previous.trigger(hideEvent),$this.trigger(showEvent),!showEvent.isDefaultPrevented()&&!hideEvent.isDefaultPrevented()){var $target=$(selector);this.activate($this.closest("li"),$ul),this.activate($target,$target.parent(),function(){$previous.trigger({type:"hidden.bs.tab",relatedTarget:$this[0]}),$this.trigger({type:"shown.bs.tab",relatedTarget:$previous[0]})})}}},Tab.prototype.activate=function(element,container,callback){function next(){$active.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),element.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),transition?(element[0].offsetWidth,element.addClass("in")):element.removeClass("fade"),element.parent(".dropdown-menu").length&&element.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),callback&&callback()}var $active=container.find("> .active"),transition=callback&&$.support.transition&&($active.length&&$active.hasClass("fade")||!!container.find("> .fade").length);$active.length&&transition?$active.one("bsTransitionEnd",next).emulateTransitionEnd(Tab.TRANSITION_DURATION):next(),$active.removeClass("in")};var old=$.fn.tab;$.fn.tab=Plugin,$.fn.tab.Constructor=Tab,$.fn.tab.noConflict=function(){return $.fn.tab=old,this};var clickHandler=function(e){e.preventDefault(),Plugin.call($(this),"show")};$(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',clickHandler).on("click.bs.tab.data-api",'[data-toggle="pill"]',clickHandler)}(jQuery),+function($){function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.affix"),options="object"==typeof option&&option;data||$this.data("bs.affix",data=new Affix(this,options)),"string"==typeof option&&data[option]()})}var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options),this.$target=$(this.options.target).on("scroll.bs.affix.data-api",$.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",$.proxy(this.checkPositionWithEventLoop,this)),this.$element=$(element),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};Affix.VERSION="3.3.7",Affix.RESET="affix affix-top affix-bottom",Affix.DEFAULTS={offset:0,target:window},Affix.prototype.getState=function(scrollHeight,height,offsetTop,offsetBottom){var scrollTop=this.$target.scrollTop(),position=this.$element.offset(),targetHeight=this.$target.height();if(null!=offsetTop&&"top"==this.affixed)return scrollTop<offsetTop&&"top";if("bottom"==this.affixed)return null!=offsetTop?!(scrollTop+this.unpin<=position.top)&&"bottom":!(scrollTop+targetHeight<=scrollHeight-offsetBottom)&&"bottom";var initializing=null==this.affixed,colliderTop=initializing?scrollTop:position.top,colliderHeight=initializing?targetHeight:height;return null!=offsetTop&&scrollTop<=offsetTop?"top":null!=offsetBottom&&colliderTop+colliderHeight>=scrollHeight-offsetBottom&&"bottom"},Affix.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(Affix.RESET).addClass("affix");var scrollTop=this.$target.scrollTop(),position=this.$element.offset();return this.pinnedOffset=position.top-scrollTop},Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)},Affix.prototype.checkPosition=function(){if(this.$element.is(":visible")){var height=this.$element.height(),offset=this.options.offset,offsetTop=offset.top,offsetBottom=offset.bottom,scrollHeight=Math.max($(document).height(),$(document.body).height());"object"!=typeof offset&&(offsetBottom=offsetTop=offset),"function"==typeof offsetTop&&(offsetTop=offset.top(this.$element)),"function"==typeof offsetBottom&&(offsetBottom=offset.bottom(this.$element));var affix=this.getState(scrollHeight,height,offsetTop,offsetBottom);if(this.affixed!=affix){null!=this.unpin&&this.$element.css("top","");var affixType="affix"+(affix?"-"+affix:""),e=$.Event(affixType+".bs.affix");if(this.$element.trigger(e),e.isDefaultPrevented())return;this.affixed=affix,this.unpin="bottom"==affix?this.getPinnedOffset():null,this.$element.removeClass(Affix.RESET).addClass(affixType).trigger(affixType.replace("affix","affixed")+".bs.affix")}"bottom"==affix&&this.$element.offset({top:scrollHeight-height-offsetBottom})}};var old=$.fn.affix;$.fn.affix=Plugin,$.fn.affix.Constructor=Affix,$.fn.affix.noConflict=function(){return $.fn.affix=old,this},$(window).on("load",function(){$('[data-spy="affix"]').each(function(){var $spy=$(this),data=$spy.data();data.offset=data.offset||{},null!=data.offsetBottom&&(data.offset.bottom=data.offsetBottom),null!=data.offsetTop&&(data.offset.top=data.offsetTop),Plugin.call($spy,data)})})}(jQuery),function(window,angular,undefined){function $RouteProvider(){function inherit(parent,extra){return angular.extend(Object.create(parent),extra)}function pathRegExp(path,opts){var insensitive=opts.caseInsensitiveMatch,ret={originalPath:path,regexp:path},keys=ret.keys=[];return path=path.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(_,slash,key,option){var optional="?"===option?option:null,star="*"===option?option:null;return keys.push({name:key,optional:!!optional}),slash=slash||"",""+(optional?"":slash)+"(?:"+(optional?slash:"")+(star&&"(.+?)"||"([^/]+)")+(optional||"")+")"+(optional||"")}).replace(/([\/$\*])/g,"\\$1"),ret.regexp=new RegExp("^"+path+"$",insensitive?"i":""),ret}var routes={};this.when=function(path,route){var routeCopy=angular.copy(route);if(angular.isUndefined(routeCopy.reloadOnSearch)&&(routeCopy.reloadOnSearch=!0),angular.isUndefined(routeCopy.caseInsensitiveMatch)&&(routeCopy.caseInsensitiveMatch=this.caseInsensitiveMatch),routes[path]=angular.extend(routeCopy,path&&pathRegExp(path,routeCopy)),path){var redirectPath="/"==path[path.length-1]?path.substr(0,path.length-1):path+"/";routes[redirectPath]=angular.extend({redirectTo:path},pathRegExp(redirectPath,routeCopy))}return this},this.caseInsensitiveMatch=!1,this.otherwise=function(params){return"string"==typeof params&&(params={redirectTo:params}),this.when(null,params),this},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce",function($rootScope,$location,$routeParams,$q,$injector,$templateRequest,$sce){function switchRouteMatcher(on,route){var keys=route.keys,params={};if(!route.regexp)return null;var m=route.regexp.exec(on);if(!m)return null;for(var i=1,len=m.length;i<len;++i){var key=keys[i-1],val=m[i];key&&val&&(params[key.name]=val)}return params}function prepareRoute($locationEvent){var lastRoute=$route.current;preparedRoute=parseRoute(),preparedRouteIsUpdateOnly=preparedRoute&&lastRoute&&preparedRoute.$$route===lastRoute.$$route&&angular.equals(preparedRoute.pathParams,lastRoute.pathParams)&&!preparedRoute.reloadOnSearch&&!forceReload,preparedRouteIsUpdateOnly||!lastRoute&&!preparedRoute||$rootScope.$broadcast("$routeChangeStart",preparedRoute,lastRoute).defaultPrevented&&$locationEvent&&$locationEvent.preventDefault()}function commitRoute(){var lastRoute=$route.current,nextRoute=preparedRoute;preparedRouteIsUpdateOnly?(lastRoute.params=nextRoute.params,angular.copy(lastRoute.params,$routeParams),$rootScope.$broadcast("$routeUpdate",lastRoute)):(nextRoute||lastRoute)&&(forceReload=!1,$route.current=nextRoute,nextRoute&&nextRoute.redirectTo&&(angular.isString(nextRoute.redirectTo)?$location.path(interpolate(nextRoute.redirectTo,nextRoute.params)).search(nextRoute.params).replace():$location.url(nextRoute.redirectTo(nextRoute.pathParams,$location.path(),$location.search())).replace()),$q.when(nextRoute).then(function(){if(nextRoute){var template,templateUrl,locals=angular.extend({},nextRoute.resolve);return angular.forEach(locals,function(value,key){locals[key]=angular.isString(value)?$injector.get(value):$injector.invoke(value,null,null,key)}),angular.isDefined(template=nextRoute.template)?angular.isFunction(template)&&(template=template(nextRoute.params)):angular.isDefined(templateUrl=nextRoute.templateUrl)&&(angular.isFunction(templateUrl)&&(templateUrl=templateUrl(nextRoute.params)),angular.isDefined(templateUrl)&&(nextRoute.loadedTemplateUrl=$sce.valueOf(templateUrl),template=$templateRequest(templateUrl))),angular.isDefined(template)&&(locals.$template=template),$q.all(locals)}}).then(function(locals){nextRoute==$route.current&&(nextRoute&&(nextRoute.locals=locals,angular.copy(nextRoute.params,$routeParams)),$rootScope.$broadcast("$routeChangeSuccess",nextRoute,lastRoute))},function(error){nextRoute==$route.current&&$rootScope.$broadcast("$routeChangeError",nextRoute,lastRoute,error)}))}function parseRoute(){var params,match;return angular.forEach(routes,function(route,path){!match&&(params=switchRouteMatcher($location.path(),route))&&(match=inherit(route,{params:angular.extend({},$location.search(),params),pathParams:params}),match.$$route=route)}),match||routes[null]&&inherit(routes[null],{params:{},pathParams:{}})}function interpolate(string,params){var result=[];return angular.forEach((string||"").split(":"),function(segment,i){if(0===i)result.push(segment);else{var segmentMatch=segment.match(/(\w+)(?:[?*])?(.*)/),key=segmentMatch[1];result.push(params[key]),result.push(segmentMatch[2]||""),delete params[key]}}),result.join("")}var preparedRoute,preparedRouteIsUpdateOnly,forceReload=!1,$route={routes:routes,reload:function(){forceReload=!0,$rootScope.$evalAsync(function(){prepareRoute(),commitRoute()})},updateParams:function(newParams){if(!this.current||!this.current.$$route)throw $routeMinErr("norout","Tried updating route when with no current route");newParams=angular.extend({},this.current.params,newParams),$location.path(interpolate(this.current.$$route.originalPath,newParams)),$location.search(newParams)}};return $rootScope.$on("$locationChangeStart",prepareRoute),$rootScope.$on("$locationChangeSuccess",commitRoute),$route}]}function $RouteParamsProvider(){this.$get=function(){return{}}}function ngViewFactory($route,$anchorScroll,$animate){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(scope,$element,attr,ctrl,$transclude){function cleanupLastView(){previousLeaveAnimation&&($animate.cancel(previousLeaveAnimation),previousLeaveAnimation=null),currentScope&&(currentScope.$destroy(),currentScope=null),currentElement&&(previousLeaveAnimation=$animate.leave(currentElement),previousLeaveAnimation.then(function(){previousLeaveAnimation=null}),currentElement=null)}function update(){var locals=$route.current&&$route.current.locals,template=locals&&locals.$template;if(angular.isDefined(template)){var newScope=scope.$new(),current=$route.current,clone=$transclude(newScope,function(clone){$animate.enter(clone,null,currentElement||$element).then(function(){!angular.isDefined(autoScrollExp)||autoScrollExp&&!scope.$eval(autoScrollExp)||$anchorScroll()}),cleanupLastView()});currentElement=clone,currentScope=current.scope=newScope,currentScope.$emit("$viewContentLoaded"),currentScope.$eval(onloadExp)}else cleanupLastView()}var currentScope,currentElement,previousLeaveAnimation,autoScrollExp=attr.autoscroll,onloadExp=attr.onload||"";scope.$on("$routeChangeSuccess",update),update()}}}function ngViewFillContentFactory($compile,$controller,$route){return{restrict:"ECA",priority:-400,link:function(scope,$element){var current=$route.current,locals=current.locals;$element.html(locals.$template);var link=$compile($element.contents());if(current.controller){locals.$scope=scope;var controller=$controller(current.controller,locals);current.controllerAs&&(scope[current.controllerAs]=controller),$element.data("$ngControllerController",controller),$element.children().data("$ngControllerController",controller)}link(scope)}}}var ngRouteModule=angular.module("ngRoute",["ng"]).provider("$route",$RouteProvider),$routeMinErr=angular.$$minErr("ngRoute");ngRouteModule.provider("$routeParams",$RouteParamsProvider),ngRouteModule.directive("ngView",ngViewFactory),ngRouteModule.directive("ngView",ngViewFillContentFactory),ngViewFactory.$inject=["$route","$anchorScroll","$animate"],ngViewFillContentFactory.$inject=["$compile","$controller","$route"]}(window,window.angular),function(window,angular,undefined){function $$CookieWriter($document,$log,$browser){function buildCookieString(name,value,options){var path,expires;options=options||{},expires=options.expires,path=angular.isDefined(options.path)?options.path:cookiePath,angular.isUndefined(value)&&(expires="Thu, 01 Jan 1970 00:00:00 GMT",value=""),angular.isString(expires)&&(expires=new Date(expires));var str=encodeURIComponent(name)+"="+encodeURIComponent(value);str+=path?";path="+path:"",str+=options.domain?";domain="+options.domain:"",str+=expires?";expires="+expires.toUTCString():"",str+=options.secure?";secure":"";var cookieLength=str.length+1;return cookieLength>4096&&$log.warn("Cookie '"+name+"' possibly not set or overflowed because it was too large ("+cookieLength+" > 4096 bytes)!"),str}var cookiePath=$browser.baseHref(),rawDocument=$document[0];return function(name,value,options){rawDocument.cookie=buildCookieString(name,value,options)}}angular.module("ngCookies",["ng"]).provider("$cookies",[function(){function calcOptions(options){return options?angular.extend({},defaults,options):defaults}var defaults=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function($$cookieReader,$$cookieWriter){return{get:function(key){return $$cookieReader()[key]},getObject:function(key){var value=this.get(key);return value?angular.fromJson(value):value},getAll:function(){return $$cookieReader()},put:function(key,value,options){$$cookieWriter(key,value,calcOptions(options))},putObject:function(key,value,options){this.put(key,angular.toJson(value),options)},remove:function(key,options){$$cookieWriter(key,undefined,calcOptions(options))}}}]}]),angular.module("ngCookies").factory("$cookieStore",["$cookies",function($cookies){return{get:function(key){return $cookies.getObject(key)},put:function(key,value){$cookies.putObject(key,value)},remove:function(key){$cookies.remove(key)}}}]),$$CookieWriter.$inject=["$document","$log","$browser"],angular.module("ngCookies").provider("$$cookieWriter",function(){this.$get=$$CookieWriter})}(window,window.angular),function(window,angular,undefined){function isValidDottedPath(path){return null!=path&&""!==path&&"hasOwnProperty"!==path&&MEMBER_NAME_REGEX.test("."+path)}function lookupDottedPath(obj,path){if(!isValidDottedPath(path))throw $resourceMinErr("badmember",'Dotted member path "@{0}" is invalid.',path);for(var keys=path.split("."),i=0,ii=keys.length;i<ii&&angular.isDefined(obj);i++){var key=keys[i];obj=null!==obj?obj[key]:undefined}return obj}function shallowClearAndCopy(src,dst){dst=dst||{},angular.forEach(dst,function(value,key){delete dst[key]});for(var key in src)!src.hasOwnProperty(key)||"$"===key.charAt(0)&&"$"===key.charAt(1)||(dst[key]=src[key]);return dst}var $resourceMinErr=angular.$$minErr("$resource"),MEMBER_NAME_REGEX=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;angular.module("ngResource",["ng"]).provider("$resource",function(){var PROTOCOL_AND_DOMAIN_REGEX=/^https?:\/\/[^\/]*/,provider=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},delete:{method:"DELETE"}}},this.$get=["$http","$q",function($http,$q){function encodeUriSegment(val){return encodeUriQuery(val,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function encodeUriQuery(val,pctEncodeSpaces){return encodeURIComponent(val).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,pctEncodeSpaces?"%20":"+")}function Route(template,defaults){this.template=template,this.defaults=extend({},provider.defaults,defaults),this.urlParams={}}function resourceFactory(url,paramDefaults,actions,options){function extractParams(data,actionParams){var ids={};return actionParams=extend({},paramDefaults,actionParams),forEach(actionParams,function(value,key){isFunction(value)&&(value=value()),ids[key]=value&&value.charAt&&"@"==value.charAt(0)?lookupDottedPath(data,value.substr(1)):value}),ids}function defaultResponseInterceptor(response){return response.resource}function Resource(value){shallowClearAndCopy(value||{},this)}var route=new Route(url,options);return actions=extend({},provider.defaults.actions,actions),Resource.prototype.toJSON=function(){var data=extend({},this);return delete data.$promise,delete data.$resolved,data},forEach(actions,function(action,name){var hasBody=/^(POST|PUT|PATCH)$/i.test(action.method);Resource[name]=function(a1,a2,a3,a4){var data,success,error,params={};switch(arguments.length){case 4:error=a4,success=a3;case 3:case 2:if(!isFunction(a2)){params=a1,data=a2,success=a3;break}if(isFunction(a1)){success=a1,error=a2;break}success=a2,error=a3;case 1:isFunction(a1)?success=a1:hasBody?data=a1:params=a1;break;case 0:break;default:throw $resourceMinErr("badargs","Expected up to 4 arguments [params, data, success, error], got {0} arguments",arguments.length)}var isInstanceCall=this instanceof Resource,value=isInstanceCall?data:action.isArray?[]:new Resource(data),httpConfig={},responseInterceptor=action.interceptor&&action.interceptor.response||defaultResponseInterceptor,responseErrorInterceptor=action.interceptor&&action.interceptor.responseError||undefined;forEach(action,function(value,key){"params"!=key&&"isArray"!=key&&"interceptor"!=key&&(httpConfig[key]=copy(value))}),hasBody&&(httpConfig.data=data),route.setUrlParams(httpConfig,extend({},extractParams(data,action.params||{}),params),action.url);var promise=$http(httpConfig).then(function(response){var data=response.data,promise=value.$promise;if(data){if(angular.isArray(data)!==!!action.isArray)throw $resourceMinErr("badcfg","Error in resource configuration for action `{0}`. Expected response to contain an {1} but got an {2} (Request: {3} {4})",name,action.isArray?"array":"object",angular.isArray(data)?"array":"object",httpConfig.method,httpConfig.url);action.isArray?(value.length=0,forEach(data,function(item){"object"==typeof item?value.push(new Resource(item)):value.push(item)})):(shallowClearAndCopy(data,value),value.$promise=promise)}return value.$resolved=!0,response.resource=value,response},function(response){return value.$resolved=!0,(error||noop)(response),$q.reject(response)});return promise=promise.then(function(response){var value=responseInterceptor(response);return(success||noop)(value,response.headers),value},responseErrorInterceptor),isInstanceCall?promise:(value.$promise=promise,value.$resolved=!1,value)},Resource.prototype["$"+name]=function(params,success,error){isFunction(params)&&(error=success,success=params,params={});var result=Resource[name].call(this,params,this,success,error);return result.$promise||result}}),Resource.bind=function(additionalParamDefaults){return resourceFactory(url,extend({},paramDefaults,additionalParamDefaults),actions)},Resource}var noop=angular.noop,forEach=angular.forEach,extend=angular.extend,copy=angular.copy,isFunction=angular.isFunction;return Route.prototype={setUrlParams:function(config,params,actionUrl){var val,encodedVal,self=this,url=actionUrl||self.template,protocolAndDomain="",urlParams=self.urlParams={};forEach(url.split(/\W/),function(param){if("hasOwnProperty"===param)throw $resourceMinErr("badname","hasOwnProperty is not a valid parameter name.");!new RegExp("^\\d+$").test(param)&&param&&new RegExp("(^|[^\\\\]):"+param+"(\\W|$)").test(url)&&(urlParams[param]=!0)}),url=url.replace(/\\:/g,":"),url=url.replace(PROTOCOL_AND_DOMAIN_REGEX,function(match){return protocolAndDomain=match,""}),params=params||{},forEach(self.urlParams,function(_,urlParam){val=params.hasOwnProperty(urlParam)?params[urlParam]:self.defaults[urlParam],angular.isDefined(val)&&null!==val?(encodedVal=encodeUriSegment(val),url=url.replace(new RegExp(":"+urlParam+"(\\W|$)","g"),function(match,p1){return encodedVal+p1})):url=url.replace(new RegExp("(/?):"+urlParam+"(\\W|$)","g"),function(match,leadingSlashes,tail){return"/"==tail.charAt(0)?tail:leadingSlashes+tail})}),self.defaults.stripTrailingSlashes&&(url=url.replace(/\/+$/,"")||"/"),url=url.replace(/\/\.(?=\w+($|\?))/,"."),config.url=protocolAndDomain+url.replace(/\/\\\./,"/."),forEach(params,function(value,key){self.urlParams[key]||(config.params=config.params||{},config.params[key]=value)})}},resourceFactory}]})}(window,window.angular),angular.module("ui.bootstrap",["ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.collapse",[]).directive("uibCollapse",["$animate","$injector",function($animate,$injector){var $animateCss=$injector.has("$animateCss")?$injector.get("$animateCss"):null;return{link:function(scope,element,attrs){function expand(){element.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),$animateCss?$animateCss(element,{addClass:"in",easing:"ease",to:{height:element[0].scrollHeight+"px"}}).start().finally(expandDone):$animate.addClass(element,"in",{to:{height:element[0].scrollHeight+"px"}}).then(expandDone)}function expandDone(){element.removeClass("collapsing").addClass("collapse").css({height:"auto"})}function collapse(){return element.hasClass("collapse")||element.hasClass("in")?(element.css({height:element[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),void($animateCss?$animateCss(element,{removeClass:"in",to:{height:"0"}}).start().finally(collapseDone):$animate.removeClass(element,"in",{to:{
height:"0"}}).then(collapseDone))):collapseDone()}function collapseDone(){element.css({height:"0"}),element.removeClass("collapsing").addClass("collapse")}scope.$watch(attrs.uibCollapse,function(shouldCollapse){shouldCollapse?collapse():expand()})}}}]),angular.module("ui.bootstrap.collapse").value("$collapseSuppressWarning",!1).directive("collapse",["$animate","$injector","$log","$collapseSuppressWarning",function($animate,$injector,$log,$collapseSuppressWarning){var $animateCss=$injector.has("$animateCss")?$injector.get("$animateCss"):null;return{link:function(scope,element,attrs){function expand(){element.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),$animateCss?$animateCss(element,{easing:"ease",to:{height:element[0].scrollHeight+"px"}}).start().done(expandDone):$animate.animate(element,{},{height:element[0].scrollHeight+"px"}).then(expandDone)}function expandDone(){element.removeClass("collapsing").addClass("collapse in").css({height:"auto"})}function collapse(){return element.hasClass("collapse")||element.hasClass("in")?(element.css({height:element[0].scrollHeight+"px"}).removeClass("collapse in").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),void($animateCss?$animateCss(element,{to:{height:"0"}}).start().done(collapseDone):$animate.animate(element,{},{height:"0"}).then(collapseDone))):collapseDone()}function collapseDone(){element.css({height:"0"}),element.removeClass("collapsing").addClass("collapse")}$collapseSuppressWarning||$log.warn("collapse is now deprecated. Use uib-collapse instead."),scope.$watch(attrs.collapse,function(shouldCollapse){shouldCollapse?collapse():expand()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("uibAccordionConfig",{closeOthers:!0}).controller("UibAccordionController",["$scope","$attrs","uibAccordionConfig",function($scope,$attrs,accordionConfig){this.groups=[],this.closeOthers=function(openGroup){var closeOthers=angular.isDefined($attrs.closeOthers)?$scope.$eval($attrs.closeOthers):accordionConfig.closeOthers;closeOthers&&angular.forEach(this.groups,function(group){group!==openGroup&&(group.isOpen=!1)})},this.addGroup=function(groupScope){var that=this;this.groups.push(groupScope),groupScope.$on("$destroy",function(event){that.removeGroup(groupScope)})},this.removeGroup=function(group){var index=this.groups.indexOf(group);index!==-1&&this.groups.splice(index,1)}}]).directive("uibAccordion",function(){return{controller:"UibAccordionController",controllerAs:"accordion",transclude:!0,templateUrl:function(element,attrs){return attrs.templateUrl||"template/accordion/accordion.html"}}}).directive("uibAccordionGroup",function(){return{require:"^uibAccordion",transclude:!0,replace:!0,templateUrl:function(element,attrs){return attrs.templateUrl||"template/accordion/accordion-group.html"},scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(element){this.heading=element}},link:function(scope,element,attrs,accordionCtrl){accordionCtrl.addGroup(scope),scope.openClass=attrs.openClass||"panel-open",scope.panelClass=attrs.panelClass,scope.$watch("isOpen",function(value){element.toggleClass(scope.openClass,!!value),value&&accordionCtrl.closeOthers(scope)}),scope.toggleOpen=function($event){scope.isDisabled||$event&&32!==$event.which||(scope.isOpen=!scope.isOpen)}}}}).directive("uibAccordionHeading",function(){return{transclude:!0,template:"",replace:!0,require:"^uibAccordionGroup",link:function(scope,element,attrs,accordionGroupCtrl,transclude){accordionGroupCtrl.setHeading(transclude(scope,angular.noop))}}}).directive("uibAccordionTransclude",function(){return{require:["?^uibAccordionGroup","?^accordionGroup"],link:function(scope,element,attrs,controller){controller=controller[0]?controller[0]:controller[1],scope.$watch(function(){return controller[attrs.uibAccordionTransclude]},function(heading){heading&&(element.find("span").html(""),element.find("span").append(heading))})}}}),angular.module("ui.bootstrap.accordion").value("$accordionSuppressWarning",!1).controller("AccordionController",["$scope","$attrs","$controller","$log","$accordionSuppressWarning",function($scope,$attrs,$controller,$log,$accordionSuppressWarning){$accordionSuppressWarning||$log.warn("AccordionController is now deprecated. Use UibAccordionController instead."),angular.extend(this,$controller("UibAccordionController",{$scope:$scope,$attrs:$attrs}))}]).directive("accordion",["$log","$accordionSuppressWarning",function($log,$accordionSuppressWarning){return{restrict:"EA",controller:"AccordionController",controllerAs:"accordion",transclude:!0,replace:!1,templateUrl:function(element,attrs){return attrs.templateUrl||"template/accordion/accordion.html"},link:function(){$accordionSuppressWarning||$log.warn("accordion is now deprecated. Use uib-accordion instead.")}}}]).directive("accordionGroup",["$log","$accordionSuppressWarning",function($log,$accordionSuppressWarning){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:function(element,attrs){return attrs.templateUrl||"template/accordion/accordion-group.html"},scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(element){this.heading=element}},link:function(scope,element,attrs,accordionCtrl){$accordionSuppressWarning||$log.warn("accordion-group is now deprecated. Use uib-accordion-group instead."),accordionCtrl.addGroup(scope),scope.openClass=attrs.openClass||"panel-open",scope.panelClass=attrs.panelClass,scope.$watch("isOpen",function(value){element.toggleClass(scope.openClass,!!value),value&&accordionCtrl.closeOthers(scope)}),scope.toggleOpen=function($event){scope.isDisabled||$event&&32!==$event.which||(scope.isOpen=!scope.isOpen)}}}}]).directive("accordionHeading",["$log","$accordionSuppressWarning",function($log,$accordionSuppressWarning){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(scope,element,attr,accordionGroupCtrl,transclude){$accordionSuppressWarning||$log.warn("accordion-heading is now deprecated. Use uib-accordion-heading instead."),accordionGroupCtrl.setHeading(transclude(scope,angular.noop))}}}]).directive("accordionTransclude",["$log","$accordionSuppressWarning",function($log,$accordionSuppressWarning){return{require:"^accordionGroup",link:function(scope,element,attr,controller){$accordionSuppressWarning||$log.warn("accordion-transclude is now deprecated. Use uib-accordion-transclude instead."),scope.$watch(function(){return controller[attr.accordionTransclude]},function(heading){heading&&(element.find("span").html(""),element.find("span").append(heading))})}}}]),angular.module("ui.bootstrap.alert",[]).controller("UibAlertController",["$scope","$attrs","$interpolate","$timeout",function($scope,$attrs,$interpolate,$timeout){$scope.closeable=!!$attrs.close;var dismissOnTimeout=angular.isDefined($attrs.dismissOnTimeout)?$interpolate($attrs.dismissOnTimeout)($scope.$parent):null;dismissOnTimeout&&$timeout(function(){$scope.close()},parseInt(dismissOnTimeout,10))}]).directive("uibAlert",function(){return{controller:"UibAlertController",controllerAs:"alert",templateUrl:function(element,attrs){return attrs.templateUrl||"template/alert/alert.html"},transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}),angular.module("ui.bootstrap.alert").value("$alertSuppressWarning",!1).controller("AlertController",["$scope","$attrs","$controller","$log","$alertSuppressWarning",function($scope,$attrs,$controller,$log,$alertSuppressWarning){$alertSuppressWarning||$log.warn("AlertController is now deprecated. Use UibAlertController instead."),angular.extend(this,$controller("UibAlertController",{$scope:$scope,$attrs:$attrs}))}]).directive("alert",["$log","$alertSuppressWarning",function($log,$alertSuppressWarning){return{controller:"AlertController",controllerAs:"alert",templateUrl:function(element,attrs){return attrs.templateUrl||"template/alert/alert.html"},transclude:!0,replace:!0,scope:{type:"@",close:"&"},link:function(){$alertSuppressWarning||$log.warn("alert is now deprecated. Use uib-alert instead.")}}}]),angular.module("ui.bootstrap.buttons",[]).constant("uibButtonConfig",{activeClass:"active",toggleEvent:"click"}).controller("UibButtonsController",["uibButtonConfig",function(buttonConfig){this.activeClass=buttonConfig.activeClass||"active",this.toggleEvent=buttonConfig.toggleEvent||"click"}]).directive("uibBtnRadio",function(){return{require:["uibBtnRadio","ngModel"],controller:"UibButtonsController",controllerAs:"buttons",link:function(scope,element,attrs,ctrls){var buttonsCtrl=ctrls[0],ngModelCtrl=ctrls[1];element.find("input").css({display:"none"}),ngModelCtrl.$render=function(){element.toggleClass(buttonsCtrl.activeClass,angular.equals(ngModelCtrl.$modelValue,scope.$eval(attrs.uibBtnRadio)))},element.on(buttonsCtrl.toggleEvent,function(){if(!attrs.disabled){var isActive=element.hasClass(buttonsCtrl.activeClass);isActive&&!angular.isDefined(attrs.uncheckable)||scope.$apply(function(){ngModelCtrl.$setViewValue(isActive?null:scope.$eval(attrs.uibBtnRadio)),ngModelCtrl.$render()})}})}}}).directive("uibBtnCheckbox",function(){return{require:["uibBtnCheckbox","ngModel"],controller:"UibButtonsController",controllerAs:"button",link:function(scope,element,attrs,ctrls){function getTrueValue(){return getCheckboxValue(attrs.btnCheckboxTrue,!0)}function getFalseValue(){return getCheckboxValue(attrs.btnCheckboxFalse,!1)}function getCheckboxValue(attribute,defaultValue){return angular.isDefined(attribute)?scope.$eval(attribute):defaultValue}var buttonsCtrl=ctrls[0],ngModelCtrl=ctrls[1];element.find("input").css({display:"none"}),ngModelCtrl.$render=function(){element.toggleClass(buttonsCtrl.activeClass,angular.equals(ngModelCtrl.$modelValue,getTrueValue()))},element.on(buttonsCtrl.toggleEvent,function(){attrs.disabled||scope.$apply(function(){ngModelCtrl.$setViewValue(element.hasClass(buttonsCtrl.activeClass)?getFalseValue():getTrueValue()),ngModelCtrl.$render()})})}}}),angular.module("ui.bootstrap.buttons").value("$buttonsSuppressWarning",!1).controller("ButtonsController",["$controller","$log","$buttonsSuppressWarning",function($controller,$log,$buttonsSuppressWarning){$buttonsSuppressWarning||$log.warn("ButtonsController is now deprecated. Use UibButtonsController instead."),angular.extend(this,$controller("UibButtonsController"))}]).directive("btnRadio",["$log","$buttonsSuppressWarning",function($log,$buttonsSuppressWarning){return{require:["btnRadio","ngModel"],controller:"ButtonsController",controllerAs:"buttons",link:function(scope,element,attrs,ctrls){$buttonsSuppressWarning||$log.warn("btn-radio is now deprecated. Use uib-btn-radio instead.");var buttonsCtrl=ctrls[0],ngModelCtrl=ctrls[1];element.find("input").css({display:"none"}),ngModelCtrl.$render=function(){element.toggleClass(buttonsCtrl.activeClass,angular.equals(ngModelCtrl.$modelValue,scope.$eval(attrs.btnRadio)))},element.bind(buttonsCtrl.toggleEvent,function(){if(!attrs.disabled){var isActive=element.hasClass(buttonsCtrl.activeClass);isActive&&!angular.isDefined(attrs.uncheckable)||scope.$apply(function(){ngModelCtrl.$setViewValue(isActive?null:scope.$eval(attrs.btnRadio)),ngModelCtrl.$render()})}})}}}]).directive("btnCheckbox",["$document","$log","$buttonsSuppressWarning",function($document,$log,$buttonsSuppressWarning){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",controllerAs:"button",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}$buttonsSuppressWarning||$log.warn("btn-checkbox is now deprecated. Use uib-btn-checkbox instead.");var buttonsCtrl=ctrls[0],ngModelCtrl=ctrls[1];element.find("input").css({display:"none"}),ngModelCtrl.$render=function(){element.toggleClass(buttonsCtrl.activeClass,angular.equals(ngModelCtrl.$modelValue,getTrueValue()))},element.bind(buttonsCtrl.toggleEvent,function(){attrs.disabled||scope.$apply(function(){ngModelCtrl.$setViewValue(element.hasClass(buttonsCtrl.activeClass)?getFalseValue():getTrueValue()),ngModelCtrl.$render()})}),element.on("keypress",function(e){attrs.disabled||32!==e.which||$document[0].activeElement!==element[0]||scope.$apply(function(){ngModelCtrl.$setViewValue(element.hasClass(buttonsCtrl.activeClass)?getFalseValue():getTrueValue()),ngModelCtrl.$render()})})}}}]),angular.module("ui.bootstrap.carousel",[]).controller("UibCarouselController",["$scope","$element","$interval","$animate",function($scope,$element,$interval,$animate){function goNext(slide,index,direction){destroyed||(angular.extend(slide,{direction:direction,active:!0}),angular.extend(self.currentSlide||{},{direction:direction,active:!1}),$animate.enabled()&&!$scope.noTransition&&!$scope.$currentTransition&&slide.$element&&self.slides.length>1&&(slide.$element.data(SLIDE_DIRECTION,slide.direction),self.currentSlide&&self.currentSlide.$element&&self.currentSlide.$element.data(SLIDE_DIRECTION,slide.direction),$scope.$currentTransition=!0,NEW_ANIMATE?$animate.on("addClass",slide.$element,function(element,phase){"close"===phase&&($scope.$currentTransition=null,$animate.off("addClass",element))}):slide.$element.one("$animate:close",function(){$scope.$currentTransition=null})),self.currentSlide=slide,currentIndex=index,restartTimer())}function getSlideByIndex(index){if(angular.isUndefined(slides[index].index))return slides[index];var i;slides.length;for(i=0;i<slides.length;++i)if(slides[i].index==index)return slides[i]}function restartTimer(){resetTimer();var interval=+$scope.interval;!isNaN(interval)&&interval>0&&(currentInterval=$interval(timerFn,interval))}function resetTimer(){currentInterval&&($interval.cancel(currentInterval),currentInterval=null)}function timerFn(){var interval=+$scope.interval;isPlaying&&!isNaN(interval)&&interval>0&&slides.length?$scope.next():$scope.pause()}function resetTransition(slides){slides.length||($scope.$currentTransition=null)}var currentInterval,isPlaying,self=this,slides=self.slides=$scope.slides=[],NEW_ANIMATE=angular.version.minor>=4,NO_TRANSITION="uib-noTransition",SLIDE_DIRECTION="uib-slideDirection",currentIndex=-1;self.currentSlide=null;var destroyed=!1;self.select=$scope.select=function(nextSlide,direction){var nextIndex=$scope.indexOfSlide(nextSlide);void 0===direction&&(direction=nextIndex>self.getCurrentIndex()?"next":"prev"),nextSlide&&nextSlide!==self.currentSlide&&!$scope.$currentTransition&&goNext(nextSlide,nextIndex,direction)},$scope.$on("$destroy",function(){destroyed=!0}),self.getCurrentIndex=function(){return self.currentSlide&&angular.isDefined(self.currentSlide.index)?+self.currentSlide.index:currentIndex},$scope.indexOfSlide=function(slide){return angular.isDefined(slide.index)?+slide.index:slides.indexOf(slide)},$scope.next=function(){var newIndex=(self.getCurrentIndex()+1)%slides.length;return 0===newIndex&&$scope.noWrap()?void $scope.pause():self.select(getSlideByIndex(newIndex),"next")},$scope.prev=function(){var newIndex=self.getCurrentIndex()-1<0?slides.length-1:self.getCurrentIndex()-1;return $scope.noWrap()&&newIndex===slides.length-1?void $scope.pause():self.select(getSlideByIndex(newIndex),"prev")},$scope.isActive=function(slide){return self.currentSlide===slide},$scope.$watch("interval",restartTimer),$scope.$watchCollection("slides",resetTransition),$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){angular.isDefined(slide.index)&&slides.sort(function(a,b){return+a.index>+b.index});var index=slides.indexOf(slide);slides.splice(index,1),slides.length>0&&slide.active?index>=slides.length?self.select(slides[index-1]):self.select(slides[index]):currentIndex>index&&currentIndex--,0===slides.length&&(self.currentSlide=null)},$scope.$watch("noTransition",function(noTransition){$element.data(NO_TRANSITION,noTransition)})}]).directive("uibCarousel",[function(){return{transclude:!0,replace:!0,controller:"UibCarouselController",controllerAs:"carousel",require:"carousel",templateUrl:function(element,attrs){return attrs.templateUrl||"template/carousel/carousel.html"},scope:{interval:"=",noTransition:"=",noPause:"=",noWrap:"&"}}}]).directive("uibSlide",function(){return{require:"^uibCarousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:function(element,attrs){return attrs.templateUrl||"template/carousel/slide.html"},scope:{active:"=?",actual:"=?",index:"=?"},link:function(scope,element,attrs,carouselCtrl){carouselCtrl.addSlide(scope,element),scope.$on("$destroy",function(){carouselCtrl.removeSlide(scope)}),scope.$watch("active",function(active){active&&carouselCtrl.select(scope)})}}}).animation(".item",["$injector","$animate",function($injector,$animate){function removeClass(element,className,callback){element.removeClass(className),callback&&callback()}var NO_TRANSITION="uib-noTransition",SLIDE_DIRECTION="uib-slideDirection",$animateCss=null;return $injector.has("$animateCss")&&($animateCss=$injector.get("$animateCss")),{beforeAddClass:function(element,className,done){if("active"==className&&element.parent()&&element.parent().parent()&&!element.parent().parent().data(NO_TRANSITION)){var stopped=!1,direction=element.data(SLIDE_DIRECTION),directionClass="next"==direction?"left":"right",removeClassFn=removeClass.bind(this,element,directionClass+" "+direction,done);return element.addClass(direction),$animateCss?$animateCss(element,{addClass:directionClass}).start().done(removeClassFn):$animate.addClass(element,directionClass).then(function(){stopped||removeClassFn(),done()}),function(){stopped=!0}}done()},beforeRemoveClass:function(element,className,done){if("active"===className&&element.parent()&&element.parent().parent()&&!element.parent().parent().data(NO_TRANSITION)){var stopped=!1,direction=element.data(SLIDE_DIRECTION),directionClass="next"==direction?"left":"right",removeClassFn=removeClass.bind(this,element,directionClass,done);return $animateCss?$animateCss(element,{addClass:directionClass}).start().done(removeClassFn):$animate.addClass(element,directionClass).then(function(){stopped||removeClassFn(),done()}),function(){stopped=!0}}done()}}}]),angular.module("ui.bootstrap.carousel").value("$carouselSuppressWarning",!1).controller("CarouselController",["$scope","$element","$controller","$log","$carouselSuppressWarning",function($scope,$element,$controller,$log,$carouselSuppressWarning){$carouselSuppressWarning||$log.warn("CarouselController is now deprecated. Use UibCarouselController instead."),angular.extend(this,$controller("UibCarouselController",{$scope:$scope,$element:$element}))}]).directive("carousel",["$log","$carouselSuppressWarning",function($log,$carouselSuppressWarning){return{transclude:!0,replace:!0,controller:"CarouselController",controllerAs:"carousel",require:"carousel",templateUrl:function(element,attrs){return attrs.templateUrl||"template/carousel/carousel.html"},scope:{interval:"=",noTransition:"=",noPause:"=",noWrap:"&"},link:function(){$carouselSuppressWarning||$log.warn("carousel is now deprecated. Use uib-carousel instead.")}}}]).directive("slide",["$log","$carouselSuppressWarning",function($log,$carouselSuppressWarning){return{require:"^carousel",transclude:!0,replace:!0,templateUrl:function(element,attrs){return attrs.templateUrl||"template/carousel/slide.html"},scope:{active:"=?",actual:"=?",index:"=?"},link:function(scope,element,attrs,carouselCtrl){$carouselSuppressWarning||$log.warn("slide is now deprecated. Use uib-slide instead."),carouselCtrl.addSlide(scope,element),scope.$on("$destroy",function(){carouselCtrl.removeSlide(scope)}),scope.$watch("active",function(active){active&&carouselCtrl.select(scope)})}}}]),angular.module("ui.bootstrap.dateparser",[]).service("uibDateParser",["$log","$locale","orderByFilter",function($log,$locale,orderByFilter){function createParser(format){var map=[],regex=format.split("");return angular.forEach(formatCodeToRegex,function(data,code){var index=format.indexOf(code);if(index>-1){format=format.split(""),regex[index]="("+data.regex+")",format[index]="$";for(var i=index+1,n=index+code.length;i<n;i++)regex[i]="",format[i]="$";format=format.join(""),map.push({index:index,apply:data.apply})}}),{regex:new RegExp("^"+regex.join("")+"$"),map:orderByFilter(map,"index")}}function isValid(year,month,date){return!(date<1)&&(1===month&&date>28?29===date&&(year%4===0&&year%100!==0||year%400===0):3!==month&&5!==month&&8!==month&&10!==month||date<31)}var localeId,formatCodeToRegex,SPECIAL_CHARACTERS_REGEXP=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.init=function(){localeId=$locale.id,this.parsers={},formatCodeToRegex={yyyy:{regex:"\\d{4}",apply:function(value){this.year=+value}},yy:{regex:"\\d{2}",apply:function(value){this.year=+value+2e3}},y:{regex:"\\d{1,4}",apply:function(value){this.year=+value}},MMMM:{regex:$locale.DATETIME_FORMATS.MONTH.join("|"),apply:function(value){this.month=$locale.DATETIME_FORMATS.MONTH.indexOf(value)}},MMM:{regex:$locale.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(value){this.month=$locale.DATETIME_FORMATS.SHORTMONTH.indexOf(value)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(value){this.month=value-1}},M:{regex:"[1-9]|1[0-2]",apply:function(value){this.month=value-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(value){this.date=+value}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(value){this.date=+value}},EEEE:{regex:$locale.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:$locale.DATETIME_FORMATS.SHORTDAY.join("|")},HH:{regex:"(?:0|1)[0-9]|2[0-3]",apply:function(value){this.hours=+value}},hh:{regex:"0[0-9]|1[0-2]",apply:function(value){this.hours=+value}},H:{regex:"1?[0-9]|2[0-3]",apply:function(value){this.hours=+value}},h:{regex:"[0-9]|1[0-2]",apply:function(value){this.hours=+value}},mm:{regex:"[0-5][0-9]",apply:function(value){this.minutes=+value}},m:{regex:"[0-9]|[1-5][0-9]",apply:function(value){this.minutes=+value}},sss:{regex:"[0-9][0-9][0-9]",apply:function(value){this.milliseconds=+value}},ss:{regex:"[0-5][0-9]",apply:function(value){this.seconds=+value}},s:{regex:"[0-9]|[1-5][0-9]",apply:function(value){this.seconds=+value}},a:{regex:$locale.DATETIME_FORMATS.AMPMS.join("|"),apply:function(value){12===this.hours&&(this.hours=0),"PM"===value&&(this.hours+=12)}}}},this.init(),this.parse=function(input,format,baseDate){if(!angular.isString(input)||!format)return input;format=$locale.DATETIME_FORMATS[format]||format,format=format.replace(SPECIAL_CHARACTERS_REGEXP,"\\$&"),$locale.id!==localeId&&this.init(),this.parsers[format]||(this.parsers[format]=createParser(format));var parser=this.parsers[format],regex=parser.regex,map=parser.map,results=input.match(regex);if(results&&results.length){var fields,dt;angular.isDate(baseDate)&&!isNaN(baseDate.getTime())?fields={year:baseDate.getFullYear(),month:baseDate.getMonth(),date:baseDate.getDate(),hours:baseDate.getHours(),minutes:baseDate.getMinutes(),seconds:baseDate.getSeconds(),milliseconds:baseDate.getMilliseconds()}:(baseDate&&$log.warn("dateparser:","baseDate is not a valid date"),fields={year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0});for(var i=1,n=results.length;i<n;i++){var mapper=map[i-1];mapper.apply&&mapper.apply.call(fields,results[i])}return isValid(fields.year,fields.month,fields.date)&&(angular.isDate(baseDate)&&!isNaN(baseDate.getTime())?(dt=new Date(baseDate),dt.setFullYear(fields.year,fields.month,fields.date,fields.hours,fields.minutes,fields.seconds,fields.milliseconds||0)):dt=new Date(fields.year,fields.month,fields.date,fields.hours,fields.minutes,fields.seconds,fields.milliseconds||0)),dt}}}]),angular.module("ui.bootstrap.dateparser").value("$dateParserSuppressWarning",!1).service("dateParser",["$log","$dateParserSuppressWarning","uibDateParser",function($log,$dateParserSuppressWarning,uibDateParser){$dateParserSuppressWarning||$log.warn("dateParser is now deprecated. Use uibDateParser instead."),angular.extend(this,uibDateParser)}]),angular.module("ui.bootstrap.position",[]).factory("$uibPosition",["$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].documentElement.scrollTop),left:boundingClientRect.left+($window.pageXOffset||$document[0].documentElement.scrollLeft)}},positionElements:function(hostEl,targetEl,positionStr,appendToBody){var hostElPos,targetElWidth,targetElHeight,targetElPos,positionStrParts=positionStr.split("-"),pos0=positionStrParts[0],pos1=positionStrParts[1]||"center";hostElPos=appendToBody?this.offset(hostEl):this.position(hostEl),targetElWidth=targetEl.prop("offsetWidth"),targetElHeight=targetEl.prop("offsetHeight");var shiftWidth={center:function(){return hostElPos.left+hostElPos.width/2-targetElWidth/2},left:function(){return hostElPos.left},right:function(){return hostElPos.left+hostElPos.width}},shiftHeight={center:function(){return hostElPos.top+hostElPos.height/2-targetElHeight/2},top:function(){return hostElPos.top},bottom:function(){return hostElPos.top+hostElPos.height}};switch(pos0){case"right":targetElPos={top:shiftHeight[pos1](),left:shiftWidth[pos0]()};break;case"left":targetElPos={top:shiftHeight[pos1](),left:hostElPos.left-targetElWidth};break;case"bottom":targetElPos={top:shiftHeight[pos0](),left:shiftWidth[pos1]()};break;default:targetElPos={top:hostElPos.top-targetElHeight,left:shiftWidth[pos1]()}}return targetElPos}}}]),angular.module("ui.bootstrap.position").value("$positionSuppressWarning",!1).service("$position",["$log","$positionSuppressWarning","$uibPosition",function($log,$positionSuppressWarning,$uibPosition){$positionSuppressWarning||$log.warn("$position is now deprecated. Use $uibPosition instead."),angular.extend(this,$uibPosition)}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).value("$datepickerSuppressError",!1).constant("uibDatepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null,shortcutPropagation:!1}).controller("UibDatepickerController",["$scope","$attrs","$parse","$interpolate","$log","dateFilter","uibDatepickerConfig","$datepickerSuppressError",function($scope,$attrs,$parse,$interpolate,$log,dateFilter,datepickerConfig,$datepickerSuppressError){var self=this,ngModelCtrl={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","showWeeks","startingDay","yearRange","shortcutPropagation"],function(key,index){self[key]=angular.isDefined($attrs[key])?index<6?$interpolate($attrs[key])($scope.$parent):$scope.$parent.$eval($attrs[key]):datepickerConfig[key]}),angular.forEach(["minDate","maxDate"],function(key){$attrs[key]?$scope.$parent.$watch($parse($attrs[key]),function(value){self[key]=value?new Date(value):null,self.refreshView()}):self[key]=datepickerConfig[key]?new Date(datepickerConfig[key]):null}),angular.forEach(["minMode","maxMode"],function(key){$attrs[key]?$scope.$parent.$watch($parse($attrs[key]),function(value){self[key]=angular.isDefined(value)?value:$attrs[key],$scope[key]=self[key],("minMode"==key&&self.modes.indexOf($scope.datepickerMode)<self.modes.indexOf(self[key])||"maxMode"==key&&self.modes.indexOf($scope.datepickerMode)>self.modes.indexOf(self[key]))&&($scope.datepickerMode=self[key])}):(self[key]=datepickerConfig[key]||null,$scope[key]=self[key])}),$scope.datepickerMode=$scope.datepickerMode||datepickerConfig.datepickerMode,$scope.uniqueId="datepicker-"+$scope.$id+"-"+Math.floor(1e4*Math.random()),angular.isDefined($attrs.initDate)?(this.activeDate=$scope.$parent.$eval($attrs.initDate)||new Date,$scope.$parent.$watch($attrs.initDate,function(initDate){initDate&&(ngModelCtrl.$isEmpty(ngModelCtrl.$modelValue)||ngModelCtrl.$invalid)&&(self.activeDate=initDate,self.refreshView())})):this.activeDate=new Date,$scope.isActive=function(dateObject){return 0===self.compare(dateObject.date,self.activeDate)&&($scope.activeDateId=dateObject.uid,!0)},this.init=function(ngModelCtrl_){ngModelCtrl=ngModelCtrl_,ngModelCtrl.$render=function(){self.render()}},this.render=function(){if(ngModelCtrl.$viewValue){var date=new Date(ngModelCtrl.$viewValue),isValid=!isNaN(date);isValid?this.activeDate=date:$datepickerSuppressError||$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.')}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var date=ngModelCtrl.$viewValue?new Date(ngModelCtrl.$viewValue):null;ngModelCtrl.$setValidity("dateDisabled",!date||this.element&&!this.isDisabled(date))}},this.createDateObject=function(date,format){var model=ngModelCtrl.$viewValue?new Date(ngModelCtrl.$viewValue):null;return{date:date,label:dateFilter(date,format),selected:model&&0===this.compare(date,model),disabled:this.isDisabled(date),current:0===this.compare(date,new Date),customClass:this.customClass(date)}},this.isDisabled=function(date){return this.minDate&&this.compare(date,this.minDate)<0||this.maxDate&&this.compare(date,this.maxDate)>0||$attrs.dateDisabled&&$scope.dateDisabled({date:date,mode:$scope.datepickerMode})},this.customClass=function(date){return $scope.customClass({date:date,mode:$scope.datepickerMode})},this.split=function(arr,size){for(var arrays=[];arr.length>0;)arrays.push(arr.splice(0,size));return arrays},$scope.select=function(date){if($scope.datepickerMode===self.minMode){var dt=ngModelCtrl.$viewValue?new Date(ngModelCtrl.$viewValue):new Date(0,0,0,0,0,0,0);dt.setFullYear(date.getFullYear(),date.getMonth(),date.getDate()),ngModelCtrl.$setViewValue(dt),ngModelCtrl.$render()}else self.activeDate=date,$scope.datepickerMode=self.modes[self.modes.indexOf($scope.datepickerMode)-1]},$scope.move=function(direction){var year=self.activeDate.getFullYear()+direction*(self.step.years||0),month=self.activeDate.getMonth()+direction*(self.step.months||0);self.activeDate.setFullYear(year,month,1),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment