"use strict";angular.module("ulakbus",["ui.bootstrap","angular-loading-bar","ngRoute","ngSanitize","ngCookies","ulakbus.formService","ulakbus.dashboard","ulakbus.auth","ulakbus.error_pages","ulakbus.crud","ulakbus.debug","ulakbus.devSettings","ulakbus.version","gettext","templates-prod"]).constant("RESTURL",function(){varbackendurl=location.href.indexOf("nightly")>-1?"//nightly.api.ulakbus.net/":"//api.ulakbus.net/";if(document.cookie.indexOf("backendurl")>-1){varcookiearray=document.cookie.split(";");angular.forEach(cookiearray,function(item){item.indexOf("backendurl")>-1&&(backendurl=item.split("=")[1])})}if(location.href.indexOf("backendurl")>-1){varurlfromqstr=location.href.split("?")[1].split("=")[1];backendurl=decodeURIComponent(urlfromqstr.replace(/\+/g," ")),document.cookie="backendurl="+backendurl,window.location.href=window.location.href.split("?")[0]}return{url:backendurl}}()).constant("USER_ROLES",{all:"*",admin:"admin",student:"student",staff:"staff",dean:"dean"}).constant("AUTH_EVENTS",{loginSuccess:"auth-login-success",loginFailed:"auth-login-failed",logoutSuccess:"auth-logout-success",sessionTimeout:"auth-session-timeout",notAuthenticated:"auth-not-authenticated",notAuthorized:"auth-not-authorized"}).config(function($logProvider){$logProvider.debugEnabled(!1)}),angular.module("ulakbus").config(["$routeProvider",function($routeProvider,$route){$routeProvider.when("/login",{templateUrl:"components/auth/login.html",controller:"LoginCtrl"}).when("/dashboard",{templateUrl:"components/dashboard/dashboard.html",controller:"DashCtrl"}).when("/dev/settings",{templateUrl:"components/devSettings/devSettings.html",controller:"DevSettingsCtrl"}).when("/debug/list",{templateUrl:"components/debug/debug.html",controller:"DebugCtrl"}).when("/:wf/",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDCtrl"}).when("/:wf/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/:model",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDCtrl"}).when("/:wf/:model/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/:model/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).otherwise({redirectTo:"/dashboard"})}]).run(function($rootScope){$rootScope.loggedInUser=!0,$rootScope.loginAttempt=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($q,$rootScope,$location,$timeout,$log){return{request:function(config){return"POST"===config.method&&(config.headers["Content-Type"]="text/plain"),config},response:function(response){returnresponse.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},responseError:function(rejection){varerrorModal=function(){if(0===$rootScope.loginAttempt)returnvoid$log.debug("not logged in, no alert message triggered");varcodefield="";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">×</span></button><h4 class="modal-title" id="exampleModalLabel">'+rejection.status+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();try{$("pre:not(.hljs)").each(function(i,block){hljs.highlightBlock(block)})}catch(e){$log.debug("Exception: ",e.message)}};return-1===rejection.status&&(rejection.status="Sunucu hatası",rejection.data={title:"",description:"Sunucu bağlantısında bir hata oluştu.Lütfen yetkili personelle iletişime geçiniz."},$rootScope.$broadcast("alertBox",{title:rejection.status,msg:rejection.data.description,type:"error"})),400===rejection.status&&$location.reload(),401===rejection.status&&($location.path("/login"),"/login"===$location.path()&&$log.debug("show errors on login form")),403===rejection.status&&rejection.data.is_login===!0&&($rootScope.loggedInUser=!0,"/login"===$location.path()&&$location.path("/dashboard")),$rootScope.$broadcast("show_notifications",rejection.data),404===rejection.status&&errorModal(),500===rejection.status&&errorModal(),$q.reject(rejection)}}})}]),angular.module("ulakbus.formService",["ui.bootstrap"]).service("Moment",function(){returnwindow.moment}).factory("Generator",function($http,$q,$timeout,$sce,$location,$route,$compile,$log,RESTURL,$rootScope,Moment){vargenerator={};returngenerator.makeUrl=function(scope){vargetparams=scope.form_params.param?"?"+scope.form_params.param+"="+scope.form_params.id:"";returnRESTURL.url+scope.url+getparams},generator.generate=function(scope,data){returndata.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)returnscope;varnewForm=[],extractFormItem=function(itemList){varextractedList=[];returnangular.forEach(itemList,function(value,key){varitem=getFormItem(value);item&&extractedList.push(item)}),$log.debug("extractedList: ",extractedList),extractedList},getFormItem=function(item){varformItem;returnscope.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){returnvalue.key===item?(formItem=value,voidscope.form.splice(key,1)):void0}),formItem)},makeGroup=function(itemsToGroup){varsubItems=[];returnangular.forEach(itemsToGroup,function(value,key){subItems.push({type:"fieldset",items:extractFormItem(value.items),title:value.group_title})}),subItems};returnangular.forEach(scope.grouping,function(value,key){newForm.push({type:"fieldset",items:makeGroup(value.groups),htmlClass:"col-md-"+value.layout,title:value.group_title})}),$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.prepareFormItems=function(scope){returnangular.forEach(scope.form,function(value,key){"select"===value.type&&(scope.schema.properties[value.key].type="select",scope.schema.properties[value.key].titleMap=value.titleMap,scope.form[key]=value.key)}),angular.forEach(scope.schema.properties,function(v,k){if("form_params"inscope&&k==scope.form_params.param)returnscope.model[k]=scope.form_params.id,voidscope.form.splice(scope.form.indexOf(k),1);if("file"===v.type&&(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"===v.type&&(scope.form[scope.form.indexOf(k)]={type:"template",title:v.title,templateUrl:"shared/templates/select.html",name:k,key:k,titleMap:v.titleMap}),"submit"===v.type||"button"===v.type){varbuttonPositions=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?!1:!0;scope.form[scope.form.indexOf(k)]={type:v.type,title:v.title,style:"btn-danger hide "+buttonClass,onClick:function(){deletescope.form_params.cmd,deletescope.form_params.flow,v.cmd&&(scope.form_params.cmd=v.cmd),v.flow&&(scope.form_params.flow=v.flow),v.wf&&(deletescope.form_params.cmd,scope.form_params.wf=v.wf),scope.model[k]=1,scope.modalElements?scope.submitModalForm():v.validation===!1?generator.submit(scope,redirectTo):(scope.$broadcast("schemaFormValidate"),scope[workOnForm].$valid?(generator.submit(scope,redirectTo),scope.$broadcast("disposeModal")):$timeout(function(){varfirsterror=angular.element(document.querySelectorAll("input.ng-invalid"))[0];firsterror.focus()}))}},$timeout(function(){varselectorBottom=".buttons-on-bottom"+workOnDiv,buttonsToBottom=angular.element(document.querySelector("."+buttonClass));angular.element(document.querySelector(selectorBottom)).append(buttonsToBottom),buttonsToBottom.removeClass("hide")},500)}if("date"===v.type&&($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){vardeferred=$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{vardateValue=d=value.split(".");isNaN(Date.parse(value))||3!==dateValue.length?deferred.reject():deferred.resolve()}}),deferred.promise}},status:{opened:!1},open:function($event){this.status.opened=!0},format:"dd.MM.yyyy",onSelect:function(){scope.model[k]=angular.copy(generator.dateformatter(scope.model[k]))}}),("int"===v.type||"float"===v.type)&&(v.type="number",scope.model[k]=parseInt(scope.model[k])),"text_general"===v.type&&(v.type="string",v["x-schema-form"]={type:"textarea"}),"model"===v.type){varformitem=scope.form[scope.form.indexOf(k)],modelScope={url:v.wf,wf:v.wf,form_params:{model:v.model_name,cmd:v.list_cmd}};scope.generateTitleMap=function(modelScope){returngenerator.get_list(modelScope).then(function(res){returnformitem.titleMap=[],angular.forEach(res.data.objects,function(item){-1!==item?formitem.titleMap.push({value:item.key,name:item.value}):formitem.focusToInput=!0}),formitem.titleMap})},scope.model[k]&&generator.get_list({url:"crud",form_params:{model:v.model_name,object_id:scope.model[k],cmd:"object_name"}}).then(function(data){try{scope.$watch(document.querySelector("input[name="+v.model_name+"]"),function(){document.querySelector("input[name="+k+"]").value=data.data.object_name})}catch(e){document.querySelector("input[name="+k+"]").value=data.data.object_name,$log.debug("exception",e)}}),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){returnmodelScope.form_params.query=viewValue,scope.generateTitleMap(modelScope)},getDropdownTitleMap:function(){deletemodelScope.form_params.query,formitem.gettingTitleMap=!0,scope.generateTitleMap(modelScope).then(function(data){formitem.titleMap=data,formitem.gettingTitleMap=!1})}},scope.form[scope.form.indexOf(k)]=formitem}if(("ListNode"===v.type||"Node"===v.type)&&"filter_interface"===v.widget){varformitem=scope.form[scope.form.indexOf(k)],modelScope={url:v.wf||scope.wf,wf:v.wf||scope.wf,form_params:{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.data.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)})};varmodelItems=[],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});varmodelKey={};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,add_cmd:v.add_cmd,name:v.model_name,model_name:v.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])})),2>=filterValue&&(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){vardataValues=[];returnangular.forEach(data,function(value,key){vardataKey={};dataKey[v.schema[0].name]=value.value,dataValues.push(dataKey)}),dataValues}},scope.form[scope.form.indexOf(k)]=formitem}"ListNode"!==v.type&&"Node"!==v.type||"filter_interface"===v.widget||(scope[v.type]=scope[v.type]||{},scope[v.type][k]=angular.copy({title:v.title,form:[],schema:{properties:{},required:[],title:v.title,type:"object",formType:v.type,model_name:k,inline_edit:scope.inline_edit},url:scope.url,wf:scope.wf,nodeModelChange:function(item){}}),angular.forEach(v.schema,function(item){scope[v.type][k].schema.properties[item.name]=angular.copy(item),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&&(scope.model[k][item.name]=generator.dateformatter(scope.model[k][item.name]))}catch(e){$log.debug("Error: ",e.message)}}),$timeout(function(){"ListNode"===v.type&&(scope[v.type][k].items=angular.copy(scope.model[k]||[]),angular.forEach(scope[v.type][k].items,function(value,key){value.constructor===Object&&angular.forEach(value,function(x,y){try{"date"===scope[v.type][k].schema.properties[y].type&&(scope[v.type][k].items[key][y]=generator.dateformatter(x),scope[v.type][k].model[key][y]=generator.dateformatter(x)),"select"===scope[v.type][k].schema.properties[y].type&&(scope[v.type][k].items[key][y]=generator.item_from_array(x.toString(),scope[v.type][k].schema.properties[y].titleMap))}catch(e){$log.debug("Field is not date")}})}))}),scope.model[k]&&angular.forEach(scope.model[k],function(value,key){angular.forEach(value,function(y,x){y.constructor===Object&&(scope.model[k][key][x]=y.key)})}),scope.model[k]=scope.model[k]||[],scope[v.type][k].model=scope.model[k],scope[v.type][k].lengthModels=scope.model[k]?1:0)}),$log.debug("scope at after prepareformitems",scope),generator.group(scope)},generator.dateformatter=function(formObject){varndate=newDate(formObject);if(isNaN(ndate))return"";varnewdatearray=Moment(ndate).format("DD.MM.YYYY");return$log.debug("date formatted: ",newdatearray),newdatearray},generator.doItemAction=function($scope,key,todo,mode){var_do={normal:function(){return$log.debug("normal mode starts"),$scope.form_params.cmd=todo.cmd,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,generator.get_wf($scope)},modal:function(){$log.debug("modal mode is not not ready")},"new":function(){$log.debug("new mode is not not ready")}};return_do[mode]()},generator.button_switch=function(position){varbuttons=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){returngenerator.button_switch(!1),$http.post(generator.makeUrl(scope),scope.form_params).then(function(res){returngenerator.button_switch(!0),generator.generate(scope,res.data)})},generator.get_list=function(scope){returngenerator.button_switch(!1),$http.post(generator.makeUrl(scope),scope.form_params).then(function(res){returngenerator.button_switch(!0),res})},generator.get_wf=function(scope){returngenerator.button_switch(!1),$http.post(generator.makeUrl(scope),scope.form_params).then(function(res){if(generator.button_switch(!0),res.data.client_cmd)returngenerator.pathDecider(res.data.client_cmd,scope,res.data);if(res.data.msgbox){scope.msgbox=res.data.msgbox;varnewElement=$compile("<msgbox></msgbox>")(scope);angular.element(document.querySelector(".main.ng-scope")).children().remove(),angular.element(document.querySelector(".main.ng-scope")).append(newElement)}})},generator.isValidEmail=function(email){varre=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;returnre.test(email)},generator.isValidTCNo=function(tcno){varre=/^([1-9]{1}[0-9]{9}[0,2,4,6,8]{1})$/i;returnre.test(tcno)},generator.isValidDate=function(dateValue){return!isNaN(Date.parse(dateValue))},generator.pageData={},generator.getPageData=function(){returngenerator.pageData},generator.setPageData=function(value){generator.pageData=value},generator.pathDecider=function(client_cmd,$scope,data){functionredirectTo(scope,page){varpathUrl="/"+scope.form_params.wf;returnpathUrl+=scope.form_params.model?"/"+scope.form_params.model+"/do/"+page:"/do/"+page,$location.path()===pathUrl?$route.reload():void$location.path(pathUrl)}functiondispatchClientCmd(){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,data.second_client_cmd=client_cmd[1],generator.setPageData(data),redirectTo($scope,client_cmd[0])}return"reload"===client_cmd[0]||"reset"===client_cmd[0]?void$rootScope.$broadcast("reload_cmd",$scope.reload_cmd):voiddispatchClientCmd()},generator.get_diff=function(oldObj,newObj){varresult={};returnangular.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){varresult=[];returnangular.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){varresult=item;returnangular.forEach(array,function(value,key){value.value===item&&(result=value.name)}),result},generator.submit=function($scope,redirectTo){angular.forEach($scope.ListNode,function(value,key){$scope.model[key]=value.model}),angular.forEach($scope.Node,function(value,key){$scope.model[key]=value.model});vardata={form:$scope.model,token:$scope.token,model:$scope.form_params.model,cmd:$scope.form_params.cmd,flow:$scope.form_params.flow,object_id:$scope.object_id,filter:$scope.filter,query:$scope.form_params.query};return$http.post(generator.makeUrl($scope),data).success(function(data,status,headers){if("application/pdf"===headers("content-type")){vara=document.createElement("a");document.body.appendChild(a),a.style="display: none";varfile=newBlob([data],{type:"application/pdf"}),fileURL=URL.createObjectURL(file),fileName=$scope.schema.title;a.href=fileURL,a.download=fileName,a.click()}if(redirectTo===!0&&(data.client_cmd&&generator.pathDecider(data.client_cmd,$scope,data),data.msgbox)){$scope.msgbox=data.msgbox;varnewElement=$compile("<msgbox></msgbox>")($scope);angular.element(document.querySelector(".main.ng-scope")).children().remove(),angular.element(document.querySelector(".main.ng-scope")).append(newElement)}})},generator}).controller("ModalCtrl",function($scope,$uibModalInstance,Generator,items){angular.forEach(items,function(value,key){$scope[key]=items[key]}),$scope.$on("disposeModal",function(){$scope.cancel()}),$scope.$on("modalFormLocator",function(event){$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){return{link:function(scope,element,attributes){element.on("click",function(){varmodalInstance=$uibModal.open({animation:!0,backdrop:"static",keyboard:!1,templateUrl:"shared/templates/listnodeModalContent.html",controller:"ModalCtrl",size:"lg",resolve:{items:function(){varattribs=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){scope.node.schema.properties[key].wf=scope.node.url,scope.node.schema.properties[key].list_cmd="select_list"});varnewscope={wf:scope.node.wf,url:scope.node.url,form_params:{model:scope.node.schema.model_name},edit:attribs[3]};returnGenerator.generate(newscope,{forms:scope.node}),newscope.model=newscope.model[node.edit]||newscope.model[0]||{},newscope}}});modalInstance.result.then(function(childmodel,key){varlistNodeItem=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){varreformattedModel={};angular.forEach(childmodel.model,function(value,key){key.indexOf("_id")>-1?angular.forEach(childmodel.form,function(v,k){functionindexInTitleMap(element,index,array){returnelement.value===value?element:void0}v.formName===key&&(reformattedModel[key]={key:value,unicode:v.titleMap.find(indexInTitleMap).name})}):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(){varmodalInstance=$uibModal.open({animation:!0,backdrop:"static",keyboard:!1,templateUrl:"shared/templates/linkedModelModalContent.html",controller:"ModalCtrl",size:"lg",resolve:{items:function(){varformName=attributes.addModalForLinkedModel;returnGenerator.get_form({url:scope.form.wf,wf:scope.form.wf,form_params:{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){varformName=childscope.formName;Generator.submit(childscope,!1).success(function(data){scope.model[formName]=data.forms.model.object_key,scope.form.titleMap.push({value:data.forms.model.object_key,name:data.forms.model.unicode}),scope.form.selected_item={value:data.forms.model.object_key,name:data.forms.model.unicode},scope.$watch(document.querySelector("input[name="+scope.form.model_name+"]"),function(){angular.element(document.querySelector("input[name="+scope.form.model_name+"]")).val(scope.form.selected_item.name)})})})})}}}).directive("modalFormLocator",function(){return{link:function(scope){scope.$emit("modalFormLocator")}}}),angular.module("ulakbus").directive("logout",function($http,$location,RESTURL){return{link:function($scope,$element,$rootScope){$element.on("click",function(){$http.post(RESTURL.url+"logout",{}).then(function(){$rootScope.loggedInUser=!1,$location.path("/login")})})}}}).directive("headerNotification",function($http,$rootScope,$cookies,$interval,RESTURL){return{templateUrl:"shared/templates/directives/header-notification.html",restrict:"E",replace:!0,link:function($scope){$scope.groupNotifications=function(notifications){$scope.notifications={1:[],2:[],3:[],4:[]},angular.forEach(notifications,function(value,key){$scope.notifications[value.type].push(value)})},$scope.getNotifications=function(){$http.get(RESTURL.url+"notify",{ignoreLoadingBar:!0}).success(function(data){$scope.groupNotifications(data.notifications),$rootScope.$broadcast("notifications",$scope.notifications)})},$scope.getNotifications(),$interval(function(){"on"==$cookies.get("notificate")&&$scope.getNotifications()},5e3),$scope.markAsRead=function(items){$http.post(RESTURL.url+"notify",{ignoreLoadingBar:!0,read:[items]}).success(function(data){$scope.groupNotifications(data.notifications),$rootScope.$broadcast("notifications",$scope.notifications)})},$scope.$on("markasread",function(event,data){$scope.markAsRead(data)})}}}).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){varsearchparams={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,query:$scope.searchModel.searchbox}};Generator.submit(searchparams).success(function(data){$rootScope.$broadcast("updateObjects",data.objects)})}}}}}).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){varsortparams={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")||0,$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("selectedUser",function($http,RESTURL){return{templateUrl:"shared/templates/directives/selected-user.html",restrict:"E",replace:!0,link:function($scope,$rootScope){$scope.$on("selectedUser",function($event,data){$scope.selectedUser=data,$scope.dynamicPopover={content:"",name:data.name,tcno:data.tcno,key:data.key,templateUrl:"shared/templates/directives/selectedUserPopover.html",title:"İşlem Yapılan Kişi"}}),$scope.$on("selectedUserTrigger",function($event,data){
({model:"Personel",cmd:"show",id:data[1]});$http.get(RESTURL.url+"ara/personel/"+data[1]).success(function(data){})})}}}).directive("sidebar",["$location",function(){return{templateUrl:"shared/templates/directives/sidebar.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope,$cookies,$route,$http,RESTURL,$log,$location,$window,$timeout){$scope.prepareMenu=function(menuItems){varnewMenuItems={};returnangular.forEach(menuItems,function(value,key){angular.forEach(value,function(v,k){newMenuItems[k]=v})}),newMenuItems};varsidebarmenu=$("#side-menu");sidebarmenu.metisMenu(),$http.get(RESTURL.url+"menu/").success(function(data){functionreGroupMenuItems(items,baseCategory){varnewItems={};returnangular.forEach(items,function(value,key){newItems[value.kategori]=newItems[value.kategori]||[],value.baseCategory=baseCategory,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,deletedata.quick_menu,$log.debug("quick menu",$rootScope.quick_menu),$rootScope.$broadcast("authz",data),$rootScope.searchInputs=data,$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()})}),$scope.$on("menuitems",function(event,data){varmenu={};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},$scope.openSidebar=function(){$window.innerWidth>"768"&&0===$rootScope.sidebarPinned&&(jQuery("span.menu-text, span.arrow, .sidebar footer, #side-menu").fadeIn(400),jQuery(".sidebar").css("width","250px"),jQuery(".manager-view").css("width","calc(100% - 250px)"),$rootScope.collapsed=!1)},$scope.closeSidebar=function(){$window.innerWidth>"768"&&0===$rootScope.sidebarPinned&&(jQuery(".sidebar").css("width","62px"),jQuery(".manager-view").css("width","calc(100% - 62px)"),$rootScope.collapsed=!0)},$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){varsidebarUserMenu=$("#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){varreader=newFileReader;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])})}}}),angular.module("ulakbus.auth",["ngRoute","ngCookies"]).controller("LoginCtrl",function($scope,$q,$timeout,$routeParams,$rootScope,$log,Generator,AuthService){$scope.url="login",$scope.form_params={},$scope.form_params.clear_wf=1,Generator.get_form($scope).then(function(data){$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).error(function(data){$scope.message=data.title,$scope.loggingIn=!1}).then(function(){$scope.loggingIn=!1,Generator.button_switch(!1)})):$log.debug("not valid")},$log.debug("login attempt: ",$rootScope.loginAttempt)}),angular.module("ulakbus.auth").factory("AuthService",function($http,$rootScope,$location,$log,Generator,RESTURL){varauthService={};returnauthService.login=function(url,credentials){returncredentials.cmd="do",$http.post(RESTURL.url+url,credentials).success(function(data,status,headers,config){$rootScope.loggedInUser=!0}).error(function(data,status,headers,config){returndata.title="İşlem başarısız oldu. Lütfen girdiğiniz bilgileri kontrol ediniz.",data})},authService.logout=function(){return$log.debug("logout"),$http.post(RESTURL.url+"logout",{}).success(function(data){$rootScope.loggedInUser=!1,$log.debug("loggedout"),$location.path("/login")})},authService}),angular.module("ulakbus.dashboard",[]).config(function($uibTooltipProvider){$uibTooltipProvider.setTriggers({click:"mouseleave"})}).controller("DashCtrl",function($scope,$rootScope,$timeout,$http,$cookies,RESTURL,Generator){$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){$timeout(function(){"personel"===where&&$scope.keyword.staff.length>2&&$scope.getItems(where,$scope.keyword.staff).success(function(data){$scope.staffs=data.results}),"ogrenci"===where&&$scope.keyword.student.length>2&&$scope.getItems(where,$scope.keyword.student).success(function(data){$scope.students=data.results})},500)},$scope.getItems=function(where,what){return$scope.showResults=!0,$http.get(RESTURL.url+"ara/"+where+"/"+what)},$scope.userPopover={templateUrl:"components/dashboard/user-info.html"},$scope.get_info=function(type,key){Generator.get_list({url:"crud",form_params:{model:type,object_id:key,cmd:"show"}}).then(function(data){$scope.userPopover.name=data.data.object.unicode,$scope.userPopover.tcno=data.data.object.tckn})},$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)}}).directive("sidebarNotifications",function(){return{templateUrl:"shared/templates/directives/sidebar-notification.html",restrict:"E",replace:!0,link:function($scope){}}}),angular.module("ulakbus.crud",["ui.bootstrap","schemaForm","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){returnscope.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:{}},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}),angular.forEach(scope.objects,function(value,key){if(key>0){varlinkIndexes={};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("CRUDCtrl",function($scope,$routeParams,Generator,CrudUtility){CrudUtility.generateParam($scope,$routeParams),Generator.get_wf($scope)}).controller("CRUDListFormCtrl",function($scope,$rootScope,$location,$http,$log,$uibModal,$timeout,Generator,$routeParams,CrudUtility){$scope.reload=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.reload({})}),$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){returnnewArray(num)},$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);varpageData=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.listFormCmd=function(){varsetpageobjects=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()),(void0===pageData.pageData||pageData.pageData===!1)&&(CrudUtility.generateParam($scope,$routeParams,$routeParams.cmd),Generator.get_wf($scope)),$scope.object&&$scope.createListObjects()},$scope.reloadCmd=function(){$scope.reload({})},$scope.resetCmd=function(){delete$scope.token,$scope.cmd="reset",Generator.get_wf($scope)};varexecuteCmd={show:$scope.showCmd,list:$scope.listFormCmd,form:$scope.listFormCmd,reload:$scope.reloadCmd,reset:$scope.resetCmd};returnexecuteCmd[$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.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?!0:!1})}),$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){vardateValues=[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)}}}}),angular.module("ulakbus.debug",["ngRoute"]).controller("DebugCtrl",function($scope,$rootScope,$location){$scope.debug_queries=$rootScope.debug_queries}),angular.module("ulakbus.devSettings",["ngRoute"]).controller("DevSettingsCtrl",function($scope,$cookies,$rootScope,RESTURL){$scope.backendurl=$cookies.get("backendurl"),$scope.notificate=$cookies.get("notificate")||"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.setnotification=function(){$scope.changeSettings("notificate",$scope.switchOnOff($scope.notificate))}}),angular.module("ulakbus").config(["$routeProvider",function($routeProvider){$routeProvider.when("/error/500",{templateUrl:"components/error_pages/500.html",controller:"500Ctrl"}).when("/error/404",{templateUrl:"components/error_pages/404.html",controller:"404Ctrl"})}]),angular.module("ulakbus.error_pages",["ngRoute"]).controller("500Ctrl",function($scope,$rootScope,$location){}).controller("404Ctrl",function($scope,$rootScope,$location){}),angular.module("ulakbus.version",["ulakbus.version.interpolate-filter","ulakbus.version.version-directive"]).value("version","0.6.10"),angular.module("ulakbus.version.interpolate-filter",[]).filter("interpolate",["version",function(version){returnfunction(text){returnString(text).replace(/\%VERSION\%/gm,version)}}]),angular.module("ulakbus.version.version-directive",[]).directive("appVersion",["version",function(version){returnfunction(scope,elm,attrs){elm.text(version)}}]);
\ No newline at end of file
/*! ulakbus-ui 2016-02-01 */
"use strict";angular.module("ulakbus",["ui.bootstrap","angular-loading-bar","ngRoute","ngSanitize","ngCookies","ulakbus.formService","ulakbus.dashboard","ulakbus.auth","ulakbus.error_pages","ulakbus.crud","ulakbus.debug","ulakbus.devSettings","ulakbus.version","gettext","templates-prod"]).constant("RESTURL",function(){varbackendurl=location.href.indexOf("nightly")>-1?"//nightly.api.ulakbus.net/":"//api.ulakbus.net/";if(document.cookie.indexOf("backendurl")>-1){varcookiearray=document.cookie.split(";");angular.forEach(cookiearray,function(item){item.indexOf("backendurl")>-1&&(backendurl=item.split("=")[1])})}if(location.href.indexOf("backendurl")>-1){varurlfromqstr=location.href.split("?")[1].split("=")[1];backendurl=decodeURIComponent(urlfromqstr.replace(/\+/g," ")),document.cookie="backendurl="+backendurl,window.location.href=window.location.href.split("?")[0]}return{url:backendurl}}()).config(function($logProvider){$logProvider.debugEnabled(!1)}),angular.module("ulakbus").config(["$routeProvider",function($routeProvider,$route){$routeProvider.when("/login",{templateUrl:"components/auth/login.html",controller:"LoginCtrl"}).when("/dashboard",{templateUrl:"components/dashboard/dashboard.html",controller:"DashCtrl"}).when("/dev/settings",{templateUrl:"components/devSettings/devSettings.html",controller:"DevSettingsCtrl"}).when("/debug/list",{templateUrl:"components/debug/debug.html",controller:"DebugCtrl"}).when("/:wf/",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDCtrl"}).when("/:wf/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/:model",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDCtrl"}).when("/:wf/:model/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/:model/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).otherwise({redirectTo:"/dashboard"})}]).run(function($rootScope){$rootScope.loggedInUser=!0,$rootScope.loginAttempt=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($q,$rootScope,$location,$timeout,$log){return{request:function(config){return"POST"===config.method&&(config.headers["Content-Type"]="text/plain"),config},response:function(response){returnresponse.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},responseError:function(rejection){varerrorModal=function(){if(0===$rootScope.loginAttempt)returnvoid$log.debug("not logged in, no alert message triggered");varcodefield="";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">×</span></button><h4 class="modal-title" id="exampleModalLabel">'+rejection.status+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();try{$("pre:not(.hljs)").each(function(i,block){hljs.highlightBlock(block)})}catch(e){$log.debug("Exception: ",e.message)}};return-1===rejection.status&&(rejection.status="Sunucu hatası",rejection.data={title:"",description:"Sunucu bağlantısında bir hata oluştu.Lütfen yetkili personelle iletişime geçiniz."},$rootScope.$broadcast("alertBox",{title:rejection.status,msg:rejection.data.description,type:"error"})),400===rejection.status&&$location.reload(),401===rejection.status&&($location.path("/login"),"/login"===$location.path()&&$log.debug("show errors on login form")),403===rejection.status&&rejection.data.is_login===!0&&($rootScope.loggedInUser=!0,"/login"===$location.path()&&$location.path("/dashboard")),$rootScope.$broadcast("show_notifications",rejection.data),404===rejection.status&&errorModal(),500===rejection.status&&errorModal(),$q.reject(rejection)}}})}]),angular.module("ulakbus.formService",["ui.bootstrap"]).service("Moment",function(){returnwindow.moment}).factory("Generator",function($http,$q,$timeout,$sce,$location,$route,$compile,$log,RESTURL,$rootScope,Moment){vargenerator={};returngenerator.makeUrl=function(scope){vargetparams=scope.form_params.param?"?"+scope.form_params.param+"="+scope.form_params.id:"";returnRESTURL.url+scope.url+getparams},generator.generate=function(scope,data){returndata.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)returnscope;varnewForm=[],extractFormItem=function(itemList){varextractedList=[];returnangular.forEach(itemList,function(value,key){varitem=getFormItem(value);item&&extractedList.push(item)}),$log.debug("extractedList: ",extractedList),extractedList},getFormItem=function(item){varformItem;returnscope.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){returnvalue.key===item?(formItem=value,voidscope.form.splice(key,1)):void0}),formItem)},makeGroup=function(itemsToGroup){varsubItems=[];returnangular.forEach(itemsToGroup,function(value,key){subItems.push({type:"fieldset",items:extractFormItem(value.items),title:value.group_title})}),subItems};returnangular.forEach(scope.grouping,function(value,key){newForm.push({type:"fieldset",items:makeGroup(value.groups),htmlClass:"col-md-"+value.layout,title:value.group_title})}),$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.prepareFormItems=function(scope){returnangular.forEach(scope.form,function(value,key){"select"===value.type&&(scope.schema.properties[value.key].type="select",scope.schema.properties[value.key].titleMap=value.titleMap,scope.form[key]=value.key)}),angular.forEach(scope.schema.properties,function(v,k){if("form_params"inscope&&k==scope.form_params.param)returnscope.model[k]=scope.form_params.id,voidscope.form.splice(scope.form.indexOf(k),1);if("file"===v.type&&(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"===v.type&&(scope.form[scope.form.indexOf(k)]={type:"template",title:v.title,templateUrl:"shared/templates/select.html",name:k,key:k,titleMap:v.titleMap}),"submit"===v.type||"button"===v.type){varbuttonPositions=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?!1:!0;scope.form[scope.form.indexOf(k)]={type:v.type,title:v.title,style:"btn-danger hide "+buttonClass,onClick:function(){deletescope.form_params.cmd,deletescope.form_params.flow,v.cmd&&(scope.form_params.cmd=v.cmd),v.flow&&(scope.form_params.flow=v.flow),v.wf&&(deletescope.form_params.cmd,scope.form_params.wf=v.wf),scope.model[k]=1,scope.modalElements?scope.submitModalForm():v.validation===!1?generator.submit(scope,redirectTo):(scope.$broadcast("schemaFormValidate"),scope[workOnForm].$valid?(generator.submit(scope,redirectTo),scope.$broadcast("disposeModal")):$timeout(function(){varfirsterror=angular.element(document.querySelectorAll("input.ng-invalid"))[0];firsterror.focus()}))}},$timeout(function(){varselectorBottom=".buttons-on-bottom"+workOnDiv,buttonsToBottom=angular.element(document.querySelector("."+buttonClass));angular.element(document.querySelector(selectorBottom)).append(buttonsToBottom),buttonsToBottom.removeClass("hide")},500)}if("date"===v.type&&($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){vardeferred=$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{vardateValue=d=value.split(".");isNaN(Date.parse(value))||3!==dateValue.length?deferred.reject():deferred.resolve()}}),deferred.promise}},status:{opened:!1},open:function($event){this.status.opened=!0},format:"dd.MM.yyyy",onSelect:function(){scope.model[k]=angular.copy(generator.dateformatter(scope.model[k]))}}),("int"===v.type||"float"===v.type)&&(v.type="number",scope.model[k]=parseInt(scope.model[k])),"text_general"===v.type&&(v.type="string",v["x-schema-form"]={type:"textarea"}),"model"===v.type){varformitem=scope.form[scope.form.indexOf(k)],modelScope={url:v.wf,wf:v.wf,form_params:{model:v.model_name,cmd:v.list_cmd}};scope.generateTitleMap=function(modelScope){returngenerator.get_list(modelScope).then(function(res){returnformitem.titleMap=[],angular.forEach(res.data.objects,function(item){-1!==item?formitem.titleMap.push({value:item.key,name:item.value}):formitem.focusToInput=!0}),formitem.titleMap})},scope.model[k]&&generator.get_list({url:"crud",form_params:{model:v.model_name,object_id:scope.model[k],cmd:"object_name"}}).then(function(data){try{scope.$watch(document.querySelector("input[name="+v.model_name+"]"),function(){document.querySelector("input[name="+k+"]").value=data.data.object_name})}catch(e){document.querySelector("input[name="+k+"]").value=data.data.object_name,$log.debug("exception",e)}}),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){returnmodelScope.form_params.query=viewValue,scope.generateTitleMap(modelScope)},getDropdownTitleMap:function(){deletemodelScope.form_params.query,formitem.gettingTitleMap=!0,scope.generateTitleMap(modelScope).then(function(data){formitem.titleMap=data,formitem.gettingTitleMap=!1})}},scope.form[scope.form.indexOf(k)]=formitem}if(("ListNode"===v.type||"Node"===v.type)&&"filter_interface"===v.widget){varformitem=scope.form[scope.form.indexOf(k)],modelScope={url:v.wf||scope.wf,wf:v.wf||scope.wf,form_params:{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.data.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)})};varmodelItems=[],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});varmodelKey={};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,add_cmd:v.add_cmd,name:v.model_name,model_name:v.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])})),2>=filterValue&&(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){vardataValues=[];returnangular.forEach(data,function(value,key){vardataKey={};dataKey[v.schema[0].name]=value.value,dataValues.push(dataKey)}),dataValues}},scope.form[scope.form.indexOf(k)]=formitem}"ListNode"!==v.type&&"Node"!==v.type||"filter_interface"===v.widget||(scope[v.type]=scope[v.type]||{},scope[v.type][k]=angular.copy({title:v.title,form:[],schema:{properties:{},required:[],title:v.title,type:"object",formType:v.type,model_name:k,inline_edit:scope.inline_edit},url:scope.url,wf:scope.wf,nodeModelChange:function(item){}}),angular.forEach(v.schema,function(item){scope[v.type][k].schema.properties[item.name]=angular.copy(item),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&&(scope.model[k][item.name]=generator.dateformatter(scope.model[k][item.name]))}catch(e){$log.debug("Error: ",e.message)}}),$timeout(function(){"ListNode"===v.type&&(scope[v.type][k].items=angular.copy(scope.model[k]||[]),angular.forEach(scope[v.type][k].items,function(value,key){value.constructor===Object&&angular.forEach(value,function(x,y){try{"date"===scope[v.type][k].schema.properties[y].type&&(scope[v.type][k].items[key][y]=generator.dateformatter(x),scope[v.type][k].model[key][y]=generator.dateformatter(x)),"select"===scope[v.type][k].schema.properties[y].type&&(scope[v.type][k].items[key][y]=generator.item_from_array(x.toString(),scope[v.type][k].schema.properties[y].titleMap))}catch(e){$log.debug("Field is not date")}})}))}),scope.model[k]&&angular.forEach(scope.model[k],function(value,key){angular.forEach(value,function(y,x){y.constructor===Object&&(scope.model[k][key][x]=y.key)})}),scope.model[k]=scope.model[k]||[],scope[v.type][k].model=scope.model[k],scope[v.type][k].lengthModels=scope.model[k]?1:0)}),$log.debug("scope at after prepareformitems",scope),generator.group(scope)},generator.dateformatter=function(formObject){varndate=newDate(formObject);if(isNaN(ndate))return"";varnewdatearray=Moment(ndate).format("DD.MM.YYYY");return$log.debug("date formatted: ",newdatearray),newdatearray},generator.doItemAction=function($scope,key,todo,mode){var_do={normal:function(){return$log.debug("normal mode starts"),$scope.form_params.cmd=todo.cmd,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,generator.get_wf($scope)},modal:function(){$log.debug("modal mode is not not ready")},"new":function(){$log.debug("new mode is not not ready")}};return_do[mode]()},generator.button_switch=function(position){varbuttons=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){returngenerator.button_switch(!1),$http.post(generator.makeUrl(scope),scope.form_params).then(function(res){returngenerator.button_switch(!0),generator.generate(scope,res.data)})},generator.get_list=function(scope){returngenerator.button_switch(!1),$http.post(generator.makeUrl(scope),scope.form_params).then(function(res){returngenerator.button_switch(!0),res})},generator.get_wf=function(scope){returngenerator.button_switch(!1),$http.post(generator.makeUrl(scope),scope.form_params).then(function(res){if(generator.button_switch(!0),res.data.client_cmd)returngenerator.pathDecider(res.data.client_cmd,scope,res.data);if(res.data.msgbox){scope.msgbox=res.data.msgbox;varnewElement=$compile("<msgbox></msgbox>")(scope);angular.element(document.querySelector(".main.ng-scope")).children().remove(),angular.element(document.querySelector(".main.ng-scope")).append(newElement)}})},generator.isValidEmail=function(email){varre=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;returnre.test(email)},generator.isValidTCNo=function(tcno){varre=/^([1-9]{1}[0-9]{9}[0,2,4,6,8]{1})$/i;returnre.test(tcno)},generator.isValidDate=function(dateValue){return!isNaN(Date.parse(dateValue))},generator.pageData={},generator.getPageData=function(){returngenerator.pageData},generator.setPageData=function(value){generator.pageData=value},generator.pathDecider=function(client_cmd,$scope,data){functionredirectTo(scope,page){varpathUrl="/"+scope.form_params.wf;returnpathUrl+=scope.form_params.model?"/"+scope.form_params.model+"/do/"+page:"/do/"+page,$location.path()===pathUrl?$route.reload():void$location.path(pathUrl)}functiondispatchClientCmd(){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,data.second_client_cmd=client_cmd[1],generator.setPageData(data),redirectTo($scope,client_cmd[0])}return"reload"===client_cmd[0]||"reset"===client_cmd[0]?void$rootScope.$broadcast("reload_cmd",$scope.reload_cmd):voiddispatchClientCmd()},generator.get_diff=function(oldObj,newObj){varresult={};returnangular.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){varresult=[];returnangular.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){varresult=item;returnangular.forEach(array,function(value,key){value.value===item&&(result=value.name)}),result},generator.submit=function($scope,redirectTo){angular.forEach($scope.ListNode,function(value,key){$scope.model[key]=value.model}),angular.forEach($scope.Node,function(value,key){$scope.model[key]=value.model});vardata={form:$scope.model,token:$scope.token,model:$scope.form_params.model,cmd:$scope.form_params.cmd,flow:$scope.form_params.flow,object_id:$scope.object_id,filter:$scope.filter,query:$scope.form_params.query};return$http.post(generator.makeUrl($scope),data).success(function(data,status,headers){if("application/pdf"===headers("content-type")){vara=document.createElement("a");document.body.appendChild(a),a.style="display: none";varfile=newBlob([data],{type:"application/pdf"}),fileURL=URL.createObjectURL(file),fileName=$scope.schema.title;a.href=fileURL,a.download=fileName,a.click()}if(redirectTo===!0&&(data.client_cmd&&generator.pathDecider(data.client_cmd,$scope,data),data.msgbox)){$scope.msgbox=data.msgbox;varnewElement=$compile("<msgbox></msgbox>")($scope);angular.element(document.querySelector(".main.ng-scope")).children().remove(),angular.element(document.querySelector(".main.ng-scope")).append(newElement)}})},generator}).controller("ModalCtrl",function($scope,$uibModalInstance,Generator,items){angular.forEach(items,function(value,key){$scope[key]=items[key]}),$scope.$on("disposeModal",function(){$scope.cancel()}),$scope.$on("modalFormLocator",function(event){$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){return{link:function(scope,element,attributes){element.on("click",function(){varmodalInstance=$uibModal.open({animation:!0,backdrop:"static",keyboard:!1,templateUrl:"shared/templates/listnodeModalContent.html",controller:"ModalCtrl",size:"lg",resolve:{items:function(){varattribs=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){scope.node.schema.properties[key].wf=scope.node.url,scope.node.schema.properties[key].list_cmd="select_list"});varnewscope={wf:scope.node.wf,url:scope.node.url,form_params:{model:scope.node.schema.model_name},edit:attribs[3]};returnGenerator.generate(newscope,{forms:scope.node}),newscope.model=newscope.model[node.edit]||newscope.model[0]||{},newscope}}});modalInstance.result.then(function(childmodel,key){varlistNodeItem=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){varreformattedModel={};angular.forEach(childmodel.model,function(value,key){key.indexOf("_id")>-1?angular.forEach(childmodel.form,function(v,k){functionindexInTitleMap(element,index,array){returnelement.value===value?element:void0}v.formName===key&&(reformattedModel[key]={key:value,unicode:v.titleMap.find(indexInTitleMap).name})}):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(){varmodalInstance=$uibModal.open({animation:!0,backdrop:"static",keyboard:!1,templateUrl:"shared/templates/linkedModelModalContent.html",controller:"ModalCtrl",size:"lg",resolve:{items:function(){varformName=attributes.addModalForLinkedModel;returnGenerator.get_form({url:scope.form.wf,wf:scope.form.wf,form_params:{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){varformName=childscope.formName;Generator.submit(childscope,!1).success(function(data){scope.model[formName]=data.forms.model.object_key,scope.form.titleMap.push({value:data.forms.model.object_key,name:data.forms.model.unicode}),scope.form.selected_item={value:data.forms.model.object_key,name:data.forms.model.unicode},scope.$watch(document.querySelector("input[name="+scope.form.model_name+"]"),function(){angular.element(document.querySelector("input[name="+scope.form.model_name+"]")).val(scope.form.selected_item.name)})})})})}}}).directive("modalFormLocator",function(){return{link:function(scope){scope.$emit("modalFormLocator")}}}),angular.module("ulakbus").directive("logout",function($http,$location,RESTURL){return{link:function($scope,$element,$rootScope){$element.on("click",function(){$http.post(RESTURL.url+"logout",{}).then(function(){$rootScope.loggedInUser=!1,$location.path("/login")})})}}}).directive("headerNotification",function($http,$rootScope,$cookies,$interval,RESTURL){return{templateUrl:"shared/templates/directives/header-notification.html",restrict:"E",replace:!0,link:function($scope){$scope.groupNotifications=function(notifications){$scope.notifications={1:[],2:[],3:[],4:[]},angular.forEach(notifications,function(value,key){$scope.notifications[value.type].push(value)})},$scope.getNotifications=function(){$http.get(RESTURL.url+"notify",{ignoreLoadingBar:!0}).success(function(data){$scope.groupNotifications(data.notifications),$rootScope.$broadcast("notifications",$scope.notifications)})},$scope.getNotifications(),$interval(function(){"on"==$cookies.get("notificate")&&$scope.getNotifications()},5e3),$scope.markAsRead=function(items){$http.post(RESTURL.url+"notify",{ignoreLoadingBar:!0,read:[items]}).success(function(data){$scope.groupNotifications(data.notifications),$rootScope.$broadcast("notifications",$scope.notifications)})},$scope.$on("markasread",function(event,data){$scope.markAsRead(data)})}}}).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){varsearchparams={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,query:$scope.searchModel.searchbox}};Generator.submit(searchparams).success(function(data){$rootScope.$broadcast("updateObjects",data.objects)})}}}}}).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){varsortparams={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")||0,$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("selectedUser",function($http,RESTURL){return{templateUrl:"shared/templates/directives/selected-user.html",restrict:"E",replace:!0,link:function($scope,$rootScope){$scope.$on("selectedUser",function($event,data){$scope.selectedUser=data,$scope.dynamicPopover={content:"",name:data.name,tcno:data.tcno,key:data.key,templateUrl:"shared/templates/directives/selectedUserPopover.html",title:"İşlem Yapılan Kişi"}}),$scope.$on("selectedUserTrigger",function($event,data){({model:"Personel",cmd:"show",id:data[1]});$http.get(RESTURL.url+"ara/personel/"+data[1]).success(function(data){})})}}}).directive("sidebar",["$location",function(){return{templateUrl:"shared/templates/directives/sidebar.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope,$cookies,$route,$http,RESTURL,$log,$location,$window,$timeout){
$scope.prepareMenu=function(menuItems){varnewMenuItems={};returnangular.forEach(menuItems,function(value,key){angular.forEach(value,function(v,k){newMenuItems[k]=v})}),newMenuItems};varsidebarmenu=$("#side-menu");sidebarmenu.metisMenu(),$http.get(RESTURL.url+"menu/").success(function(data){functionreGroupMenuItems(items,baseCategory){varnewItems={};returnangular.forEach(items,function(value,key){newItems[value.kategori]=newItems[value.kategori]||[],value.baseCategory=baseCategory,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,deletedata.quick_menu,$log.debug("quick menu",$rootScope.quick_menu),$rootScope.$broadcast("authz",data),$rootScope.searchInputs=data,$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()})}),$scope.$on("menuitems",function(event,data){varmenu={};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},$scope.openSidebar=function(){$window.innerWidth>"768"&&0===$rootScope.sidebarPinned&&(jQuery("span.menu-text, span.arrow, .sidebar footer, #side-menu").fadeIn(400),jQuery(".sidebar").css("width","250px"),jQuery(".manager-view").css("width","calc(100% - 250px)"),$rootScope.collapsed=!1)},$scope.closeSidebar=function(){$window.innerWidth>"768"&&0===$rootScope.sidebarPinned&&(jQuery(".sidebar").css("width","62px"),jQuery(".manager-view").css("width","calc(100% - 62px)"),$rootScope.collapsed=!0)},$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){varsidebarUserMenu=$("#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){varreader=newFileReader;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])})}}}),angular.module("ulakbus.auth",["ngRoute","ngCookies"]).controller("LoginCtrl",function($scope,$q,$timeout,$routeParams,$rootScope,$log,Generator,AuthService){$scope.url="login",$scope.form_params={},$scope.form_params.clear_wf=1,Generator.get_form($scope).then(function(data){$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).error(function(data){$scope.message=data.title,$scope.loggingIn=!1}).then(function(){$scope.loggingIn=!1,Generator.button_switch(!1)})):$log.debug("not valid")},$log.debug("login attempt: ",$rootScope.loginAttempt)}),angular.module("ulakbus.auth").factory("AuthService",function($http,$rootScope,$location,$log,Generator,RESTURL){varauthService={};returnauthService.login=function(url,credentials){returncredentials.cmd="do",$http.post(RESTURL.url+url,credentials).success(function(data,status,headers,config){$rootScope.loggedInUser=!0}).error(function(data,status,headers,config){returndata.title="İşlem başarısız oldu. Lütfen girdiğiniz bilgileri kontrol ediniz.",data})},authService.logout=function(){return$log.debug("logout"),$http.post(RESTURL.url+"logout",{}).success(function(data){$rootScope.loggedInUser=!1,$log.debug("loggedout"),$location.path("/login")})},authService}),angular.module("ulakbus.dashboard",[]).config(function($uibTooltipProvider){$uibTooltipProvider.setTriggers({click:"mouseleave"})}).controller("DashCtrl",function($scope,$rootScope,$timeout,$http,$cookies,RESTURL,Generator){$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){$timeout(function(){"personel"===where&&$scope.keyword.staff.length>2&&$scope.getItems(where,$scope.keyword.staff).success(function(data){$scope.staffs=data.results}),"ogrenci"===where&&$scope.keyword.student.length>2&&$scope.getItems(where,$scope.keyword.student).success(function(data){$scope.students=data.results})},500)},$scope.getItems=function(where,what){return$scope.showResults=!0,$http.get(RESTURL.url+"ara/"+where+"/"+what)},$scope.userPopover={templateUrl:"components/dashboard/user-info.html"},$scope.get_info=function(type,key){Generator.get_list({url:"crud",form_params:{model:type,object_id:key,cmd:"show"}}).then(function(data){$scope.userPopover.name=data.data.object.unicode,$scope.userPopover.tcno=data.data.object.tckn})},$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)}}).directive("sidebarNotifications",function(){return{templateUrl:"shared/templates/directives/sidebar-notification.html",restrict:"E",replace:!0,link:function($scope){}}}),angular.module("ulakbus.crud",["ui.bootstrap","schemaForm","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){returnscope.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:{}},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}),angular.forEach(scope.objects,function(value,key){if(key>0){varlinkIndexes={};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("CRUDCtrl",function($scope,$routeParams,Generator,CrudUtility){CrudUtility.generateParam($scope,$routeParams),Generator.get_wf($scope)}).controller("CRUDListFormCtrl",function($scope,$rootScope,$location,$http,$log,$uibModal,$timeout,Generator,$routeParams,CrudUtility){$scope.reload=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.reload({})}),$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){returnnewArray(num)},$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);varpageData=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.listFormCmd=function(){varsetpageobjects=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()),(void0===pageData.pageData||pageData.pageData===!1)&&(CrudUtility.generateParam($scope,$routeParams,$routeParams.cmd),Generator.get_wf($scope)),$scope.object&&$scope.createListObjects()},$scope.reloadCmd=function(){$scope.reload({})},$scope.resetCmd=function(){delete$scope.token,$scope.cmd="reset",Generator.get_wf($scope)};varexecuteCmd={show:$scope.showCmd,list:$scope.listFormCmd,form:$scope.listFormCmd,reload:$scope.reloadCmd,reset:$scope.resetCmd};returnexecuteCmd[$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.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?!0:!1})}),$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){vardateValues=[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)}}}}),angular.module("ulakbus.debug",["ngRoute"]).controller("DebugCtrl",function($scope,$rootScope,$location){$scope.debug_queries=$rootScope.debug_queries}),angular.module("ulakbus.devSettings",["ngRoute"]).controller("DevSettingsCtrl",function($scope,$cookies,$rootScope,RESTURL){$scope.backendurl=$cookies.get("backendurl"),$scope.notificate=$cookies.get("notificate")||"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.setnotification=function(){$scope.changeSettings("notificate",$scope.switchOnOff($scope.notificate))}}),angular.module("ulakbus").config(["$routeProvider",function($routeProvider){$routeProvider.when("/error/500",{templateUrl:"components/error_pages/500.html",controller:"500Ctrl"}).when("/error/404",{templateUrl:"components/error_pages/404.html",controller:"404Ctrl"})}]),angular.module("ulakbus.error_pages",["ngRoute"]).controller("500Ctrl",function($scope,$rootScope,$location){}).controller("404Ctrl",function($scope,$rootScope,$location){}),angular.module("ulakbus.version",["ulakbus.version.interpolate-filter","ulakbus.version.version-directive"]).value("version","0.6.10"),angular.module("ulakbus.version.interpolate-filter",[]).filter("interpolate",["version",function(version){returnfunction(text){returnString(text).replace(/\%VERSION\%/gm,version)}}]),angular.module("ulakbus.version.version-directive",[]).directive("appVersion",["version",function(version){returnfunction(scope,elm,attrs){elm.text(version)}}]);
"use strict";if(angular.module("ngLocale",[],["$provide",function($provide){varPLURAL_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){return1==n?PLURAL_CATEGORY.ONE:PLURAL_CATEGORY.OTHER}})}]),"undefined"==typeofjQuery)thrownewError("Bootstrap's JavaScript requires jQuery");+function($){varversion=$.fn.jquery.split(" ")[0].split(".");if(version[0]<2&&version[1]<9||1==version[0]&&9==version[1]&&version[2]<1||version[0]>2)thrownewError("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function($){functiontransitionEnd(){varel=document.createElement("bootstrap"),transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(varnameintransEndEventNames)if(void0!==el.style[name])return{end:transEndEventNames[name]};return!1}$.fn.emulateTransitionEnd=function(duration){varcalled=!1,$el=this;$(this).one("bsTransitionEnd",function(){called=!0});varcallback=function(){called||$($el).trigger($.support.transition.end)};returnsetTimeout(callback,duration),this},$(function(){$.support.transition=transitionEnd(),$.support.transition&&($.event.special.bsTransitionEnd={bindType:$.support.transition.end,delegateType:$.support.transition.end,handle:function(e){return$(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void0}})})}(jQuery),+function($){functionPlugin(option){returnthis.each(function(){var$this=$(this),data=$this.data("bs.alert");data||$this.data("bs.alert",data=newAlert(this)),"string"==typeofoption&&data[option].call($this)})}vardismiss='[data-dismiss="alert"]',Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.VERSION="3.3.6",Alert.TRANSITION_DURATION=150,Alert.prototype.close=function(e){functionremoveElement(){$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);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())};varold=$.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($){functionPlugin(option){returnthis.each(function(){var$this=$(this),data=$this.data("bs.button"),options="object"==typeofoption&&option;data||$this.data("bs.button",data=newButton(this,options)),"toggle"==option?data.toggle():option&&data.setState(option)})}varButton=function(element,options){this.$element=$(element),this.options=$.extend({},Button.DEFAULTS,options),this.isLoading=!1};Button.VERSION="3.3.6",Button.DEFAULTS={loadingText:"loading..."},Button.prototype.setState=function(state){vard="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)):this.isLoading&&(this.isLoading=!1,$el.removeClass(d).removeAttr(d))},this),0)},Button.prototype.toggle=function(){varchanged=!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")}elsethis.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};varold=$.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);$btn.hasClass("btn")||($btn=$btn.closest(".btn")),Plugin.call($btn,"toggle"),$(e.target).is('input[type="radio"]')||$(e.target).is('input[type="checkbox"]')||e.preventDefault()}).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($){functionPlugin(option){returnthis.each(function(){var$this=$(this),data=$this.data("bs.carousel"),options=$.extend({},Carousel.DEFAULTS,$this.data(),"object"==typeofoption&&option),action="string"==typeofoption?option:options.slide;data||$this.data("bs.carousel",data=newCarousel(this,options)),"number"==typeofoption?data.to(option):action?data[action]():options.interval&&data.pause().cycle()})}varCarousel=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"indocument.documentElement)&&this.$element.on("mouseenter.bs.carousel",$.proxy(this.pause,this)).on("mouseleave.bs.carousel",$.proxy(this.cycle,this))};Carousel.VERSION="3.3.6",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){case37:this.prev();break;case39:this.next();break;default:return}e.preventDefault()}},Carousel.prototype.cycle=function(e){returne||(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){returnthis.$items=item.parent().children(".item"),this.$items.index(item||this.$active)},Carousel.prototype.getItemForDirection=function(direction,active){varactiveIndex=this.getItemIndex(active),willWrap="prev"==direction&&0===activeIndex||"next"==direction&&activeIndex==this.$items.length-1;if(willWrap&&!this.options.wrap)returnactive;vardelta="prev"==direction?-1:1,itemIndex=(activeIndex+delta)%this.$items.length;returnthis.$items.eq(itemIndex)},Carousel.prototype.to=function(pos){varthat=this,activeIndex=this.getItemIndex(this.$active=this.$element.find(".item.active"));returnpos>this.$items.length-1||0>pos?void0: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){returne||(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(){returnthis.sliding?void0:this.slide("next")},Carousel.prototype.prev=function(){returnthis.sliding?void0: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"))returnthis.sliding=!1;varrelatedTarget=$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")}varslidEvent=$.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}};varold=$.fn.carousel;$.fn.carousel=Plugin,$.fn.carousel.Constructor=Carousel,$.fn.carousel.noConflict=function(){return$.fn.carousel=old,this};varclickHandler=function(e){varhref,$this=$(this),$target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""));if($target.hasClass("carousel")){varoptions=$.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($){functiongetTargetFromTrigger($trigger){varhref,target=$trigger.attr("data-target")||(href=$trigger.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"");return$(target)}functionPlugin(option){returnthis.each(function(){var$this=$(this),data=$this.data("bs.collapse"),options=$.extend({},Collapse.DEFAULTS,$this.data(),"object"==typeofoption&&option);!data&&options.toggle&&/show|hide/.test(option)&&(options.toggle=!1),data||$this.data("bs.collapse",data=newCollapse(this,options)),"string"==typeofoption&&data[option]()})}varCollapse=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.6",Collapse.TRANSITION_DURATION=350,Collapse.DEFAULTS={toggle:!0},Collapse.prototype.dimension=function(){varhasWidth=this.$element.hasClass("width");returnhasWidth?"width":"height"},Collapse.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){varactivesData,actives=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(actives&&actives.length&&(activesData=actives.data("bs.collapse"),activesData&&activesData.transitioning))){varstartEvent=$.Event("show.bs.collapse");if(this.$element.trigger(startEvent),!startEvent.isDefaultPrevented()){actives&&actives.length&&(Plugin.call(actives,"hide"),activesData||actives.data("bs.collapse",null));vardimension=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;varcomplete=function(){this.$element.removeClass("collapsing").addClass("collapse in")[dimension](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!$.support.transition)returncomplete.call(this);varscrollSize=$.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")){varstartEvent=$.Event("hide.bs.collapse");if(this.$element.trigger(startEvent),!startEvent.isDefaultPrevented()){vardimension=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;varcomplete=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return$.support.transition?voidthis.$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){varisOpen=$element.hasClass("in");$element.attr("aria-expanded",isOpen),$trigger.toggleClass("collapsed",!isOpen).attr("aria-expanded",isOpen)};varold=$.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($){functiongetParent($this){varselector=$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()}functionclearMenus(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)))))}))}functionPlugin(option){returnthis.each(function(){var$this=$(this),data=$this.data("bs.dropdown");data||$this.data("bs.dropdown",data=newDropdown(this)),"string"==typeofoption&&data[option].call($this)})}varbackdrop=".dropdown-backdrop",toggle='[data-toggle="dropdown"]',Dropdown=function(element){$(element).on("click.bs.dropdown",this.toggle)};Dropdown.VERSION="3.3.6",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"indocument.documentElement&&!$parent.closest(".navbar-nav").length&&$(document.createElement("div")).addClass("dropdown-backdrop").insertAfter($(this)).on("click",clearMenus);varrelatedTarget={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)return27==e.which&&$parent.find(toggle).trigger("focus"),$this.trigger("click");vardesc=" li:not(.disabled):visible a",$items=$parent.find(".dropdown-menu"+desc);if($items.length){varindex=$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")}}}};varold=$.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($){functionPlugin(option,_relatedTarget){returnthis.each(function(){var$this=$(this),data=$this.data("bs.modal"),options=$.extend({},Modal.DEFAULTS,$this.data(),"object"==typeofoption&&option);data||$this.data("bs.modal",data=newModal(this,options)),"string"==typeofoption?data[option](_relatedTarget):options.show&&data.show(_relatedTarget)})}varModal=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.6",Modal.TRANSITION_DURATION=300,Modal.BACKDROP_TRANSITION_DURATION=150,Modal.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},Modal.prototype.toggle=function(_relatedTarget){returnthis.isShown?this.hide():this.show(_relatedTarget)},Modal.prototype.show=function(_relatedTarget){varthat=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(){vartransition=$.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();vare=$.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){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(){varthat=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){varthat=this,animate=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){vardoAnimate=$.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){returnthis.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()}elseif(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");varcallbackRemove=function(){that.removeBackdrop(),callback&&callback()};$.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",callbackRemove).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callbackRemove()}elsecallback&&callback()},Modal.prototype.handleUpdate=function(){this.adjustDialog()},Modal.prototype.adjustDialog=function(){varmodalIsOverflowing=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(){varfullWindowWidth=window.innerWidth;if(!fullWindowWidth){vardocumentElementRect=document.documentElement.getBoundingClientRect();fullWindowWidth=documentElementRect.right-Math.abs(documentElementRect.left)}this.bodyIsOverflowing=document.body.clientWidth<fullWindowWidth,this.scrollbarWidth=this.measureScrollbar()},Modal.prototype.setScrollbar=function(){varbodyPad=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(){varscrollDiv=document.createElement("div");scrollDiv.className="modal-scrollbar-measure",this.$body.append(scrollDiv);varscrollbarWidth=scrollDiv.offsetWidth-scrollDiv.clientWidth;returnthis.$body[0].removeChild(scrollDiv),scrollbarWidth};varold=$.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($){functionPlugin(option){returnthis.each(function(){var$this=$(this),data=$this.data("bs.tooltip"),options="object"==typeofoption&&option;(data||!/destroy|hide/.test(option))&&(data||$this.data("bs.tooltip",data=newTooltip(this,options)),"string"==typeofoption&&data[option]())})}varTooltip=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.6",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]instanceofdocument.constructor&&!this.options.selector)thrownewError("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(vartriggers=this.options.trigger.split(" "),i=triggers.length;i--;){vartrigger=triggers[i];if("click"==trigger)this.$element.on("click."+this.type,this.options.selector,$.proxy(this.toggle,this));elseif("manual"!=trigger){vareventIn="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(){returnTooltip.DEFAULTS},Tooltip.prototype.getOptions=function(options){returnoptions=$.extend({},this.getDefaults(),this.$element.data(),options),options.delay&&"number"==typeofoptions.delay&&(options.delay={show:options.delay,hide:options.delay}),options},Tooltip.prototype.getDelegateOptions=function(){varoptions={},defaults=this.getDefaults();returnthis._options&&$.each(this._options,function(key,value){defaults[key]!=value&&(options[key]=value)}),options},Tooltip.prototype.enter=function(obj){varself=objinstanceofthis.constructor?obj:$(obj.currentTarget).data("bs."+this.type);returnself||(self=newthis.constructor(obj.currentTarget,this.getDelegateOptions()),$(obj.currentTarget).data("bs."+this.type,self)),objinstanceof$.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(varkeyinthis.inState)if(this.inState[key])return!0;return!1},Tooltip.prototype.leave=function(obj){varself=objinstanceofthis.constructor?obj:$(obj.currentTarget).data("bs."+this.type);returnself||(self=newthis.constructor(obj.currentTarget,this.getDelegateOptions()),$(obj.currentTarget).data("bs."+this.type,self)),objinstanceof$.Event&&(self.inState["focusout"==obj.type?"focus":"hover"]=!1),self.isInStateTrue()?void0:(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(){vare=$.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);varinDom=$.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!inDom)return;varthat=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");varplacement="function"==typeofthis.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);varpos=this.getPosition(),actualWidth=$tip[0].offsetWidth,actualHeight=$tip[0].offsetHeight;if(autoPlace){varorgPlacement=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)}varcalculatedOffset=this.getCalculatedOffset(placement,pos,actualWidth,actualHeight);this.applyPlacement(calculatedOffset,placement);varcomplete=function(){varprevHoverState=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");varactualWidth=$tip[0].offsetWidth,actualHeight=$tip[0].offsetHeight;"top"==placement&&actualHeight!=height&&(offset.top=offset.top+height-actualHeight);vardelta=this.getViewportAdjustedDelta(placement,offset,actualWidth,actualHeight);delta.left?offset.left+=delta.left:offset.top+=delta.top;varisVertical=/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){functioncomplete(){"in"!=that.hoverState&&$tip.detach(),
that.$element.removeAttr("aria-describedby").trigger("hidden.bs."+that.type),callback&&callback()}varthat=this,$tip=$(this.$tip),e=$.Event("hide.bs."+this.type);returnthis.$element.trigger(e),e.isDefaultPrevented()?void0:($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(){returnthis.getTitle()},Tooltip.prototype.getPosition=function($element){$element=$element||this.$element;varel=$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}));varelOffset=isBody?{top:0,left:0}:$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){vardelta={top:0,left:0};if(!this.$viewport)returndelta;varviewportPadding=this.options.viewport&&this.options.viewport.padding||0,viewportDimensions=this.getPosition(this.$viewport);if(/right|left/.test(placement)){vartopEdgeOffset=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{varleftEdgeOffset=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)}returndelta},Tooltip.prototype.getTitle=function(){vartitle,$e=this.$element,o=this.options;returntitle=$e.attr("data-original-title")||("function"==typeofo.title?o.title.call($e[0]):o.title)},Tooltip.prototype.getUID=function(prefix){doprefix+=~~(1e6*Math.random());while(document.getElementById(prefix));returnprefix},Tooltip.prototype.tip=function(){if(!this.$tip&&(this.$tip=$(this.options.template),1!=this.$tip.length))thrownewError(this.type+" `template` option must consist of exactly 1 top-level element!");returnthis.$tip},Tooltip.prototype.arrow=function(){returnthis.$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){varself=this;e&&(self=$(e.currentTarget).data("bs."+this.type),self||(self=newthis.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(){varthat=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})};varold=$.fn.tooltip;$.fn.tooltip=Plugin,$.fn.tooltip.Constructor=Tooltip,$.fn.tooltip.noConflict=function(){return$.fn.tooltip=old,this}}(jQuery),+function($){functionPlugin(option){returnthis.each(function(){var$this=$(this),data=$this.data("bs.popover"),options="object"==typeofoption&&option;(data||!/destroy|hide/.test(option))&&(data||$this.data("bs.popover",data=newPopover(this,options)),"string"==typeofoption&&data[option]())})}varPopover=function(element,options){this.init("popover",element,options)};if(!$.fn.tooltip)thrownewError("Popover requires tooltip.js");Popover.VERSION="3.3.6",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(){returnPopover.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"==typeofcontent?"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(){returnthis.getTitle()||this.getContent()},Popover.prototype.getContent=function(){var$e=this.$element,o=this.options;return$e.attr("data-content")||("function"==typeofo.content?o.content.call($e[0]):o.content)},Popover.prototype.arrow=function(){returnthis.$arrow=this.$arrow||this.tip().find(".arrow")};varold=$.fn.popover;$.fn.popover=Plugin,$.fn.popover.Constructor=Popover,$.fn.popover.noConflict=function(){return$.fn.popover=old,this}}(jQuery),+function($){functionScrollSpy(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()}functionPlugin(option){returnthis.each(function(){var$this=$(this),data=$this.data("bs.scrollspy"),options="object"==typeofoption&&option;data||$this.data("bs.scrollspy",data=newScrollSpy(this,options)),"string"==typeofoption&&data[option]()})}ScrollSpy.VERSION="3.3.6",ScrollSpy.DEFAULTS={offset:10},ScrollSpy.prototype.getScrollHeight=function(){returnthis.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},ScrollSpy.prototype.refresh=function(){varthat=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){returna[0]-b[0]}).each(function(){that.offsets.push(this[0]),that.targets.push(this[1])})},ScrollSpy.prototype.process=function(){vari,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)returnactiveTarget!=(i=targets[targets.length-1])&&this.activate(i);if(activeTarget&&scrollTop<offsets[0])returnthis.activeTarget=null,this.clear();for(i=offsets.length;i--;)activeTarget!=targets[i]&&scrollTop>=offsets[i]&&(void0===offsets[i+1]||scrollTop<offsets[i+1])&&this.activate(targets[i])},ScrollSpy.prototype.activate=function(target){this.activeTarget=target,this.clear();varselector=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")};varold=$.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($){functionPlugin(option){returnthis.each(function(){var$this=$(this),data=$this.data("bs.tab");data||$this.data("bs.tab",data=newTab(this)),"string"==typeofoption&&data[option]()})}varTab=function(element){this.element=$(element)};Tab.VERSION="3.3.6",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){functionnext(){$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")};varold=$.fn.tab;$.fn.tab=Plugin,$.fn.tab.Constructor=Tab,$.fn.tab.noConflict=function(){return$.fn.tab=old,this};varclickHandler=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($){functionPlugin(option){returnthis.each(function(){var$this=$(this),data=$this.data("bs.affix"),options="object"==typeofoption&&option;data||$this.data("bs.affix",data=newAffix(this,options)),"string"==typeofoption&&data[option]()})}varAffix=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.6",Affix.RESET="affix affix-top affix-bottom",Affix.DEFAULTS={offset:0,target:window},Affix.prototype.getState=function(scrollHeight,height,offsetTop,offsetBottom){varscrollTop=this.$target.scrollTop(),position=this.$element.offset(),targetHeight=this.$target.height();if(null!=offsetTop&&"top"==this.affixed)returnoffsetTop>scrollTop?"top":!1;if("bottom"==this.affixed)returnnull!=offsetTop?scrollTop+this.unpin<=position.top?!1:"bottom":scrollHeight-offsetBottom>=scrollTop+targetHeight?!1:"bottom";varinitializing=null==this.affixed,colliderTop=initializing?scrollTop:position.top,colliderHeight=initializing?targetHeight:height;returnnull!=offsetTop&&offsetTop>=scrollTop?"top":null!=offsetBottom&&colliderTop+colliderHeight>=scrollHeight-offsetBottom?"bottom":!1},Affix.prototype.getPinnedOffset=function(){if(this.pinnedOffset)returnthis.pinnedOffset;this.$element.removeClass(Affix.RESET).addClass("affix");varscrollTop=this.$target.scrollTop(),position=this.$element.offset();returnthis.pinnedOffset=position.top-scrollTop},Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)},Affix.prototype.checkPosition=function(){if(this.$element.is(":visible")){varheight=this.$element.height(),offset=this.options.offset,offsetTop=offset.top,offsetBottom=offset.bottom,scrollHeight=Math.max($(document).height(),$(document.body).height());"object"!=typeofoffset&&(offsetBottom=offsetTop=offset),"function"==typeofoffsetTop&&(offsetTop=offset.top(this.$element)),"function"==typeofoffsetBottom&&(offsetBottom=offset.bottom(this.$element));varaffix=this.getState(scrollHeight,height,offsetTop,offsetBottom);if(this.affixed!=affix){null!=this.unpin&&this.$element.css("top","");varaffixType="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})}};varold=$.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(){functioninherit(parent,extra){returnangular.extend(Object.create(parent),extra)}functionpathRegExp(path,opts){varinsensitive=opts.caseInsensitiveMatch,ret={originalPath:path,regexp:path},keys=ret.keys=[];returnpath=path.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(_,slash,key,option){varoptional="?"===option?option:null,star="*"===option?option:null;returnkeys.push({name:key,optional:!!optional}),slash=slash||"",""+(optional?"":slash)+"(?:"+(optional?slash:"")+(star&&"(.+?)"||"([^/]+)")+(optional||"")+")"+(optional||"")}).replace(/([\/$\*])/g,"\\$1"),ret.regexp=newRegExp("^"+path+"$",insensitive?"i":""),ret}varroutes={};this.when=function(path,route){varrouteCopy=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){varredirectPath="/"==path[path.length-1]?path.substr(0,path.length-1):path+"/";routes[redirectPath]=angular.extend({redirectTo:path},pathRegExp(redirectPath,routeCopy))}returnthis},this.caseInsensitiveMatch=!1,this.otherwise=function(params){return"string"==typeofparams&&(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){functionswitchRouteMatcher(on,route){varkeys=route.keys,params={};if(!route.regexp)returnnull;varm=route.regexp.exec(on);if(!m)returnnull;for(vari=1,len=m.length;len>i;++i){varkey=keys[i-1],val=m[i];key&&val&&(params[key.name]=val)}returnparams}functionprepareRoute($locationEvent){varlastRoute=$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()}functioncommitRoute(){varlastRoute=$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){vartemplate,templateUrl,locals=angular.extend({},nextRoute.resolve);returnangular.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)}))}functionparseRoute(){varparams,match;returnangular.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:{}})}functioninterpolate(string,params){varresult=[];returnangular.forEach((string||"").split(":"),function(segment,i){if(0===i)result.push(segment);else{varsegmentMatch=segment.match(/(\w+)(?:[?*])?(.*)/),key=segmentMatch[1];result.push(params[key]),result.push(segmentMatch[2]||""),deleteparams[key]}}),result.join("")}varpreparedRoute,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{}}}functionngViewFactory($route,$anchorScroll,$animate){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(scope,$element,attr,ctrl,$transclude){functioncleanupLastView(){previousLeaveAnimation&&($animate.cancel(previousLeaveAnimation),previousLeaveAnimation=null),currentScope&&(currentScope.$destroy(),currentScope=null),currentElement&&(previousLeaveAnimation=$animate.leave(currentElement),previousLeaveAnimation.then(function(){previousLeaveAnimation=null}),currentElement=null)}functionupdate(){varlocals=$route.current&&$route.current.locals,template=locals&&locals.$template;if(angular.isDefined(template)){varnewScope=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)}elsecleanupLastView()}varcurrentScope,currentElement,previousLeaveAnimation,autoScrollExp=attr.autoscroll,onloadExp=attr.onload||"";scope.$on("$routeChangeSuccess",update),update()}}}functionngViewFillContentFactory($compile,$controller,$route){return{restrict:"ECA",priority:-400,link:function(scope,$element){varcurrent=$route.current,locals=current.locals;$element.html(locals.$template);varlink=$compile($element.contents());if(current.controller){locals.$scope=scope;varcontroller=$controller(current.controller,locals);current.controllerAs&&(scope[current.controllerAs]=controller),$element.data("$ngControllerController",controller),$element.children().data("$ngControllerController",controller)}link(scope)}}}varngRouteModule=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){functionbuildCookieString(name,value,options){varpath,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=newDate(expires));varstr=encodeURIComponent(name)+"="+encodeURIComponent(value);str+=path?";path="+path:"",str+=options.domain?";domain="+options.domain:"",str+=expires?";expires="+expires.toUTCString():"",str+=options.secure?";secure":"";varcookieLength=str.length+1;returncookieLength>4096&&$log.warn("Cookie '"+name+"' possibly not set or overflowed because it was too large ("+cookieLength+" > 4096 bytes)!"),str}varcookiePath=$browser.baseHref(),rawDocument=$document[0];returnfunction(name,value,options){rawDocument.cookie=buildCookieString(name,value,options)}}angular.module("ngCookies",["ng"]).provider("$cookies",[function(){functioncalcOptions(options){returnoptions?angular.extend({},defaults,options):defaults}vardefaults=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function($$cookieReader,$$cookieWriter){return{get:function(key){return$$cookieReader()[key]},getObject:function(key){varvalue=this.get(key);returnvalue?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){functionisValidDottedPath(path){returnnull!=path&&""!==path&&"hasOwnProperty"!==path&&MEMBER_NAME_REGEX.test("."+path)}functionlookupDottedPath(obj,path){if(!isValidDottedPath(path))throw$resourceMinErr("badmember",'Dotted member path "@{0}" is invalid.',path);for(varkeys=path.split("."),i=0,ii=keys.length;ii>i&&angular.isDefined(obj);i++){varkey=keys[i];obj=null!==obj?obj[key]:undefined}returnobj}functionshallowClearAndCopy(src,dst){dst=dst||{},angular.forEach(dst,function(value,key){deletedst[key]});for(varkeyinsrc)!src.hasOwnProperty(key)||"$"===key.charAt(0)&&"$"===key.charAt(1)||(dst[key]=src[key]);returndst}var$resourceMinErr=angular.$$minErr("$resource"),MEMBER_NAME_REGEX=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;angular.module("ngResource",["ng"]).provider("$resource",function(){varPROTOCOL_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){functionencodeUriSegment(val){returnencodeUriQuery(val,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}functionencodeUriQuery(val,pctEncodeSpaces){returnencodeURIComponent(val).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,pctEncodeSpaces?"%20":"+")}functionRoute(template,defaults){this.template=template,this.defaults=extend({},provider.defaults,defaults),this.urlParams={}}functionresourceFactory(url,paramDefaults,actions,options){functionextractParams(data,actionParams){varids={};returnactionParams=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}functiondefaultResponseInterceptor(response){returnresponse.resource}functionResource(value){shallowClearAndCopy(value||{},this)}varroute=newRoute(url,options);returnactions=extend({},provider.defaults.actions,actions),Resource.prototype.toJSON=function(){vardata=extend({},this);returndeletedata.$promise,deletedata.$resolved,data},forEach(actions,function(action,name){varhasBody=/^(POST|PUT|PATCH)$/i.test(action.method);Resource[name]=function(a1,a2,a3,a4){vardata,success,error,params={};switch(arguments.length){case4:error=a4,success=a3;case3:case2:if(!isFunction(a2)){params=a1,data=a2,success=a3;break}if(isFunction(a1)){success=a1,error=a2;break}success=a2,error=a3;case1:isFunction(a1)?success=a1:hasBody?data=a1:params=a1;break;case0:break;default:throw$resourceMinErr("badargs","Expected up to 4 arguments [params, data, success, error], got {0} arguments",arguments.length)}varisInstanceCall=thisinstanceofResource,value=isInstanceCall?data:action.isArray?[]:newResource(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);varpromise=$http(httpConfig).then(function(response){vardata=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"==typeofitem?value.push(newResource(item)):value.push(item)})):(shallowClearAndCopy(data,value),value.$promise=promise)}returnvalue.$resolved=!0,response.resource=value,response},function(response){returnvalue.$resolved=!0,(error||noop)(response),$q.reject(response)});returnpromise=promise.then(function(response){varvalue=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={});varresult=Resource[name].call(this,params,this,success,error);returnresult.$promise||result}}),Resource.bind=function(additionalParamDefaults){returnresourceFactory(url,extend({},paramDefaults,additionalParamDefaults),actions)},Resource}varnoop=angular.noop,forEach=angular.forEach,extend=angular.extend,copy=angular.copy,isFunction=angular.isFunction;returnRoute.prototype={setUrlParams:function(config,params,actionUrl){varval,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.");!newRegExp("^\\d+$").test(param)&¶m&&newRegExp("(^|[^\\\\]):"+param+"(\\W|$)").test(url)&&(urlParams[param]=!0)}),url=url.replace(/\\:/g,":"),url=url.replace(PROTOCOL_AND_DOMAIN_REGEX,function(match){returnprotocolAndDomain=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(newRegExp(":"+urlParam+"(\\W|$)","g"),function(match,p1){returnencodedVal+p1})):url=url.replace(newRegExp("(/?):"+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){functionexpand(){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)}functionexpandDone(){element.removeClass("collapsing").addClass("collapse").css({height:"auto"})}functioncollapse(){returnelement.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()}functioncollapseDone(){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){functionexpand(){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)}functionexpandDone(){element.removeClass("collapsing").addClass("collapse in").css({height:"auto"})}functioncollapse(){returnelement.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()}functioncollapseDone(){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){varcloseOthers=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){varthat=this;this.groups.push(groupScope),groupScope.$on("$destroy",function(event){that.removeGroup(groupScope)})},this.removeGroup=function(group){varindex=this.groups.indexOf(group);-1!==index&&this.groups.splice(index,1)}}]).directive("uibAccordion",function(){return{controller:"UibAccordionController",controllerAs:"accordion",transclude:!0,templateUrl:function(element,attrs){returnattrs.templateUrl||"template/accordion/accordion.html"}}}).directive("uibAccordionGroup",function(){return{require:"^uibAccordion",transclude:!0,replace:!0,templateUrl:function(element,attrs){returnattrs.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(){returncontroller[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){returnattrs.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){returnattrs.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(){returncontroller[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;vardismissOnTimeout=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){returnattrs.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){returnattrs.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){varbuttonsCtrl=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){varisActive=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){functiongetTrueValue(){returngetCheckboxValue(attrs.btnCheckboxTrue,!0)}functiongetFalseValue(){returngetCheckboxValue(attrs.btnCheckboxFalse,!1)}functiongetCheckboxValue(attribute,defaultValue){returnangular.isDefined(attribute)?scope.$eval(attribute):defaultValue}varbuttonsCtrl=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.");varbuttonsCtrl=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){varisActive=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){functiongetTrueValue(){returngetCheckboxValue(attrs.btnCheckboxTrue,!0)}functiongetFalseValue(){returngetCheckboxValue(attrs.btnCheckboxFalse,!1)}functiongetCheckboxValue(attributeValue,defaultValue){varval=scope.$eval(attributeValue);returnangular.isDefined(val)?val:defaultValue}$buttonsSuppressWarning||$log.warn("btn-checkbox is now deprecated. Use uib-btn-checkbox instead.");varbuttonsCtrl=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){functiongoNext(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())}functiongetSlideByIndex(index){if(angular.isUndefined(slides[index].index))returnslides[index];vari;slides.length;for(i=0;i<slides.length;++i)if(slides[i].index==index)returnslides[i]}functionrestartTimer(){resetTimer();varinterval=+$scope.interval;!isNaN(interval)&&interval>0&&(currentInterval=$interval(timerFn,interval))}functionresetTimer(){currentInterval&&($interval.cancel(currentInterval),currentInterval=null)}functiontimerFn(){varinterval=+$scope.interval;isPlaying&&!isNaN(interval)&&interval>0&&slides.length?$scope.next():$scope.pause()}functionresetTransition(slides){slides.length||($scope.$currentTransition=null)}varcurrentInterval,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;vardestroyed=!1;self.select=$scope.select=function(nextSlide,direction){varnextIndex=$scope.indexOfSlide(nextSlide);void0===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(){returnself.currentSlide&&angular.isDefined(self.currentSlide.index)?+self.currentSlide.index:currentIndex},$scope.indexOfSlide=function(slide){returnangular.isDefined(slide.index)?+slide.index:slides.indexOf(slide)},$scope.next=function(){varnewIndex=(self.getCurrentIndex()+1)%slides.length;return0===newIndex&&$scope.noWrap()?void$scope.pause():self.select(getSlideByIndex(newIndex),"next")},$scope.prev=function(){varnewIndex=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){returnself.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});varindex=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&¤tIndex--,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){returnattrs.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){returnattrs.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){functionremoveClass(element,className,callback){element.removeClass(className),callback&&callback()}varNO_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)){varstopped=!1,direction=element.data(SLIDE_DIRECTION),directionClass="next"==direction?"left":"right",removeClassFn=removeClass.bind(this,element,directionClass+" "+direction,done);returnelement.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)){varstopped=!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){returnattrs.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){returnattrs.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){functioncreateParser(format){varmap=[],regex=format.split("");returnangular.forEach(formatCodeToRegex,function(data,code){varindex=format.indexOf(code);if(index>-1){format=format.split(""),regex[index]="("+data.regex+")",format[index]="$";for(vari=index+1,n=index+code.length;n>i;i++)regex[i]="",format[i]="$";format=format.join(""),map.push({index:index,apply:data.apply})}}),{regex:newRegExp("^"+regex.join("")+"$"),map:orderByFilter(map,"index")}}functionisValid(year,month,date){return1>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?31>date:!0}varlocaleId,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)returninput;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));varparser=this.parsers[format],regex=parser.regex,map=parser.map,results=input.match(regex);if(results&&results.length){varfields,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(vari=1,n=results.length;n>i;i++){varmapper=map[i-1];mapper.apply&&mapper.apply.call(fields,results[i])}returnisValid(fields.year,fields.month,fields.date)&&(angular.isDate(baseDate)&&!isNaN(baseDate.getTime())?(dt=newDate(baseDate),dt.setFullYear(fields.year,fields.month,fields.date,fields.hours,fields.minutes,fields.seconds,fields.milliseconds||0)):dt=newDate(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){functiongetStyle(el,cssprop){returnel.currentStyle?el.currentStyle[cssprop]:$window.getComputedStyle?$window.getComputedStyle(el)[cssprop]:el.style[cssprop]}functionisStaticPositioned(element){return"static"===(getStyle(element,"position")||"static")}varparentOffsetEl=function(element){for(vardocDomEl=$document[0],offsetParent=element.offsetParent||docDomEl;offsetParent&&offsetParent!==docDomEl&&isStaticPositioned(offsetParent);)offsetParent=offsetParent.offsetParent;returnoffsetParent||docDomEl};return{position:function(element){varelBCR=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);varboundingClientRect=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){varboundingClientRect=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){varhostElPos,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");varshiftWidth={center:function(){returnhostElPos.left+hostElPos.width/2-targetElWidth/2},left:function(){returnhostElPos.left},right:function(){returnhostElPos.left+hostElPos.width}},shiftHeight={center:function(){returnhostElPos.top+hostElPos.height/2-targetElHeight/2},top:function(){returnhostElPos.top},bottom:function(){returnhostElPos.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]()}}returntargetElPos}}}]),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){varself=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])?6>index?$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?newDate(value):null,self.refreshView()}):self[key]=datepickerConfig[key]?newDate(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)||newDate,$scope.$parent.$watch($attrs.initDate,function(initDate){initDate&&(ngModelCtrl.$isEmpty(ngModelCtrl.$modelValue)||ngModelCtrl.$invalid)&&(self.activeDate=initDate,self.refreshView())})):this.activeDate=newDate,$scope.isActive=function(dateObject){return0===self.compare(dateObject.date,self.activeDate)?($scope.activeDateId=dateObject.uid,!0):!1},this.init=function(ngModelCtrl_){ngModelCtrl=ngModelCtrl_,ngModelCtrl.$render=function(){self.render()}},this.render=function(){if(ngModelCtrl.$viewValue){vardate=newDate(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();vardate=ngModelCtrl.$viewValue?newDate(ngModelCtrl.$viewValue):null;ngModelCtrl.$setValidity("dateDisabled",!date||this.element&&!this.isDisabled(date))}},this.createDateObject=function(date,format){varmodel=ngModelCtrl.$viewValue?newDate(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,newDate),customClass:this.customClass(date)}},this.isDisabled=function(date){returnthis.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(vararrays=[];arr.length>0;)arrays.push(arr.splice(0,size));returnarrays},$scope.select=function(date){if($scope.datepickerMode===self.minMode){vardt=ngModelCtrl.$viewValue?newDate(ngModelCtrl.$viewValue):newDate(0,0,0,0,0,0,0);dt.setFullYear(date.getFullYear(),date.getMonth(),date.getDate()),ngModelCtrl.$setViewValue(dt),ngModelCtrl.$render()}elseself.activeDate=date,$scope.datepickerMode=self.modes[self.modes.indexOf($scope.datepickerMode)-1]},$scope.move=function(direction){varyear=self.activeDate.getFullYear()+direction*(self.step.years||0),month=self.activeDate.getMonth()+direction*(self.step.months||0);self.activeDate.setFullYear(year,month,1),self.refreshView()},$scope.toggleMode=function(direction){direction=direction||1,$scope.datepickerMode===self.maxMode&&1===direction||$scope.datepickerMode===self.minMode&&-1===direction||($scope.datepickerMode=self.modes[self.modes.indexOf($scope.datepickerMode)+direction]);
-`crud_controller.js`: The module of controllers for CRUD works.
-`auth_controller.js`: The module of controllers for authorization.
-`auth_service.js`: The module of service for authorization.
-`form_service.js`: The service that handles dynamically form generation, prepare input types, validation, redirection of related crud page and form submiting.
-`directives.js`: Carries app-wide directives.
-`interceptors.js`: Module for configure request and response objects of http functions.