}),c.socket.on("interval:save",function(){a.initList(b)}),c.socket.on("interval:remove",function(c){a.intervals.checked=_.without(a.intervals.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/intervals/"+a).success(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){f.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){f.show(d.instant(a.message),"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/intervals",{params:{id:a.intervals.checked}}).success(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(d.instant(a.message),"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.intervals.list",{url:"/list",templateUrl:"app/interval/list/list.html",controller:"IntervalListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("IntervalViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$location","WizardHandler","Modal","interval",function(a,b,c,d,e,f,g,h,i,j){a.$translate=d,a.$interval=j.interval,a.forms={subinterval:void 0,general:void 0},a.initSubInterval=function(){a.subinterval={IntervalId:e.id},a.splittedInterval={t_from:moment(new Date),t_to:moment(new Date),wd_from:"always",wd_to:"always",md_from:"always",md_to:"always",m_from:"always",m_to:"always",alwaysTime:!0}},a.next=function(){b.post("/api/intervals/validate/",a.subinterval).success(function(a){console.log(a),a.length?c.show(d.instant("MESSAGE_EXIST_SUBINTERVAL"),"danger"):h.wizard().next()}).error(function(a){c.show(d.instant(a.message),"danger")})},a.previous=function(){h.wizard().previous()},a.exitValidation=function(a){return a},a.joinInterval=function(a){console.log(a);var b,c,d,e;return b=a.t_from&&a.t_to&&!a.alwaysTime?moment(a.t_from).format("HH:mm")+"-"+moment(a.t_to).format("HH:mm"):"*",a.wd_from&&"always"!==a.wd_from?(c=a.wd_from,a.wd_to&&"always"!==a.wd_to&&(c+="-"+a.wd_to)):c="*",a.md_from&&"always"!==a.md_from?(d=a.md_from,a.md_to&&"always"!==a.md_to&&(d+="-"+a.md_to)):d="*",a.m_from&&"always"!==a.m_from?(e=a.m_from,a.m_to&&"always"!==a.m_to&&(e+="-"+a.m_to)):e="*",b+","+c+","+d+","+e},a.getInterval=function(){b.get("/api/intervals/"+e.id).success(function(b){a.interval=b,a.subIntervals=b.SubIntervals,f.unsyncUpdates("interval"),f.socket.on("interval:remove",function(b){b.id&&_.remove(a.subIntervals,function(a){return b.id===a.id})}),f.socket.on("interval:update",function(b){var c=_.find(a.subIntervals,{id:b.id});c.interval=b.interval}),f.socket.on("interval:save",function(b){if(b.IntervalId===e.id){var c=_.find(a.subIntervals,{id:b.id});c||a.subIntervals.push(b)}})}).error(function(a){console.error(a),g.path("/intervals/list")})},a.updateInterval=function(){var f=angular.copy(a.interval);b.put("/api/intervals/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.interval=f})},a.getSubInterval=function(){b.get("/api/intervals/"+e.appId).success(function(b){a.splittedInterval={t_from:moment(new Date),t_to:moment(new Date)},a.subinterval=b;var c,d=b.interval?b.interval.split(","):["*","*","*","*"];d.forEach(function(b,d){switch(d){case 0:"*"!==b?(c=b.split("-"),a.splittedInterval.t_from=moment(c[0],"HH:mm"),a.splittedInterval.t_to=moment(c[1],"HH:mm"),a.splittedInterval.alwaysTime=!1):(a.splittedInterval.t_from=moment(new Date),a.splittedInterval.t_to=moment(new Date),a.splittedInterval.alwaysTime=!0);break;case 1:"*"!==b?(c=b.split("-"),a.splittedInterval.wd_from=_.capitalize(c[0]),a.splittedInterval.wd_to=c[1]?_.capitalize(c[1]):"always"):(a.splittedInterval.wd_from="always",a.splittedInterval.wd_to="always");break;case 2:"*"!==b?(c=b.split("-"),a.splittedInterval.md_from=c[0],a.splittedInterval.md_to=c[1]?c[1]:"always"):(a.splittedInterval.md_from="always",a.splittedInterval.md_to="always");break;case 3:"*"!==b?(c=b.split("-"),a.splittedInterval.m_from=_.capitalize(c[0]),a.splittedInterval.m_to=c[1]?_.capitalize(c[1]):"always"):(a.splittedInterval.m_from="always",a.splittedInterval.m_to="always")}})}).error(function(a){console.error(a),g.path("/intervals/view/"+e.id+"/subintervals")})},a.createItem=function(){a.subinterval.interval=a.joinInterval(a.splittedInterval),b.post("/api/intervals/",a.subinterval).success(function(){g.path("/intervals/view/"+e.id+"/subintervals")}).error(function(a){c.show(d.instant(a.message),"danger")})},a.updateItem=function(){a.subinterval.interval=a.joinInterval(a.splittedInterval),b.put("/api/intervals/"+e.appId,a.subinterval).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success"),g.path("/intervals/view/"+e.id+"/subintervals")}).error(function(a){c.show(d.instant(a.message),"danger")})},a.deleteItem=i.confirm["delete"](function(a){b["delete"]("/api/intervals/"+a).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){console.log(a),c.show(d.instant(a.message),"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.intervals.view",{url:"/view/:id",templateUrl:"app/interval/view/view.html",controller:"IntervalViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.intervals.view.settings",{url:"/settings",templateUrl:"app/interval/view/view.settings.html"}).state("main.intervals.view.subintervals",{url:"/subintervals",templateUrl:"app/interval/view/view.subintervals.html",cache:!1}).state("main.intervals.view.subinterval",{url:"/subinterval",templateUrl:"app/interval/view/view.subinterval.html",authenticate:!0}).state("main.intervals.view.subintervals.settings",{url:"/settings/:appId",templateUrl:"app/interval/view/view.subintervalSettings.html",authenticate:!0,controller:"IntervalViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("IntervalWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","$translate",function(a,b,c,d,e,f){a.forms={interval:void 0},a.item={},a.next=function(){b.post("/api/intervals/validate/",a.item).success(function(a){console.log(a),a.length?e.show(f.instant("MESSAGE_EXIST_INTERVAL"),"danger"):c.wizard().next()}).error(function(a){e.show(f.instant(a.message),"danger")})},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/intervals/",a.item).success(function(a){d.path("/intervals/view/"+a.id+"/subintervals")}).error(function(a){e.show(f.instant(a.message),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.intervals.wizard",{url:"/wizard",templateUrl:"app/interval/wizard/wizard.html",controller:"IntervalWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("LoginCtrl",["$scope","Auth","$location","$window","$rootScope",function(a,b,c,d,e){a.userLogin={},a.userSignUp={},a.loginSubmitted=!1,a.signupSubmitted=!1,a.errorLogin=!1,a.errorSignup=!1,a.errorLog="",a.flagLogin1=!1,a.toogleLogin=function(){a.flagLogin1=!a.flagLogin1},e.bodyLayout="login",a.$on("$viewContentLoaded",function(){Metronic.init(),Layout.init()}),a.login=function(d){a.loginSubmitted=!0,d.$valid?b.login({name:a.userLogin.name,password:a.userLogin.password,remember:a.userLogin.remember}).then(function(){c.path("/dashboard/voice")})["catch"](function(b){a.errorLog=b.message,a.errorLogin=!0}):a.errorLogin=!0},a.signup=function(d){a.signupSubmitted=!0,d.$valid?b.createUser({email:a.userSignUp.email,fullname:a.userSignUp.fullname,name:a.userSignUp.name,password:a.userSignUp.password,role:a.userSignUp.role,online:!0}).then(function(){c.path("/")})["catch"](function(b){a.errorLog=b.message,a.errorSignup=!0}):a.errorSignup=!0},a.loginOauth=function(a){d.location.href="/auth/"+a}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("login",{url:"/login",templateUrl:"app/login/login.html",controller:"LoginCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/login.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.accounts",{url:"/accounts",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MailAccountListCtrl",["$scope","$http","socket","$translate","$rootScope","Modal","stResource","xAlert",function(a,b,c,d,e,f,g,h){a.conf={mailAccountsByPage:{name:"10",value:10}},a.mailAccountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.mailAccounts={checked:[]},a.check=function(b,c){c?a.mailAccounts.checked=angular.copy(_.pluck(a.displayedMailAccounts,"id")):a.mailAccounts.checked=[]},a.getMailAccounts=function(b){return _.map(a.displayedMailAccounts,function(a){var c={};return b.forEach(function(b){_.isObject(b)?_.forIn(b,function(b,d){c[b]=a[d][b]}):c[b]=a[b]}),c})},a.initList=function(b){c.unsyncUpdates("mail_server_in"),c.unsyncUpdates("mail_account"),b.url="/api/mail/accounts",g.getPage(b).then(function(c){a.displayedMailAccounts=c.rows,b.pagination.numberOfPages=c.total_pages}),c.socket.on("mail_server_in:save",function(){a.initList(b)}),c.socket.on("mail_account:save",function(){a.initList(b)}),c.socket.on("mail_account:remove",function(c){a.mailAccounts.checked=_.without(a.mailAccounts.checked,c.id),a.initList(b)})},a.deleteItem=f.confirm["delete"](function(a){b["delete"]("/api/mail/accounts/"+a).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){h.show(a.message,"danger")})}),a.deleteItems=f.confirm["delete"](function(){b["delete"]("/api/mail/accounts",{params:{id:a.mailAccounts.checked}}).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){h.show(d.instant(a.message),"danger")})}),a.restart=function(a){c.socket.emit("IMAP:"+a+":RESTART",{msg:"IMAP:"+a+":RESTART"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.accounts.list",{url:"/list",templateUrl:"app/mail/account/list/list.html",controller:"MailAccountListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.accounts.view.actions",{url:"/actions",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MailAccountViewActionListCtrl",["$scope","$http","$translate","$stateParams","socket","xAlert","Modal",function(a,b,c,d,e,f,g){a.initActons=function(){console.log(d),a.sortableOptions={stop:function(){console.log("stop",_.pluck(a.mailApplications,"id")),b.post("api/mail/accounts/"+d.accountId+"/applications",{applications:_.pluck(a.mailApplications,"id")}).success(function(b){angular.copy(b,a.mailApplications)}).error(function(a){console.error(a)})}},b.get("/api/mail/applications",{params:{MailAccountId:d.accountId}}).success(function(b){a.mailApplications=b,e.socket.on("mail_application:remove",function(b){_.remove(a.mailApplications,{id:b.id})})})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("api/mail/applications/"+a).success(function(){f.show(c.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){f.show(a.message,"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.accounts.view.actions.list",{url:"/list",templateUrl:"app/mail/account/view/action/list/list.html",controller:"MailAccountViewActionListCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailAccountViewActionViewCtrl",["$scope","$http","$stateParams","$translate","$location","xAlert","WizardHandler","socket","application","interval",function(a,b,c,d,e,f,g,h,i,j){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initAction=function(){a.$application=i.application,a.$stateParams=c,a.$interval=j.interval,a.forms={},a.apps=[{name:"Queue",value:"queue"},{name:"Agent",value:"agent"}],b.get("/api/mail/applications/"+c.actionId).success(function(b){if(a.application=b,a.application.alwaysTime=!1,a.application.IntervalId)a.application.intType="list";else switch(a.application.interval){case"*,*,*,*":a.application.intType="always";break;default:a.application.intType="custom"}var c=a.application.interval.split(",");"*"===c[0]?a.application.alwaysTime=!0:(a.application.t_from=moment(new Date),a.application.t_to=moment(new Date),a.application.t_from.hour(c[0].split("-")[0].split(":")[0]),a.application.t_from.minute(c[0].split("-")[0].split(":")[1]),a.application.t_to.hour(c[0].split("-")[1].split(":")[0]),a.application.t_to.minute(c[0].split("-")[1].split(":")[1])),"*"===c[1]?(a.application.wd_from="always",a.application.wd_to="always"):(a.application.wd_from=c[1].split("-")[0],a.application.wd_to=c[1].split("-")[1]),"*"===c[2]?(a.application.md_from="always",a.application.md_to="always"):(a.application.md_from=c[2].split("-")[0],a.application.md_to=c[2].split("-")[1]),"*"===c[3]?(a.application.m_from="always",a.application.m_to="always"):(a.application.m_from=c[3].split("-")[0],a.application.m_to=c[3].split("-")[1]),console.log(c),a.$watch("application.t_from",function(b){a.application.t_from_hm=moment(b).format("HH:mm")}),a.$watch("application.t_to",function(b){a.application.t_to_hm=moment(b).format("HH:mm")})}).error(function(a){console.error(a)})},a.getQueues=function(){b.get("/api/mail/queues",{params:{page:0,per_page:500}}).success(function(b){a.queues=b.rows}).error(function(a){console.error(a)})},a.getAgents=function(){b.get("/api/agents",{params:{page:0,per_page:500}}).success(function(b){a.agents=b.rows}).error(function(a){console.error(a)})},a.getIntervals=function(){b.get("/api/intervals",{params:{page:0,per_page:500}}).success(function(b){a.intervals=b.rows}).error(function(a){console.error(a)})},a.updateItem=function(){var e=["*","*","*","*"],g={app:a.application.app,timeout:a.application.timeout,MailAccountId:c.id};switch(a.application.app){case"agent":g.UserId=a.application.UserId;break;case"queue":g.MailQueueId=a.application.MailQueueId}switch(a.application.intType){case"always":g.interval=e.join(","),delete a.application.IntervalId;break;case"custom":a.application.alwaysTime||(e[0]=a.application.alwaysTime?"*":a.application.t_from_hm+"-"+a.application.t_to_hm),e[1]=a.application.wd_from&&a.application.wd_to?a.application.wd_from+"-"+a.application.wd_to:"*",e[2]=a.application.md_from&&a.application.md_to?a.application.md_from+"-"+a.application.md_to:"*",e[3]=a.application.m_from&&a.application.m_to?a.application.m_from+"-"+a.application.m_to:"*",g.interval=e.join(","),delete a.application.IntervalId;break;case"list":g.IntervalId=a.application.IntervalId}b.put("/api/mail/applications/"+c.actionId,g).success(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.accounts.view.actions.view",{url:"/view/:actionId",templateUrl:"app/mail/account/view/action/view/view.html",controller:"MailAccountViewActionViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailAccountViewActionWizardCtrl",["$scope","$http","$stateParams","$translate","$location","xAlert","WizardHandler","socket","application","interval",function(a,b,c,d,e,f,g,h,i,j){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initWizard=function(){console.log(c),a.apps=[{name:"Queue",value:"queue"},{name:"Agent",value:"agent"}],a.$application=i.application,a.$stateParams=c,a.$interval=j.interval,a.forms={},a.application={alwaysTime:!0},a.$watch("application.t_from",function(b){a.application.t_from_hm=moment(b).format("HH:mm")}),a.$watch("application.t_to",function(b){a.application.t_to_hm=moment(b).format("HH:mm")})},a.getQueues=function(){b.get("/api/mail/queues",{params:{page:0,per_page:500}}).success(function(b){a.queues=b.rows}).error(function(a){console.error(a)})},a.getAgents=function(){b.get("/api/agents",{params:{page:0,per_page:500}}).success(function(b){a.agents=b.rows}).error(function(a){console.error(a)})},a.getIntervals=function(){b.get("/api/intervals",{params:{page:0,per_page:500}}).success(function(b){a.intervals=b.rows}).error(function(a){console.error(a)})},a.createItem=function(){var d=["*","*","*","*"],f={app:a.application.app,timeout:a.application.timeout,MailAccountId:c.accountId};switch(a.application.app){case"agent":f.UserId=a.application.UserId;break;case"queue":f.MailQueueId=a.application.MailQueueId}switch(a.application.intType){case"always":f.interval=d.join(","),delete a.application.IntervalId;break;case"custom":a.application.alwaysTime||(d[0]=a.application.alwaysTime?"*":a.application.t_from_hm+"-"+a.application.t_to_hm),d[1]=a.application.wd_from&&a.application.wd_to?a.application.wd_from+"-"+a.application.wd_to:"*",d[2]=a.application.md_from&&a.application.md_to?a.application.md_from+"-"+a.application.md_to:"*",d[3]=a.application.m_from&&a.application.m_to?a.application.m_from+"-"+a.application.m_to:"*",f.interval=d.join(","),delete a.application.IntervalId;break;case"list":f.IntervalId=a.application.IntervalId}b.post("/api/mail/applications",f).success(function(){e.path("/mail/accounts/view/"+c.accountId+"/actions/list")}).error(function(a){console.error(a)})},a.formValidation=function(a){return a},a.next=function(){g.wizard().next()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.accounts.view.actions.wizard",{url:"/wizard",templateUrl:"app/mail/account/view/action/wizard/wizard.html",controller:"MailAccountViewActionWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailAccountViewCtrl",["$scope","$http","$stateParams","$translate","$location","xAlert",function(a,b,c,d,e,f){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initView=function(){b.get("/api/mail/accounts/"+c.accountId).success(function(b){a.account=b})},a.updateItemMailAccount=function(){b.put("/api/mail/accounts/"+c.accountId,{name:a.account.name,description:a.account.description,address:a.account.address}).success(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){f.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.updateItemMailServerIn=function(){b.put("/api/mail/servers/in/"+a.account.MailServerIn.id,a.account.MailServerIn).success(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){f.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.updateItemMailServerOut=function(){b.put("/api/mail/servers/out/"+a.account.MailServerOut.id,a.account.MailServerOut).success(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){f.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.accounts.view",{url:"/view/:accountId",templateUrl:"app/mail/account/view/view.html",controller:"MailAccountViewCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.mail.accounts.view.settings",{url:"/settings",templateUrl:"app/mail/account/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("MailAccountWizardCtrl",["$scope","$http","$location","$translate","WizardHandler","xAlert",function(a,b,c,d,e,f){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initWizard=function(){a.forms={},a.info={},a["in"]={"delete":!1,ssl:!0,protocol:"IMAP",port:993,mailbox:"INBOX",filter:"UNSEEN"},a.out={ssl:!0,port:465},a.$translate=d},a.goNext=function(){e.wizard().next()},a.formValidation=function(a){return a},a.createItem=function(){var e={name:a.info.name,address:a.info.address,description:a.info.description,incoming:a["in"],outgoing:a.out};b.post("api/mail/accounts",e).success(function(){c.path("/mail/accounts/list")}).error(function(a){console.log(a),f.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.accounts.wizard",{url:"/wizard",templateUrl:"app/mail/account/wizard/wizard.html",controller:"MailAccountWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.automations",{url:"/automations",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MailAutomationListCtrl",["$scope","$http","$translate","$rootScope","stResource","Modal","socket","xAlert",function(a,b,c,d,e,f,g,h){a.conf={mailAutomationsByPage:{name:"10",value:10}},a.mailAutomationsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.onText="On",a.offText="Off",a.isActive=!0,a.size="mini",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.mailAutomations={checked:[]},a.check=function(b,c){c?a.mailAutomations.checked=angular.copy(_.pluck(a.displayedMailAutomations,"id")):a.mailAutomations.checked=[]},a.getMailAutomations=function(b){return _.map(a.displayedMailAutomations,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){g.unsyncUpdates("mail_business_automation"),b.url="/api/mail/business/automations",e.getPage(b).then(function(c){a.displayedMailAutomations=c.mailAutomations,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.mailAutomationsByPage,a.displayedMailAutomations.length),d.updateTableConfig(a.conf.mailAutomationsByPage,a.displayedMailAutomations.length)}),g.socket.on("mail_business_automation:save",function(){a.initList(b)}),g.socket.on("mail_business_automation:remove",function(c){a.mailAutomations.checked=_.without(a.mailAutomations.checked,c.id),a.initList(b)})},a.deleteItem=f.confirm["delete"](function(a){b["delete"]("/api/mail/business/automations/"+a).success(function(){h.show(c.instant("MESSAGE_WELL_DONE"),"danger")}).error(function(){h.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.deleteItems=f.confirm["delete"](function(){b["delete"]("/api/mail/business/automations",{params:{id:a.mailAutomations.checked}}).success(function(){h.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){h.show(c.instant(a.message),"danger")})}),a.updateItem=function(a,d){b.put("api/mail/business/automations/"+a,{status:d}).success(function(){h.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.automations.list",{url:"/list",templateUrl:"app/mail/automation/list/list.html",controller:"MailAutomationListCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailAutomationViewCtrl",["$scope","$stateParams","$http","$translate","automation","socket","xAlert",function(a,b,c,d,e,f,g){a.initView=function(){a.forms={info:{}},a.automations=e.automations,c.get("/api/mail/business/automations/"+b.id).success(function(c){a.test=c,a.automation=c,f.syncUpdatesByAttributes("business_condition",{MailBusinessAutomationId:b.id},c.BusinessConditions)}).error(function(){})},a.updateAutomation=function(){c.put("/api/mail/business/automations/"+a.automation.id,{name:a.automation.name,description:a.automation.description}).success(function(a){g.show(d.instant("MESSAGE_WELL_DONE"),"success"),console.log(a)}).error(function(a){console.error(a)})},a.getOperatorsByCondition=function(a){var b=[],c=_.find(e.automations.conditions,{key:a});return c.operators&&c.operators.length&&(b=c.operators),b},a.getAttributesByCondition=function(a){var b=[],c=_.find(e.automations.conditions,{key:a});if(c.attributes&&c.attributes.length)switch(c.key){case"createdAt":b=_.map(c.attributes,function(a){return a.value=parseInt(a.value,10),a});break;default:b=c.attributes}return b},a.addNewCondition=function(b){c.post("/api/business/conditions",{type:b,condition:"status",MailBusinessAutomationId:a.automation.id}).success(function(b){a.automation.BusinessConditions.push(b)}).error(function(a){console.error(a)})},a.removeCondition=function(a){c["delete"]("/api/business/conditions/"+a).success(function(a){console.log(a)}).error(function(a){console.error(a)})},a.addNewAction=function(){c.post("/api/business/actions",{condition:"status",MailBusinessAutomationId:a.automation.id}).success(function(b){a.automation.BusinessActions.push(b)}).error(function(a){console.error(a)})},a.removeAction=function(b){c["delete"]("/api/business/actions/"+b).success(function(b){a.automation.BusinessActions=_.reject(a.automation.BusinessActions,{id:b.id})}).error(function(a){console.error(a)})},a.updateCondition=function(a,b,d){var e={};e[b]=d,c.put("/api/business/conditions/"+a,e).error(function(a){console.error(a)})},a.updateAction=function(a,b,d){var e={};e[b]=d,c.put("/api/business/actions/"+a,e).success(function(a){console.log(a)}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.automations.view",{url:"/view/:id",templateUrl:"app/mail/automation/view/view.html",controller:"MailAutomationViewCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.mail.automations.view.settings",{url:"/settings",templateUrl:"app/mail/automation/view/view.settings.html"}).state("main.mail.automations.view.routes",{url:"/routes",templateUrl:"app/mail/automation/view/view.routes.html"}).state("main.mail.automations.view.application",{url:"/application",templateUrl:"app/mail/automation/view/view.application.html"})}]),angular.module("xCallyShuttleApp").controller("MailAutomationWizardCtrl",["$scope","$http","$location","$translate","automation","WizardHandler","xAlert",function(a,b,c,d,e,f,g){a.forms={},a.automations={or:[],and:[],actions:[]},a.addNewChoice=function(b){var c=angular.copy(e.automations);a.automations[b].push(c)},a.removeChoice=function(b,c){a.automations[b].splice(c)},a.goNext=function(){return a.automations.actions.length?a.automations.or.length||a.automations.and.length?void f.wizard().next():(g.show(d.instant("MESSAGE_INSERT_AT_LEAST_ONE_CONDITION"),"danger"),!1):(g.show(d.instant("MESSAGE_INSERT_AT_LEAST_ONE_ACTION"),"danger"),!1)},a.createItem=function(){a.automations.or.forEach(function(a){a.condition=a.condition.key,a.type="or",delete a.conditions,delete a.actions}),a.automations.and.forEach(function(a){a.condition=a.condition.key,a.type="and",delete a.conditions,delete a.actions}),a.automations.actions.forEach(function(a){a.condition=a.condition.key,delete a.conditions,delete a.actions}),b.post("api/mail/business/automations",a.automations).success(function(){c.path("/mail/automations/list")}).error(function(){g.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG","danger"))})},a.formValidation=function(a){return a}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.automations.wizard",{url:"/wizard",templateUrl:"app/mail/automation/wizard/wizard.html",controller:"MailAutomationWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailComposeCtrl",["$scope","$http","$location","$cookieStore","$translate","xAlert","FileUploader","Auth",function(a,b,c,d,e,f,g,h){var i=a.uploader=new g({url:"api/mail/messages",withCredentials:!0,headers:{Authorization:"Bearer "+d.get("token")},queueLimit:1});i.onBeforeUploadItem=function(b){b.formData.push({mailAccountId:a.form.from.id,status:"SENDING",roomStatus:"OPEN",from:a.form.from.address,to:a.form.sto.join(";"),cc:a.form.scc.join(";"),subject:a.form.subject||null,html:a.form.html||null,text:a.form.text||null,attachment:!0,UserId:h.getCurrentUser().id})},i.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d),f.show(e.instant("MESSAGE_MAIL_MESSAGE_SEND_SUCCESS"),"success")},i.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d),f.show(e.instant("MESSAGE_MAIL_MESSAGE_SEND_FAILURE"),"danger")},i.onCompleteAll=function(){console.log("onCompleteAll"),c.path("/mail/inbox/incoming")},a.forms={},a.form={to:[],sto:[],cc:[],scc:[]},b.get("api/mail/accounts").success(function(b){a.mailAccounts=b.rows}),a.sendMail=function(){if(i.queue.length)console.log("file"),i.uploadAll();else{console.log("no file");var d={mailAccountId:a.form.from.id,status:"SENDING",roomStatus:"OPEN",from:a.form.from.address,to:a.form.sto.join(";"),cc:a.form.scc.join(";"),subject:a.form.subject||null,html:a.form.html||null,text:a.form.text||null,UserId:h.getCurrentUser().id};b.post("/api/mail/messages",d).success(function(){f.show(e.instant("MESSAGE_MAIL_MESSAGE_SEND_SUCCESS"),"success"),c.path("/mail/inbox/incoming")}).error(function(){f.show(e.instant("MESSAGE_MAIL_MESSAGE_SEND_FAILURE"),"danger")})}},a.cancel=function(){a.form.sto=[],a.form.scc=[],delete a.form.from,delete a.form.text,delete a.form.html}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.inbox.compose",{url:"/compose",templateUrl:"app/mail/inbox/room/room.html",controller:"MailComposeCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailInboxCtrl",["$scope","$http","$location",function(a,b,c){a.go=function(a){c.path(a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.inbox",{url:"/inbox",templateUrl:"app/mail/inbox/inbox.html",controller:"MailInboxCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/inbox.css","assets/css/todo.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("MailIncomingCtrl",["$scope","$http","$location","$translate","$timeout","socket","xAlert","Auth","stResource","Modal",function(a,b,c,d,e,f,g,h,i,j){a.$location=c,a.conf={mailRoomsByPage:{name:"10",value:10},labels:["fullname","name","email"],test:"OPEN"},a.mailRoomsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.mailRooms={checked:[]},a.check=function(b,c){c?a.mailRooms.checked=angular.copy(_.pluck(a.displayedMailRooms,"id")):a.mailRooms.checked=[]},a.initList=function(b){f.unsyncUpdates("mail_room"),b.search.predicateObject||(b.search.predicateObject={}),b.sort.predicate="createdAt",b.sort.reverse=!0,h.isAdmin()?(f.socket.on("mail_room:save",function(){e(function(){g.show(d.instant("MESSAGE_MAIL_NEW_INCOMING_MAIL"),"success"),a.initList(b)},2e3)}),f.socket.on("mail_room:remove",function(c){a.mailRooms.checked=_.without(a.mailRooms.mailRooms,c.id),a.initList(b)})):(f.socket.on("mail_room:save",function(c){c.UserId===h.getCurrentUser().id&&a.initList(b)}),f.socket.on("mail_room:remove",function(c){c.UserId===h.getCurrentUser().id&&(a.mailRooms.checked=_.without(a.mailRooms.checked,c.id),a.initList(b))}),b.search.predicateObject.UserId=h.getCurrentUser().id),b.url="/api/mail/rooms/",i.getPage(b).then(function(c){a.displayedMailRooms=c.mailRooms,b.pagination.numberOfPages=c.total_pages})},a.deleteItems=j.confirm["delete"](function(){b["delete"]("/api/mail/rooms",{params:{id:a.mailRooms.checked}}).success(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){
g.show(d.instant(a.message),"danger")})}),a.$on("$destroy",function(){f.unsyncUpdates("mail_room")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.inbox.incoming",{url:"/incoming",templateUrl:"app/mail/inbox/incoming/incoming.html",controller:"MailIncomingCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/inbox.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("MailRoomCtrl",["$scope","$http","$stateParams","$timeout","$cookieStore","$location","$translate","$log","xAlert","Auth","socket","FileUploader",function(a,b,c,d,e,f,g,h,i,j,k,l){var m=a.uploader=new l({url:"api/mail/messages",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+e.get("token")}});m.onErrorItem=function(){i.show(g.instant("MESSAGE_MAIL_MESSAGE_SEND_FAILURE"),"danger")},m.onCompleteAll=function(){f.path("/mail/inbox/incoming")},m.onBeforeUploadItem=function(b){var c={mailAccountId:a.form.from.id,status:"SENDING",roomStatus:"OPEN",from:a.form.from.address,to:a.form.sto.join(";"),cc:a.form.scc.join(";"),subject:a.form.subject||a.mailRoom.subject||null,html:a.form.html||null,text:a.form.text||null,MailRoomId:a.mailRoom.id},d=angular.copy(a.mailRoom.MailMessages);d=_.reject(d,function(a){return"RECEIVED"!==a.status}),c.inReplyTo=d?_.last(d).messageId:null,b.formData.push(c)},a.initRoomView=function(){a.Auth=j,a.forms={},a.form={to:[],sto:[],cc:[],scc:[]},b.get("/api/agents").success(function(b){a.agents=b.rows}),b.get("/api/mail/accounts").success(function(b){a.mailAccounts=b.rows}),b.get("/api/mail/rooms/"+c.id).success(function(c){a.mailRoom=c,k.syncUpdatesByAttributes("mail_message",{MailRoomId:a.mailRoom.id},a.mailRoom.MailMessages),"NEW"===a.mailRoom.status&&b.put("/api/mail/rooms/"+a.mailRoom.id,{status:"OPEN"})}).error(function(){f.path("/mail/inbox/incoming")})},a.sendMail=function(){var c=angular.copy(a.mailRoom.MailMessages);if(c=_.reject(c,function(a){return"RECEIVED"!==a.status}),c=_.sortBy(c,"id"),m.queue.length)m.uploadAll();else{if(!a.form.sto.length)return a.forms.compose.to.$valid=!1,void(a.forms.compose.to.$invalid=!0);a.forms.compose.to.$valid=!0,a.forms.compose.to.$invalid=!1;var d={mailAccountId:a.form.from.id,status:"SENDING",roomStatus:"OPEN",from:a.form.from.address,to:a.form.sto.join(";"),cc:a.form.scc.join(";"),subject:a.form.subject||a.mailRoom.subject||null,html:a.form.html||null,text:a.form.text||null,MailRoomId:a.mailRoom.id};c&&_.last(c)&&(d.inReplyTo=_.last(c).messageId),b.post("/api/mail/messages",d).success(function(){i.show(g.instant("MESSAGE_MAIL_MESSAGE_SEND_SUCCESS"),"success"),f.path("/mail/inbox/incoming")}).error(function(){i.show(g.instant("MESSAGE_MAIL_MESSAGE_SEND_FAILURE"),"danger")})}},a.cancel=function(){a.form.sto=[],a.form.scc=[],delete a.form.text},a.updateStatus=function(d){b.put("/api/mail/rooms/"+c.id,{status:d}).success(function(b){a.mailRoom.status=b.status,i.show(g.instant("MESSAGE_STATUS_UPDATE_SUCCESS"),"success"),f.path("/mail/inbox/incoming")}).error(function(){i.show(g.instant("MESSAGE_STATUS_UPDATE_FAILURE"),"danger")})},a.assignAgent=function(a){b.put("/api/mail/rooms/"+c.id,{UserId:a}).success(function(){i.show(g.instant("MESSAGE_MAIL_MESSAGE_ASSIGNEMNT_SUCCESS"),"success")}).error(function(){i.show(g.instant("MESSAGE_MAIL_MESSAGE_ASSIGNEMNT_FAILURE"),"danger")})}}]),angular.module("xCallyShuttleApp").factory("MailRoom",["$resource",function(a){return a("/api/mail/rooms/:id/:controller",{id:"@id"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.inbox.room",{url:"/room/:id",templateUrl:"app/mail/inbox/room/room.html",controller:"MailRoomCtrl",authenticate:!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail",{url:"/mail",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MailQueueListCtrl",["$scope","$http","$translate","$rootScope","socket","Modal","stResource","xAlert",function(a,b,c,d,e,f,g,h){a.$on("$destroy",function(){e.unsyncUpdates("mail_queue")}),a.conf={queuesByPage:{name:"10",value:10}},a.queuesByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.mailQueues={checked:[]},a.check=function(b,c){c?a.mailQueues.checked=angular.copy(_.pluck(a.displayedMailQueues,"id")):a.mailQueues.checked=[]},a.getMailQueues=function(b){return _.map(a.displayedMailQueues,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){e.unsyncUpdates("mail_queue"),b.url="/api/mail/queues/",g.getPage(b).then(function(c){a.displayedMailQueues=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(c.queuesByPage,a.displayedMailQueues.length),d.updateTableConfig(a.conf.queuesByPage,a.displayedMailQueues.length)}),e.socket.on("mail_queue:save",function(){a.initList(b)}),e.socket.on("mail_queue:remove",function(c){a.mailQueues.checked=_.without(a.mailQueues.checked,c.id),a.initList(b)})},a.deleteItem=f.confirm["delete"](function(a){b["delete"]("/api/mail/queues/"+a).success(function(){h.show(c.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){h.show(a.message,"danger")})}),a.deleteItems=f.confirm["delete"](function(){b["delete"]("/api/mail/queues/",{params:{id:a.mailQueues.checked}}).success(function(){h.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){h.show(c.instant(a.message),"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.queues.list",{url:"/list",templateUrl:"app/mail/queue/list/list.html",controller:"MailQueueListCtrl"})}]),angular.module("xCallyShuttleApp").factory("MailQueue",["$resource",function(a){return a("/api/mail/queues/:id/:controller",{id:"@id"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.queues",{url:"/queues",template:"<div ui-view></div>","abstract":!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/scripts/components-dropdowns.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("MailQueueViewCtrl",["$scope","$http","$translate","$stateParams","xAlert",function(a,b,c,d,e){var f=function(){return{select:function(c){b.post("/api/mail/queues/"+a.queue.id+"/agents",{agents:c}).success(function(){a.getTeams()}).error(function(a){console.error(a)})},deselect:function(c){b.put("/api/mail/queues/"+a.queue.id+"/agents",{agents:c}).success(function(){a.getTeams()}).error(function(a){console.error(a)})}}};a.getQueue=function(){b.get("/api/mail/queues/"+d.id).success(function(b){a.queue=b}).error(function(a){console.error(a)})},a.updateMailQueue=function(){var f=angular.copy(a.queue);b.put("/api/mail/queues/"+d.id,f).success(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(b){e.show(b.message,"success"),a.queue=f})},a.getTeams=function(){b.get("/api/teams").success(function(c){a.teams=c.rows,b.get("/api/mail/user_has_queues",{params:{MailQueueId:a.queue.id}}).success(function(b){ComponentsDropdowns.bindMailQueue(a.teams,_.pluck(b,"UserId"),f)})}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.queues.view",{url:"/view/:id",templateUrl:"app/mail/queue/view/view.html",controller:"MailQueueViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.mail.queues.view.settings",{url:"/settings",templateUrl:"app/mail/queue/view/view.settings.html"}).state("main.mail.queues.view.agents",{url:"/agents",templateUrl:"app/mail/queue/view/view.agents.html",cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/scripts/components-dropdowns.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("MailQueueWizardCtrl",["$scope","$http","$location","WizardHandler","xAlert",function(a,b,c,d,e){a.forms={},a.item={},a.next=function(){d.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/mail/queues",a.item).success(function(){c.path("/mail/queues/list")}).error(function(a){e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.queues.wizard",{url:"/wizard",templateUrl:"app/mail/queue/wizard/wizard.html",controller:"MailQueueWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.realtime",{url:"/realtime",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewAgentCtrl",["$scope","$http","socket","MailQueue","Agent",function(a,b,c,d,e){a.gridOptions={enableSorting:!1,enableFiltering:!0,columnDefs:[{name:"queueName",displayName:"Queue"},{name:"agentName",displayName:"Agent",cellClass:"text-center",cellTemplate:'<span data-ng-if="row.entity.agentName">{{row.entity.fullname}} [{{row.entity.agentName}}]</span>'},{name:"online",cellClass:"text-center",cellTemplate:'<span class="badge badge-empty" data-ng-if="row.entity.online != null" data-ng-class="row.entity.online ? \'badge-success\' : \'badge-danger\'"></span>'},{name:"lastLoginAt",cellClass:"text-center",cellTemplate:'<time data-ng-if="row.entity.agentName" is="relative-time" datetime="{{row.entity.lastLoginAt}}">April 1, 2014</time>'}],onRegisterApi:function(b){a.gridApi=b,a.gridApi.treeBase.on.rowExpanded(a,function(b){var c=_.findIndex(a.gridOptions.data,{$$hashKey:b.entity.$$hashKey});b.entity.Users&&b.entity.Users.forEach(function(b){_.find(a.gridOptions.data,{name:b.name})||a.gridOptions.data.splice(c+1,0,b)})})}},d.get(function(b){a.gridOptions.data=[],b.rows.forEach(function(b){b.$$treeLevel=0,b.queueName=b.name,a.gridOptions.data.push(b),b.Users&&b.Users.forEach(function(b){b.agentName=b.name,a.gridOptions.data.push(b)})}),c.socket.on("agent:save",function(b){var c=_.filter(a.gridOptions.data,{agentName:b.name});c.forEach(function(a){a.online=b.online,a.lastLoginAt=b.lastLoginAt})}),c.socket.on("mail_queue:save",function(b){b.$$treeLevel=0,b.queueName=b.name,a.gridOptions.data.push(b)}),c.socket.on("mail_queue:remove",function(b){_.remov(a.gridOptions.data,{queueName:b.name})}),c.socket.on("user_has_mail_queue:save",function(b){var c=_.findIndex(a.gridOptions.data,function(a){return a.queueName&&a.id===b.MailQueueId});e.get({id:b.UserId}).$promise.then(function(b){a.gridOptions.data.splice(c+1,0,{id:b.id,name:b.name,fullname:b.fullname,agentName:b.name,online:b.online,lastLoginAt:b.lastLoginAt})})["catch"](function(a){console.error(a)})}),c.socket.on("user_has_mail_queue:remove",function(b){for(var c=_.findIndex(a.gridOptions.data,function(a){return a.queueName&&a.id===b.MailQueueId}),d=c+1;d<a.gridOptions.data.length;d++)a.gridOptions.data[d].id==b.UserId&&a.gridOptions.data.splice(d,1)})},function(a){console.error(a)}),a.conf={agentsByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.agentsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.$on("$destroy",function(){c.unsyncUpdates("report_mail:save"),c.unsyncUpdates("report_mail:update")}),a.initAgents=function(){b.get("/api/report/mails").success(function(b){a.agents=b,c.socket.on("report_mail:save",function(b){var c=_.find(a.agents,{id:b.id});c||a.agents.unshift(b)}),c.socket.on("report_mail:update",function(b){var c=_.find(a.agents,{id:b.id}),d=a.agents.indexOf(c);c&&_.merge(a.agents[d],b)})}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.realtime.view.agents",{url:"/agents",template:"<div ui-view></div>","abstract":!0}).state("main.mail.realtime.view.agents.queues",{url:"/queues",controller:"MailRealtimeViewAgentCtrl",templateUrl:"app/mail/realtime/view/agent/agent.queues.html"}).state("main.mail.realtime.view.agents.timeline",{url:"/attempts",controller:"MailRealtimeViewAgentCtrl",templateUrl:"app/mail/realtime/view/agent/agent.timeline.html"})}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewSessionCtrl",["$scope","$http","socket",function(a,b,c){a.conf={sessionsByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.sessionsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.$on("$destroy",function(){c.unsyncUpdates("report_mail:save"),c.unsyncUpdates("report_mail:update")}),a.initMails=function(){b.get("/api/report/mail/sessions").success(function(b){a.sessions=b,c.socket.on("report_mail_session:save",function(b){var c=_.find(a.sessions,{id:b.id}),d=a.sessions.indexOf(c);c?_.merge(a.sessions[d],b):a.sessions.unshift(b)})}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewCtrl",["$scope",function(a){a.agents=[{name:"Queues",link:"main.mail.realtime.view.agents.queues"},{name:"Timeline",link:"main.mail.realtime.view.agents.timeline"}],a.sessions=[{name:"Sessions",link:"main.mail.realtime.view.sessions"}]}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.realtime.view",{url:"/view",templateUrl:"app/mail/realtime/view/view.html",controller:"MailRealtimeViewCtrl"}).state("main.mail.realtime.view.sessions",{url:"/sessions",controller:"MailRealtimeViewSessionCtrl",templateUrl:"app/mail/realtime/view/session/session.html"})}]),angular.module("xCallyShuttleApp").controller("MailStatisticsCtrl",["$scope","$http","$translate","socket",function(a,b,c,d){a.message="Hello",a.$translate=c,b.get("api/mail/rooms").success(function(b){a.mailRooms=b,d.syncUpdates("mail_room",a.mailRooms)}),b.get("api/mail/messages").success(function(b){a.mailMessages=b,d.syncUpdates("mail_message",a.mailMessages)})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.statistics",{url:"/statistics",templateUrl:"app/mail/statistics/statistics.html",controller:"MailStatisticsCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.mail.statistics.summary",{url:"/summary",templateUrl:"app/mail/statistics/statistics.summary.html",controller:"MailStatisticsCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile-old.css"]})}]}})}]),angular.module("xCallyShuttleApp").controller("MailTemplateListCtrl",["$scope","$http","$translate","$rootScope","socket","Modal","stResource","xAlert",function(a,b,c,d,e,f,g,h){a.$on("$destroy",function(){e.unsyncUpdates("mail_template")}),a.conf={templatesByPage:{name:"10",value:10}},a.templatesByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.mailTemplates={checked:[]},a.check=function(b,c){c?a.mailTemplates.checked=angular.copy(_.pluck(a.displayedMailTemplates,"id")):a.mailTemplates.checked=[]},a.getMailTemplates=function(b){return _.map(a.displayedMailTemplates,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){e.unsyncUpdates("mail_template"),b.url="/api/mail/templates/",g.getPage(b).then(function(c){a.displayedMailTemplates=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(c.templatesByPage,a.displayedMailTemplates.length),d.updateTableConfig(a.conf.templatesByPage,a.displayedMailTemplates.length)}),e.socket.on("mail_template:save",function(){a.initList(b)}),e.socket.on("mail_template:remove",function(c){a.mailTemplates.checked=_.without(a.mailTemplates.checked,c.id),a.initList(b)})},a.deleteItem=f.confirm["delete"](function(a){b["delete"]("/api/mail/templates/"+a).success(function(){h.show(c.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){h.show(a.message,"danger")})}),a.deleteItems=f.confirm["delete"](function(){b["delete"]("/api/mail/templates/",{params:{id:a.mailTemplates.checked}}).success(function(){h.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){h.show(c.instant(a.message),"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.templates.list",{url:"/list",templateUrl:"app/mail/template/list/list.html",controller:"MailTemplateListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.templates",{url:"/templates",template:"<div ui-view></div>","abstract":!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/scripts/components-dropdowns.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("MailTemplateViewCtrl",["$scope","$http","$translate","$stateParams","xAlert",function(a,b,c,d,e){a.items={},a.initItem=function(){b.get("/api/mail/accounts").success(function(c){a.mailAccounts=c.rows,b.get("/api/mail/templates/"+d.id).success(function(b){var c=_.find(a.mailAccounts,{address:b.from});a.item={name:b.name,description:b.description,subject:b.subject,from:{address:c.address,name:c.name,id:c.id},to:[],sto:b.to.split(";"),cc:[],scc:b.cc.split(";"),html:b.html,text:b.text,MailAccountId:b.MailAccountId}}).error(function(a){e.show(a.message,"danger")})})},a.updateItem=function(){var f={name:a.item.name,description:a.item.description,from:a.item.from.address,to:a.item.sto.join(";"),cc:a.item.scc.join(";"),subject:a.item.subject||null,html:a.item.html||null,text:a.item.text||null,MailAccountId:a.item.from.id};b.put("/api/mail/templates/"+d.id,f).success(function(a){console.log(a),e.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.templates.view",{url:"/view/:id",templateUrl:"app/mail/template/view/view.html",controller:"MailTemplateViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.mail.templates.view.settings",{url:"/settings",templateUrl:"app/mail/template/view/view.settings.html"}).state("main.mail.templates.view.agents",{url:"/agents",templateUrl:"app/mail/template/view/view.agents.html",cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/scripts/components-dropdowns.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("MailTemplateWizardCtrl",["$scope","$http","$location","WizardHandler","xAlert",function(a,b,c,d,e){a.form={to:[],sto:[],cc:[],scc:[]},b.get("api/mail/accounts").success(function(b){a.mailAccounts=b.rows}),a.forms={},a.next=function(){d.wizard().next()},a.exitValidation=function(a){return a},a.saveTemplate=function(){var d={name:a.form.name,description:a.form.description,from:a.form.from.address,to:a.form.sto.join(";"),cc:a.form.scc.join(";"),subject:a.form.subject||null,html:a.form.html||null,text:a.form.text||null,MailAccountId:a.form.from.id};b.post("/api/mail/templates",d).success(function(){c.path("/mail/templates/list")}).error(function(a){e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.templates.wizard",{url:"/wizard",templateUrl:"app/mail/template/wizard/wizard.html",controller:"MailTemplateWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailTimelineListCtrl",["$scope","$http","socket",function(a,b,c){function d(b){a.events>50&&a.events.pop(),a.events.unshift(b)}a.initList=function(){a.events=[],b.get("/api/events/channel/mail").success(function(a){a.forEach(d),c.socket.on("event:chat:save",d)}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.timeline.list",{url:"/list",templateUrl:"app/mail/timeline/list/list.html",controller:"MailTimelineListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/timeline.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.mail.timeline",{url:"/timeline",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChooseContactModalCtrl",["$scope","$uibModalInstance","params",function(a,b,c){a.forms={choose:void 0},a.contacts=c.contacts,a.item={},a.ok=function(){a.item.contactName=_.find(a.contacts,{id:a.item.contactId}).name,b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("MainCtrl",["$scope","$http","$rootScope","$cookies","$translate","$interval","socket","Auth","xAlert","$uibModal","$log",function(a,b,c,d,e,f,g,h,i,j,k){function l(b){a.workspaces.push({name:b.contactName,type:"contact",contactID:b.contactId,active:!0})}function m(b){a.workspaces.push({name:"New Contact",type:"newContact",active:!0,data:b})}a.awesomeThings=[],a.isLoggedIn=h.isLoggedIn,a.isAdmin=h.isAdmin,a.getCurrentUser=h.getCurrentUser,a.workspaces=[],a.mainTab={active:!0},a.closeTab=function(b){a.workspaces.splice(b,1)},a.createContact=function(c,d){d.tags=d.tags?d.tags.join(","):void 0,d.id?b.put("/api/contactmanager/join/"+d.id,d).success(function(b){a.workspaces.splice(c,1),l(b),i.show(e.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){i.show(a.message,"danger")}):b.post("/api/contactmanager",d).success(function(b){a.workspaces.splice(c,1),l({contactName:b.fullname,contactId:b.id}),i.show(e.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){i.show(a.message,"danger")})},a.chooseContact=function(a){var b=j.open({animation:!0,templateUrl:"app/main/chooseContact.modal.html",controller:"ChooseContactModalCtrl",resolve:{params:function(){return{contacts:JSON.parse(a.contacts)}}}});b.result.then(function(a){l(a)},function(){k.info("Modal dismissed at: "+new Date)})},a.updateContact=function(a,c){c.tags=c.tags?c.tags.join(","):void 0,c.CompanyId||(c.CompanyId=null),b.put("/api/contactmanager/"+c.id,c).success(function(){i.show(e.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){i.show(e.instant(a.message)+"!","danger")})},g.socket.on("report_integration:contactmanager",function(b){switch(b.event){case"openContactTab":a.chooseContact(b);break;case"newContactTab":m(b)}}),a.$on("$viewContentLoaded",function(){Metronic.init()}),c.language=e.use(),a.changeLanguage=function(a){e.use(a).then(function(a){c.language=a})["catch"](function(a){console.error(a)})},a.$on("$destroy",function(){})}]),angular.module("xCallyShuttleApp").directive("ngSpinnerBar",["$rootScope",function(a){return{link:function(b,c){c.addClass("hide"),a.$on("$stateChangeStart",function(){"spinner-page"===c[0].id&&c.removeClass("hide")}),a.$on("$stateChangeSuccess",function(){"spinner-page"===c[0].id&&(c.addClass("hide"),$("body").removeClass("page-on-load"),Layout.setSidebarMenuActiveLink("match"),setTimeout(function(){Metronic.scrollTop()},1e3))}),a.$on("$spinnerStart",function(){"spinner-request"===c[0].id&&c.removeClass("hide")}),a.$on("$spinnerStop",function(){"spinner-request"===c[0].id&&c.addClass("hide")}),a.$on("$stateNotFound",function(){"spinner-page"===c[0].id&&c.addClass("hide")}),a.$on("$stateChangeError",function(){"spinner-page"===c[0].id&&c.addClass("hide")})}}}]).directive("a",function(){return{restrict:"E",link:function(a,b,c){(c.ngClick||""===c.href||"#"===c.href)&&b.on("click",function(a){a.preventDefault()})}}}).directive("nxEqual",function(){return{require:"ngModel",link:function(a,b,c,d){return c.nxEqual?(a.$watch(c.nxEqual,function(a){d.$setValidity("nxEqual",a===d.$viewValue)}),void d.$parsers.push(function(b){var e=b===a.$eval(c.nxEqual);return d.$setValidity("nxEqual",e),e?b:void 0})):void console.error("nxEqual expects a model as an argument!")}}}).directive("ngEnter",function(){return function(a,b,c){b.bind("keydown keypress",function(b){13===b.which&&(a.$apply(function(){a.$eval(c.ngEnter)}),b.preventDefault())})}}).directive("dropdownMenuHover",function(){return{link:function(a,b){b.dropdownHover()}}}).directive("uiSelectRequired",function(){return{require:"ngModel",link:function(a,b,c,d){d.$validators.uiSelectRequired=function(a){return a&&a.length}}}}).directive("rpattern",function(){return{restrict:"A",require:"ngModel",link:function(a,b,c,d){function e(a,b){return null==b||""===b||!h||a.test(b)?(d.$setValidity("pattern",!0),b):void d.$setValidity("pattern",!1)}var f,g=c.rpattern,h=!0;g&&(g.match(/^\/(.*)\/$/)?(g=new RegExp(g.substr(1,g.length-2)),f=function(a){return e(g,a)}):f=function(b){var c=a.$eval(g);if(!c||!c.test)throw new Error("Expected "+g+" to be a RegExp but was "+c);return e(c,b)}),d.$formatters.push(f),d.$parsers.push(f),c.$observe("required",function(a){h=a,f(d.$viewValue)})}}}).directive("queryBuilder",["$compile",function(a){return{restrict:"E",scope:{group:"=",fields:"=",operators:"=",properties:"="},templateUrl:"app/main/template.queryBuilderView.html",compile:function(b,c){var d,e;return d=b.contents().remove(),function(b,c,f){b.booleans=[{name:"AND"},{name:"OR"}],b.addCondition=function(a){"CONDITION"==a?b.group.rules.push({operator:"=",field:"",data:""}):b.group.rules.push({field:"",data:""})},b.removeCondition=function(a){b.group.rules.splice(a,1)},b.addGroup=function(a){b.group.rules.push({group:{"boolean":"AND",rules:[],type:a,main:!1}})},b.removeGroup=function(){b.$parent.group.rules.splice(b.$parent.$index,1)},e||(e=a(d)),c.append(e(b,function(a){return a}))}}}}]).directive("newContact",["$compile","xAlert","$http","socket",function(a,b,c,d){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template.newContactTab.html",compile:function(a,e){return function(a,e,f){a.forms={general:{}},a.item={Phones:[],Emails:[]},a.joinPrompt=!1,a.checkboxes={},a.workspace.data&&(delete a.workspace.data.attachment,delete a.workspace.data.html,delete a.workspace.data.text,a.item.history=a.workspace.data,a.item.fullname=a.workspace.data.calleridname?a.workspace.data.calleridname:a.workspace.data.messageId?a.workspace.data.messageId:a.workspace.data.uniqueid?a.workspace.data.uniqueid:"",a.workspace.data.calleridnum&&a.item.Phones.push({phone:a.workspace.data.calleridnum}),a.workspace.data.from&&a.item.Emails.push({email:a.workspace.data.from})),a.getTags=function(){c.get("/api/tags").success(function(b){a.tags=_.pluck(b.rows,"name")}).error(function(a){console.error(a),b.show(a.message,"danger")})},a.getCompanies=function(){c.get("/api/companies").success(function(b){a.companies=b.rows,d.syncUpdates("company",a.companies)}).error(function(a){console.error(a),b.show(a.message,"danger")})},a.addField=function(b){a.item[b].push({}),a.joinPrompt=!1},a.removeField=function(b,c){a.item[b].splice(c,1),a.joinPrompt=!1},a.getTags(),a.getCompanies()}}}}]).directive("contact",["$compile","xAlert","$http","socket",function(a,b,c,d){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template.contactTab.html",compile:function(a,e){return function(a,e,f){a.forms={general:{}},a.detail={tab:"main"},a.addField=function(b){a.contact[b].push({})},a.removeField=function(b,c){a.contact[b].splice(c,1)},a.getContact=function(d){console.log("get contact in tab"),c.get("/api/contactmanager/"+d).success(function(b){b.tags=b.tags?b.tags.split(","):[],a.contact=b}).error(function(a){console.error(a),b.show(a.message,"danger")})},a.getTags=function(){c.get("/api/tags").success(function(b){a.tags=_.pluck(b.rows,"name")}).error(function(a){console.error(a),b.show(a.message,"danger")})},a.getCompanies=function(){c.get("/api/companies").success(function(b){a.companies=b.rows,d.syncUpdates("company",a.companies)}).error(function(a){console.error(a),b.show(a.message,"danger")})},a.getTags(),a.getCompanies(),a.getContact(a.workspace.contactID)}}}}]),angular.module("xCallyShuttleApp").filter("capitalize",function(){return function(a){return a?a.replace(/([^\W_]+[^\s-]*) */g,function(a){return a.charAt(0).toUpperCase()+a.substr(1).toLowerCase()}):""}}),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main",{"abstract":!0,templateUrl:"app/main/main.html",controller:"MainCtrl",resolve:{authorization:["$q","Auth","$state","$timeout","$location",function(a,b,c,d,e){return b.getToken()?a.when():(d(function(){e.path("/login")}),a.reject())}],deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("xAlert",["$translate","Notification",function(a,b){return{show:function(c,d){switch(d){case"success":b.success({message:c,title:'<i class="glyphicon glyphicon-ok"></i> <strong>'+a.instant("MESSAGE_SUCCESS")+"!</strong>",delay:5e3});break;case"info":b.info({message:c,title:'<i class="glyphicon glyphicon-info-sign"></i> <strong>'+a.instant("MESSAGE_INFO")+"!</strong>",delay:5e3});break;case"danger":b.error({message:c,title:'<i class="glyphicon glyphicon-warning-sign"></i> <strong>'+a.instant("MESSAGE_ERROR")+"!</strong>",delay:1e4});break;default:b.info(c)}}}}]).factory("stResource",["$q","$filter","$timeout","$rootScope","$http","$translate","xAlert",function(a,b,c,d,e,f,g){return{getPage:function(b){var c={page:Math.ceil(b.pagination.start/b.pagination.number),per_page:b.pagination.number};b.sort.predicate&&(c.sort_by=b.sort.predicate,c.sort_order=b.sort.reverse?"DESC":"ASC"),_.forIn(b.search.predicateObject,function(a,b){c[b]=a}),d.$broadcast("$spinnerStart"),e.get(b.url,{params:c}).success(function(a){h.resolve(a),d.$broadcast("$spinnerStop")}).error(function(a){g.show(f.instant(a.message),"danger"),d.$broadcast("$spinnerStop")});var h=a.defer();return h.promise}}}]),angular.module("xCallyShuttleApp").controller("MarketCtrl",["$scope",function(a){a.message="Hello"}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.market",{url:"/market",templateUrl:"app/market/market.html",controller:"MarketCtrl"})}]),angular.module("xCallyShuttleApp").controller("MotionbarCtrl",["$scope","$stateParams","$cookieStore","settings","Auth",function(a,b,c,d,e){e.loginWithToken(b.token,b.userId,b.name),a.getCurrentUser=e.getCurrentUser,d.layout.pageQuickSidebarOpened=!0}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("motionbar",{url:"/motionbar",template:"<div ui-view></div>","abstract":!0}).state("motionbar.chat",{url:"/chat?token&userId&name",templateUrl:"app/motionbar/motionbar.chat.html",controller:"MotionbarCtrl"})}]),angular.module("xCallyShuttleApp").controller("SalesforceListCtrl",["$scope","$http","$rootScope","xAlert","$translate","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={accountsByPage:{name:"10",value:10}},a.accountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.accounts={checked:[]},a.check=function(b,c){c?a.accounts.checked=angular.copy(_.pluck(a.displayedSalesforceAccounts,"id")):a.accounts.checked=[];
},a.getAccounts=function(b){return _.map(a.displayedSalesforceAccounts,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("salesforce_account"),b.url="/api/salesforce/accounts",h.getPage(b).then(function(d){a.displayedSalesforceAccounts=d.rows,b.pagination.numberOfPages=d.total_pages,c.updateTableConfig(a.accountsByPage,a.displayedSalesforceAccounts.length),c.updateTableConfig(a.conf.accountsByPage,a.displayedSalesforceAccounts.length)}),f.socket.on("salesforce_account:save",function(){a.initList(b)}),f.socket.on("salesforce_account:remove",function(c){a.accounts.checked=_.without(a.accounts.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/salesforce/accounts/"+a).success(function(){d.show(e.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/salesforce/accounts",{params:{id:a.accounts.checked}}).success(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.checkAccount=function(a){b.get("/api/salesforce/accounts/"+a+"/check").then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.list",{url:"/list",templateUrl:"app/salesforce/list/list.html",controller:"SalesforceListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce",{url:"/salesforce",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SalesforceViewCtrl",["$scope","$http","$stateParams","$translate","$location","WizardHandler","socket","xAlert","Modal","$filter",function(a,b,c,d,e,f,g,h,i,j){a.$stateParams=c,a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:500,scrollInertia:0},a.initConfiguration=function(){a.formsConfiguration={},a.configuration={}},a.goNext=function(){f.wizard().next()},a.formValidation=function(a){return a},a.$on("$destroy",function(){g.unsyncUpdates("salesforce_configuration"),g.unsyncUpdates("salesforce_field")}),a.initView=function(){b.get("/api/salesforce/accounts/"+c.id).success(function(b){a.account=b}).error(function(a){h.show(a.message,"danger")})},a.updateItem=function(){b.put("/api/salesforce/accounts/"+c.id,a.account).success(function(){h.show(d.instant("MESSAGE_WELL_DONE")+".","success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getConfigurations=function(){b.get("/api/salesforce/configurations",{params:{SalesforceAccountId:c.id}}).success(function(b){a.configurations=b,g.socket.on("salesforce_configuration:remove",function(b){_.remove(a.configurations,{id:b.id})})}).error(function(a){h.show(a.message,"danger")})},a.deleteConfiguration=i.confirm["delete"](function(a){b["delete"]("api/salesforce/configurations/"+a).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.createConfiguration=function(){a.configuration.DeskAccountId=c.id,b.post("api/salesforce/configurations",a.configuration).success(function(a){e.path("salesforce/view/"+c.id+"/configurations/settings/"+a.id)}).error(function(){h.show("Something went wrong!","danger")})},a.fieldType=["string","variable"],a.descFieldType=["string","key_value"],a.getFields=function(){b.get("/api/salesforce/accounts/"+c.id+"/fields").success(function(b){a.accountFields=_.sortByOrder(j("salesforce")(b),"name","asc")}).error(function(a){h.show(a.message,"danger")})},a.getConfiguration=function(){b.get("/api/salesforce/configurations/"+c.configurationId).success(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,g.socket.on("salesforce_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})}).error(function(a){h.show(a.message,"danger")})},a.getVariables=function(){b.get("/api/variables").success(function(b){a.variables=b.rows}).error(function(a){h.show(a.message,"danger")})},a.removeItem=function(a){b["delete"]("api/salesforce/fields/"+a.id).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.addItemSubject=function(){var d={type:"string",content:""};b.post("/api/salesforce/configurations/"+c.configurationId+"/subject",d).success(function(b){a.subjectConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemDescription=function(){var d={type:"string",content:""};b.post("/api/salesforce/configurations/"+c.configurationId+"/description",d).success(function(b){a.descriptionConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemField=function(){var d={content:""};b.post("/api/salesforce/configurations/"+c.configurationId+"/field",d).success(function(b){a.fieldConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.updateField=function(a){b.put("/api/salesforce/fields/"+a.id,a).success(function(){}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.changeType=function(b){"variable"===b.type?b.content="":"string"===b.type&&(b.VariableId=null),a.updateField(b)},a.changeDescType=function(b){"key_value"===b.type?(b.content="","string"===b.keyType?b.VariableId=null:"variable"===b.keyType&&(b.keyContent="")):"string"===b.type&&(b.VariableId=null,b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){b.content="",a.updateField(b)},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"name",b);if(c)switch(c.type){case"picklist":return c.picklistValues;default:return}}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.view",{url:"/view/:id",templateUrl:"app/salesforce/view/view.html",controller:"SalesforceViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.salesforce.view.account",{url:"/account",templateUrl:"app/salesforce/view/view.account.html"}).state("main.salesforce.view.configurations",{url:"/configurations",templateUrl:"app/salesforce/view/view.configurations.html"}).state("main.salesforce.view.configurations.settings",{url:"/settings/:configurationId",templateUrl:"app/salesforce/view/view.configurationSettings.html",controller:"SalesforceViewCtrl"}).state("main.salesforce.view.configuration",{url:"/configuration",templateUrl:"app/salesforce/view/view.configuration.html"})}]),angular.module("xCallyShuttleApp").controller("SalesforceWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={}},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){console.log(a.item),b.post("api/salesforce/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/salesforce/list")}).error(function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.wizard",{url:"/wizard",templateUrl:"app/salesforce/wizard/wizard.html",controller:"SalesforceWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("SoundListCtrl",["$scope","$http","socket","Modal","$q","FileUploader","$translate","xAlert","$cookieStore","$sce",function(a,b,c,d,e,f,g,h,i,j){a.isCollapsed=!0,a.audioSources={},a["delete"]=d.confirm["delete"](function(a){b["delete"]("/api/uploads/"+a).success(function(a){}).error(function(a){console.log(a)})}),a.getAudioSrc=function(a){return"/api/uploads/"+a},a.updateAudio=function(a,c){var d=e.defer();return b.put("/api/uploads/"+a,c).success(function(a){d.resolve()}).error(function(a){console.log(a.message),d.reject(a.message)}),d.promise},a.$on("$destroy",function(){c.unsyncUpdates("upload")}),a.initList=function(){b.get("/api/uploads").success(function(b){a.sounds=b,a.sounds.forEach(function(a){k(a)}),c.syncUpdates("upload",a.sounds)}).error(function(a){})};var k=function(c){b.get("/api/uploads/stream/"+c.id).success(function(b){a.audioSources[c.id]=b}).error(function(a){console.error(a)})};a.getSecureSrc=function(a){return j.trustAsResourceUrl("data:audio/ogg;base64,"+a)},a.getSecureDownloadSrc=function(a){return j.trustAsResourceUrl("data:application/octet-stream;charset=utf-16le;base64,"+a)};var l=a.uploader=new f({url:"/api/uploads",withCredentials:!0,headers:{Authorization:"Bearer "+i.get("token")}});l.filters.push({name:"customFilter",fn:function(a,b){return this.queue.length<10}}),l.onWhenAddingFileFailed=function(a,b,c){console.info("onWhenAddingFileFailed",a,b,c)},l.onAfterAddingFile=function(a){console.info("onAfterAddingFile",a)},l.onAfterAddingAll=function(a){console.info("onAfterAddingAll",a)},l.onBeforeUploadItem=function(a){console.info("onBeforeUploadItem",a)},l.onProgressItem=function(a,b){console.info("onProgressItem",a,b),a.isUploading=!0},l.onProgressAll=function(a){console.info("onProgressAll",a)},l.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d),a.isUploading=!1},l.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d),a.responseMessage=b,a.isUploading=!1},l.onCancelItem=function(a,b,c,d){console.info("onCancelItem",a,b,c,d),a.isUploading=!1},l.onCompleteItem=function(a,b,c,d){console.info("onCompleteItem",a,b,c,d),a.isUploading=!1},l.onCompleteAll=function(){console.info("onCompleteAll")},console.info("uploader",l)}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sounds.list",{url:"/list",templateUrl:"app/sound/list/list.html",controller:"SoundListCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js"]})}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sounds",{url:"/sounds",templateUrl:"app/sound/sound.html","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SquareOdbcListCtrl",["$scope","$http","socket","$rootScope","$translate","xAlert","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={odbcsByPage:{name:"10",value:10}},a.odbcsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.Odbcs={checked:[]},a.check=function(b,c){c?a.Odbcs.checked=angular.copy(_.pluck(a.displayedOdbcs,"id")):a.Odbcs.checked=[]},a.getOdbcs=function(b){return _.map(a.displayedOdbcs,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){c.unsyncUpdates("square_odbc"),b.url="/api/square/odbc",h.getPage(b).then(function(c){a.displayedOdbcs=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.odbcsByPage,a.displayedOdbcs.length),d.updateTableConfig(a.conf.odbcsByPage,a.displayedOdbcs.length)}),c.socket.on("square_odbc:save",function(){a.initList(b)}),c.socket.on("square_odbc:remove",function(c){a.Odbcs.checked=_.without(a.Odbcs.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/square/odbc/"+a).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/square/odbc",{params:{id:a.Odbcs.checked}}).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbcs.list",{url:"/list",templateUrl:"app/square/odbc/list/list.html",controller:"SquareOdbcListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbcs",{url:"/odbcs",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SquareOdbcViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.getOdbc=function(){b.get("/api/square/odbc/"+e.id).success(function(b){delete b.pwd,a.odbc=b}).error(function(a){console.error(a),f.path("/square/odbcs/list")})},a.updateOdbc=function(){var f=angular.copy(a.odbc);b.put("/api/square/odbc/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.odbc=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbcs.view",{url:"/view/:id",templateUrl:"app/square/odbc/view/view.html",controller:"SquareOdbcViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.square.odbcs.view.settings",{url:"/settings",templateUrl:"app/square/odbc/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("SquareOdbcWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","$translate",function(a,b,c,d,e,f){a.forms={odbc:void 0},a.item={},a.next=function(){b.post("/api/square/odbc/validate/",a.item).success(function(a){a.length?e.show(f.instant("MESSAGE_EXIST_ODBC"),"danger"):c.wizard().next()}).error(function(a){e.show(f.instant(a.message),"danger")})},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/square/odbc/",a.item).success(function(){d.path("/square/odbcs/list")}).error(function(a){e.show(f.instant(a.message),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbcs.wizard",{url:"/wizard",templateUrl:"app/square/odbc/wizard/wizard.html",controller:"SquareOdbcWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("SquareProjectListCtrl",["$scope","$http","socket","$rootScope","$translate","xAlert","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={projectsByPage:{name:"10",value:10}},a.projectsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.Projects={checked:[]},a.check=function(b,c){c?a.Projects.checked=angular.copy(_.pluck(a.displayedProjects,"id")):a.Projects.checked=[]},a.getProjects=function(b){return _.map(a.displayedProjects,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){c.unsyncUpdates("square_project"),b.url="/api/square/projects",h.getPage(b).then(function(c){a.displayedProjects=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.projectsByPage,a.displayedProjects.length),d.updateTableConfig(a.conf.projectsByPage,a.displayedProjects.length)}),c.socket.on("square_project:save",function(){a.initList(b)}),c.socket.on("square_project:remove",function(c){a.Projects.checked=_.without(a.Projects.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/square/projects/"+a).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/square/projects",{params:{id:a.Projects.checked}}).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects.list",{url:"/list",templateUrl:"app/square/project/list/list.html",controller:"SquareProjectListCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects",{url:"/projects",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SquareProjectViewCtrl",["$scope","$http","$stateParams","socket","Auth","Modal","xAlert","$translate","$rootScope",function(a,b,c,d,e,f,g,h,i){a.squareProject={},a.getProject=function(){b.get("/api/square/projects/"+c.id).success(function(b){a.squareProject=b,angular.element(document).ready(function(){window.onerror=function(a,b,c){try{if(null!=a&&-1!=a.indexOf("Script error."));else{var d=new Image;d.src="assets/plugins/mxgraph/images/1x1.png?msg="+encodeURIComponent(a)+"&url="+encodeURIComponent(b)+"&lnum="+encodeURIComponent(c)}}catch(e){}},b.token=e.getToken();var a=new EditorUi(new Editor);a.openString(b.preproduction,b.name,b),a.editor.graphChangeListener=function(a,b){var c=b.properties.rtChange||!1;c||(this.modified=!0)}}),d.syncUpdates("square_project",[b],function(a,c,d){c.id===b.id})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects.view",{url:"/view/:id",templateUrl:"app/square/project/view/view.html",controller:"SquareProjectViewCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",serie:!0,cache:!1,files:["assets/plugins/mxgraph/css/common.css","assets/plugins/mxgraph/css/explorer.css","assets/plugins/mxgraph/styles/grapheditor.css","assets/plugins/mxgraph/styles/custom.css","assets/plugins/mxgraph/js/custom.js","assets/plugins/mxgraph/js/mxClient.js","assets/plugins/mxgraph/js/Editor.js","assets/plugins/mxgraph/js/Graph.js","assets/plugins/mxgraph/js/EditorUi.js","assets/plugins/mxgraph/js/Actions.js","assets/plugins/mxgraph/js/Menus.js","assets/plugins/mxgraph/js/Sidebar.js","assets/plugins/mxgraph/js/Toolbar.js","assets/plugins/mxgraph/js/Dialogs.js"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("SquareProjectWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","$translate",function(a,b,c,d,e,f){a.forms={project:void 0},a.item={},a.next=function(){b.post("/api/square/projects/validate/",a.item).success(function(a){a.length?e.show(f.instant("MESSAGE_EXIST_PROJECT"),"danger"):c.wizard().next()}).error(function(a){e.show(f.instant(a.message),"danger")})},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/square/projects/",a.item).success(function(){d.path("/square/projects/list")}).error(function(a){e.show(f.instant(a.message),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects.wizard",{url:"/wizard",templateUrl:"app/square/project/wizard/wizard.html",controller:"SquareProjectWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square",{url:"/square",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TagListCreateModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.ok=function(){a.item.model=JSON.stringify({title:a.item.name}),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("TagListCtrl",["$scope","$http","socket","$rootScope","$translate","xAlert","Modal","stResource","$uibModal","$log",function(a,b,c,d,e,f,g,h,i,j){a.conf={tagsByPage:{name:"10",value:10}},a.tagsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.Tags={checked:[]},a.check=function(b,c){c?a.Tags.checked=angular.copy(_.pluck(a.displayedTags,"id")):a.Tags.checked=[]},a.getTags=function(b){return _.map(a.displayedTags,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){c.unsyncUpdates("tag"),b.url="/api/tags",h.getPage(b).then(function(c){a.displayedTags=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.tagsByPage,a.displayedTags.length),d.updateTableConfig(a.conf.tagsByPage,a.displayedTags.length)}),c.socket.on("tag:save",function(){console.log("save"),a.initList(b)}),c.socket.on("tag:remove",function(c){a.Tags.checked=_.without(a.Tags.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/tags/"+a).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/tags",{params:{id:a.Tags.checked}}).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.create=function(){var a=i.open({animation:!0,templateUrl:"app/tag/list/create.modal.html",controller:"TagListCreateModalCtrl"});a.result.then(function(a){b.post("/api/tags",a).then(function(a){f.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.data.message,"danger")})},function(){j.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tags.list",{url:"/list",templateUrl:"app/tag/list/list.html",controller:"TagListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tags",{url:"/tags",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TagViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.getTag=function(){b.get("/api/tags/"+e.id).success(function(b){a.tag=b}).error(function(a){console.error(a),f.path("/tags/list")})},a.updateTag=function(){var f=angular.copy(a.tag);b.put("/api/tags/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.tag=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tags.view",{url:"/view/:id",templateUrl:"app/tag/view/view.html",controller:"TagViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tags.view.settings",{url:"/settings",templateUrl:"app/tag/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TeamListCtrl",["$scope","$http","$translate","$rootScope","xAlert","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={teamsByPage:{name:"10",value:10}},a.teamsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.teams={checked:[]},a.check=function(b,c){c?a.teams.checked=angular.copy(_.pluck(a.displayedTeams,"id")):a.teams.checked=[]},a.getTeams=function(b){return _.map(a.displayedTeams,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("team"),b.url="/api/teams/",h.getPage(b).then(function(c){a.displayedTeams=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.teamsByPage,a.displayedTeams.length),d.updateTableConfig(a.conf.teamsByPage,a.displayedTeams.length)}),f.socket.on("team:save",function(){a.initList(b)}),f.socket.on("team:remove",function(c){a.teams.checked=_.without(a.teams.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("api/teams/"+a).success(function(){e.show(c.instant("MESSAGE_TEAM_DELETE_SUCCESS"),"success")}).error(function(){e.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/teams",{params:{id:a.teams.checked}}).success(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){e.show(c.instant(a.message),"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.teams.list",{url:"/list",templateUrl:"app/team/list/list.html",controller:"TeamListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.teams",{url:"/teams",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TeamViewCtrl",["$scope","$http","$stateParams","$translate","xAlert",function(a,b,c,d,e){a.message="Hello";var f=function(){return{select:function(c){b.post("/api/teams/"+a.team.id+"/agents",{agents:c}).error(function(a){console.error(a)})},deselect:function(c){b.put("/api/teams/"+a.team.id+"/agents",{agents:c}).error(function(a){console.error(a)})}}};a.initView=function(){b.get("/api/teams/"+c.id).success(function(b){a.team=b}).error(function(a){e.show(a.message,"danger")})},a.initAgents=function(){b.get("/api/agents").success(function(d){a.agents=d.rows,b.get("/api/user_has_teams",{params:{TeamId:c.id}}).success(function(b){ComponentsDropdowns.bindTeam(_.pluck(b,"UserId"),_.map(a.agents,function(a){return{id:a.id,name:a.name}}),f)}).error(function(a){console.error(a)})})},a.updateItem=function(){var f=angular.copy(a.team),g=angular.copy(a.team);b.put("/api/teams/"+c.id,f).success(function(){e.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(b){a.team=g,b.errors.forEach(function(a){e.show(a.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.teams.view",{url:"/view/:id",templateUrl:"app/team/view/view.html",controller:"TeamViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.teams.view.agents",{url:"/agents",templateUrl:"app/team/view/view.agents.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/scripts/components-dropdowns.js"]}])}]}}).state("main.teams.view.settings",{url:"/settings",templateUrl:"app/team/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TeamWizardCtrl",["$scope","$http","$translate","$location","WizardHandler","xAlert",function(a,b,c,d,e,f){a.forms={info:void 0},a.item={},a.createItem=function(){b.post("api/teams",a.item).success(function(){f.show(c.instant("MESSAGE_TEAM_CREATE_SUCCESS"),"success"),d.path("/teams/list")}).error(function(a){a.errors.forEach(function(a){f.show(a.message,"danger")})})},a.goNext=function(){e.wizard().next()},a.formValidation=function(a){return a}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.teams.wizard",{url:"/wizard",templateUrl:"app/team/wizard/wizard.html",controller:"TeamWizardCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({name:"ui.select",insertBefore:"#ng_load_plugins_before",files:["assets/plugins/ui-select/select.min.css","assets/plugins/ui-select/select.min.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("TriggerListCtrl",["$scope","$http","$translate","$rootScope","stResource","Modal","socket","xAlert",function(a,b,c,d,e,f,g,h){a.conf={TriggersByPage:{name:"10",value:10}},a.TriggersByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.onText="On",a.offText="Off",a.isActive=!0,a.size="mini",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.Triggers={checked:[]},a.check=function(b,c){c?a.Triggers.checked=angular.copy(_.pluck(a.displayedTriggers,"id")):a.Triggers.checked=[]},a.getTriggers=function(b){return _.map(a.displayedTriggers,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){g.unsyncUpdates("trigger"),b.url="/api/triggers",e.getPage(b).then(function(c){a.displayedTriggers=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.TriggersByPage,a.displayedTriggers.length),d.updateTableConfig(a.conf.TriggersByPage,a.displayedTriggers.length)}),g.socket.on("trigger:save",function(){a.initList(b)}),g.socket.on("trigger:remove",function(c){a.Triggers.checked=_.without(a.Triggers.checked,c.id),a.initList(b)})},a.deleteItem=f.confirm["delete"](function(a){b["delete"]("/api/triggers/"+a).success(function(){h.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.deleteItems=f.confirm["delete"](function(){b["delete"]("/api/triggers",{params:{id:a.Triggers.checked}}).success(function(){h.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){h.show(c.instant(a.message),"danger")})}),a.updateItem=function(a,d){b.put("api/triggers/"+a,{status:d}).success(function(a){h.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.triggers.list",{url:"/list",templateUrl:"app/trigger/list/list.html",controller:"TriggerListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.triggers",{url:"/triggers",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TriggerViewCtrl",["$scope","$stateParams","$http","$translate","xAlert","triggers",function(a,b,c,d,e,f){a.$triggers=f,a.forms={info:{}},a.fields={},a.properties=f.properties,a.initView=function(){c.get("/api/triggers/"+b.id).success(function(b){a.trigger=b,a.conditionsFilter=JSON.parse(b.conditions),a.actionsFilter=JSON.parse(b.actions),a.fields.conditions=a.$triggers.triggers[b.channel].conditions,a.fields.actions=a.$triggers.triggers[b.channel].actions}).error(function(a){e.show(a.message,"danger")})},a.getProperties=function(){g(),i(),h()};var g=function(){c.get("/api/mail/templates/").success(function(b){a.mailTemplates=b.rows;var c=[];b.rows.forEach(function(a){c.push({name:a.name,value:a.id})}),a.properties.mail.template=c}).error(function(a){e.show(a.message,"danger")})},h=function(){c.get("/api/voice/queues/").success(function(b){a.voiceQueues=b.rows;var c=[];b.rows.forEach(function(a){c.push({name:a.name,value:a.name})}),a.properties.voice.queue=c}).error(function(a){e.show(a.message,"danger")})},i=function(){c.get("/api/mail/servers/out/").success(function(b){a.stmpAccounts=b;var c=[];b.forEach(function(a){c.push({name:a.username,value:a.username})}),a.properties.mail.smtp=c}).error(function(a){e.show(a.message,"danger")})};a.updateTrigger=function(){c.put("/api/triggers/"+a.trigger.id,{name:a.trigger.name,description:a.trigger.description,conditions:angular.toJson(a.conditionsFilter),actions:angular.toJson(a.actionsFilter)}).success(function(){e.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.triggers.view",{
-url:"/view/:id",templateUrl:"app/trigger/view/view.html",controller:"TriggerViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.triggers.view.settings",{url:"/settings",templateUrl:"app/trigger/view/view.settings.html"}).state("main.triggers.view.routes",{url:"/routes",templateUrl:"app/trigger/view/view.routes.html"}).state("main.triggers.view.application",{url:"/application",templateUrl:"app/trigger/view/view.application.html"})}]),angular.module("xCallyShuttleApp").controller("TriggerWizardCtrl",["$scope","$http","$location","xAlert","triggers","WizardHandler",function(a,b,c,d,e,f){a.$triggers=e,a.tempData={voice:{},mail:{},chat:{},fax:{}},a.item={},a.fields={},a.properties=e.properties,a.forms={general:{}};var g={group:{"boolean":"AND",rules:[],type:"CONDITION",main:!0}},h={group:{rules:[],type:"ACTION"}};a.conditionsFilter=_.clone(g,!0),a.actionsFilter=_.clone(h,!0),a.$watch("item.channel",function(b,c){c&&(a.tempData[c].conditionsFilter=_.clone(a.conditionsFilter,!0),a.tempData[c].actionsFilter=_.clone(a.actionsFilter,!0)),a.conditionsFilter=a.tempData[b].conditionsFilter?a.tempData[b].conditionsFilter:_.clone(g,!0),a.actionsFilter=a.tempData[b].actionsFilter?a.tempData[b].actionsFilter:_.clone(h,!0),a.fields.conditions=a.$triggers.triggers[b].conditions,a.fields.actions=a.$triggers.triggers[b].actions},!0),a.item.channel="voice",a.getProperties=function(){i(),k(),j()};var i=function(){b.get("/api/mail/templates/").success(function(b){a.mailTemplates=b.rows;var c=[];b.rows.forEach(function(a){c.push({name:a.name,value:a.id})}),a.properties.mail.template=c}).error(function(a){d.show(a.message,"danger")})},j=function(){b.get("/api/mail/servers/out/").success(function(b){a.stmpAccounts=b;var c=[];b.forEach(function(a){c.push({name:a.username,value:a.username})}),a.properties.mail.smtp=c}).error(function(a){d.show(a.message,"danger")})},k=function(){b.get("/api/voice/queues/").success(function(b){a.voiceQueues=b.rows;var c=[];b.rows.forEach(function(a){c.push({name:a.name,value:a.name})}),a.properties.voice.queue=c}).error(function(a){d.show(a.message,"danger")})};a.createItem=function(){a.item.conditions=angular.toJson(a.conditionsFilter),a.item.actions=angular.toJson(a.actionsFilter),b.post("/api/triggers",a.item).success(function(){c.path("/triggers/list")}).error(function(a){d.show(a.message,"danger")})},a.next=function(){f.wizard().next()},a.previous=function(){f.wizard().previous()},a.exitValidation=function(a){return a}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.triggers.wizard",{url:"/wizard",templateUrl:"app/trigger/wizard/wizard.html",controller:"TriggerWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("TrunkListCtrl",["$scope","$http","$translate","$rootScope","xAlert","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={trunksByPage:{name:"10",value:10},labels:["name","host","context","description"]},a.trunksByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.trunks={checked:[]},a.check=function(b,c){c?a.trunks.checked=angular.copy(_.pluck(a.displayedTrunks,"id")):a.trunks.checked=[]},a.getTrunks=function(b){return _.map(a.displayedTrunks,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("trunk"),b.url="/api/trunks",console.log(b),h.getPage(b).then(function(c){a.displayedTrunks=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.trunksByPage,a.displayedTrunks.length),d.updateTableConfig(a.conf.trunksByPage,a.displayedTrunks.length)}),f.socket.on("trunk:save",function(){a.initList(b)}),f.socket.on("trunk:remove",function(c){a.trunks.checked=_.without(a.trunks.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/trunks/"+a).success(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){e.show(c.instant(a.message),"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/trunks",{params:{id:a.trunks.checked}}).success(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){e.show(c.instant(a.message),"danger")})}),a.$on("$destroy",function(){console.log("trunks destroy")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.trunks.list",{url:"/list",templateUrl:"app/trunk/list/list.html",controller:"TrunkListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.trunks",{url:"/trunks",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TrunkViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$location",function(a,b,c,d,e,f,g){a.getTrunk=function(){b.get("/api/trunks/"+e.id).success(function(b){b.nat=""===b.nat?[]:b.nat.split(","),b.allow=""===b.allow?[]:b.allow.split(";"),b.insecure=""===b.insecure?[]:b.insecure.split(","),b.transport=""===b.transport?[]:b.transport.split(","),delete b.secret,a.trunk=b}).error(function(a){console.error(a),g.path("/trunks/list")})},a.updateTrunk=function(){""===a.trunk.password&&delete a.trunk.password;var f=angular.copy(a.trunk);f.nat=f.nat.join(","),f.allow=f.allow.join(";"),f.insecure=f.insecure.join(","),f.transport=f.transport.join(","),b.put("/api/trunks/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),f.nat=f.nat.split(","),f.naallowt=f.allow.split(";"),f.insecure=f.insecure.split(","),f.transport=f.transport.split(","),a.trunk=f})},a.getContexts=function(){b.get("/api/voice/contexts").success(function(b){a.voiceContexts=b.rows,f.syncUpdates("voice_context",a.voiceContexts)}).error(function(a){c.show(d.instant(a.message),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.trunks.view",{url:"/view/:id",templateUrl:"app/trunk/view/view.html",controller:"TrunkViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.trunks.view.settings",{url:"/settings",templateUrl:"app/trunk/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TrunkWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","socket","$translate",function(a,b,c,d,e,f,g){a.initWizard=function(){a.forms={},a.item={context:"from-voip-provider"}},a.next=function(d){d?b.post("/api/trunks/validate/",a.item).success(function(a){console.log(a),a.length?e.show(g.instant("MESSAGE_EXIST_TRUNK"),"danger"):c.wizard().next()}).error(function(a){e.show(g.instant(a.message),"danger")}):c.wizard().next()},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/trunks/",a.item).success(function(){d.path("/trunks/list")}).error(function(a){e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.trunks.wizard",{url:"/wizard",templateUrl:"app/trunk/wizard/wizard.html",controller:"TrunkWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("UpdateListCheckoutCtrl",["$scope","Update","$uibModalInstance",function(a,b,c){a.modal={dismissable:!0,title:"Confirm Checkout",html:"Are you sure you want to checkout?",buttons:[{classes:"btn btn-success",text:"Checkout",click:function(){c.close()}},{classes:"btn default",text:"Cancel",click:function(){c.dismiss("cancel")}}]},a.initList=function(){b.get(function(b){a.updates=b.all})}}]),angular.module("xCallyShuttleApp").controller("UpdateListCtrl",["$scope","$uibModal","$log","$translate","Update","xAlert",function(a,b,c,d,e,f){a.conf={updatesByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.updatesByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.pull=function(){var a=b.open({animation:!0,templateUrl:"app/update/list/checkout/checkout.html",controller:"UpdateListCheckoutCtrl"});a.result.then(function(){e.pull(function(a){a.summary.changes?f.show(d.instant("APPLICATION_UPDATED_TO_LATEST_VERSION"),"success"):f.show(d.instant("APPLICATION_ALREADY_UP_TO_DATE"),"info")},function(a){f.show(a,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.checkout=function(a){var g=b.open({animation:!0,templateUrl:"app/update/list/checkout/checkout.html",controller:"UpdateListCheckoutCtrl",resolve:{hash:function(){return a}}});g.result.then(function(){e.checkout({controller:a.replace(/["']+/g,"")},function(){f.show(d.instant("APPLICATION_WELL_DONE"),"success")},function(a){f.show(a,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.initList=function(){e.get(function(b){a.updates=b.all})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.updates.list",{url:"/list",templateUrl:"app/update/list/list.html",controller:"UpdateListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Update",["$resource",function(a){return a("/api/updates/:id/:controller",{id:"@id"},{pull:{method:"GET",params:{id:"pull"}},checkout:{method:"GET",params:{id:"checkout"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.updates",{url:"/updates",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("UpdateViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$cookieStore","socket","FileUploader","Auth",function(a,b,c,d,e,f,g,h,i){a.Auth=i,a.updatePassword=function(){var f,g;i.isAdmin()?(f="/api/updates/password/"+e.id+"/reset",g={newPassword:a.update.newPwd}):(f="/api/updates/password/",g={oldPassword:a.update.currentPwd,newPassword:a.update.newPwd}),b.put(f,g).success(function(a){c.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){c.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})};var j=a.uploader=new h({url:"api/users/"+e.id+"/avatar",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+f.get("token")}});j.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),j.onSuccessItem=function(b,e,f,g){a.update.userpic=e.userpic,a.update.id===i.getCurrentUser().id&&(i.getCurrentUser().userpic=e.userpic),c.show(d.instant("MESSAGE_WELL_DONE"),"success")},j.onErrorItem=function(a,b,e,f){c.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},j.onCompleteAll=function(){j.clearQueue()},a.initView=function(){b.get("/api/updates/"+e.id).success(function(b){a.update=b,a.update.transport=a.update.transport?a.update.transport.split(","):[],a.update.allow=a.update.allow?a.update.allow.split(";"):[]}).error(function(a){c.show(a.message,"danger")})},a.updateItem=function(){var f=angular.copy(a.update),g=angular.copy(a.update);delete f.password,delete f.md5secret,f.transport=f.transport.join(","),f.allow=f.allow.join(";"),b.put("/api/updates/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(b){a.update=g,b.errors.forEach(function(a){c.show(a.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.updates.view",{url:"/view/:id",templateUrl:"app/update/view/view.html",controller:"UpdateViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.updates.view.account",{url:"/account",templateUrl:"app/update/view/view.account.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("UpdateWizardCtrl",["$scope","$http","xAlert","$location","WizardHandler","$translate",function(a,b,c,d,e,f){a.forms={info:void 0,voice:void 0},a.item={role:"update",allow:["alaw","ulaw","gsm"],transport:["udp"],context:"from-sip"},a.next=function(){b.post("/api/updates/validate/",a.item).success(function(a){console.log(a),a.length?c.show(f.instant("MESSAGE_EXIST_INTERNAL"),"danger"):e.wizard().next()}).error(function(a){c.show(f.instant(a.message),"danger")})},a.getFirstFreeInternal=function(){b.get("/api/settings/internal").success(function(b){a.item.internal=b.value}).error(function(a){c.show(f.instant(a.message),"danger")})},a.exitValidation=function(a){return a},a.createItem=function(){a.item.transport&&(a.item.transport=a.item.transport.join(",")),a.item.allow&&(a.item.allow=a.item.allow.join(";")),b.post("/api/updates/",a.item).success(function(){d.path("/updates/list")}).error(function(a){a.errors.forEach(function(a){c.show(a.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.updates.wizard",{url:"/wizard",templateUrl:"app/update/wizard/wizard.html",controller:"UpdateWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("UserListCtrl",["$scope","$http","xAlert","$rootScope","$translate","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={usersByPage:{name:"10",value:10}},a.usersByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.users={checked:[]},a.check=function(b,c){c?a.users.checked=angular.copy(_.pluck(a.displayedUsers,"id")):a.users.checked=[]},a.getUsers=function(b){return _.map(a.displayedUsers,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/users/"+a).success(function(){c.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){a.errors.forEach(function(b){c.show(a.message+": "+b.message,"danger")})})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/users",{params:{id:a.users.checked}}).success(function(){c.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){a.errors.forEach(function(b){c.show(a.message+": "+b.message,"danger")})})}),a.initList=function(b){f.unsyncUpdates("user"),b.url="/api/users/",h.getPage(b).then(function(c){a.displayedUsers=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.usersByPage,a.displayedUsers.length),d.updateTableConfig(a.conf.usersByPage,a.displayedUsers.length)}),f.socket.on("user:save",function(){a.initList(b)}),f.socket.on("user:remove",function(c){a.users.checked=_.without(a.users.checked,c.id),a.initList(b)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.users.list",{url:"/list",templateUrl:"app/user/list/list.html",controller:"UserListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.users",{url:"/users",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("UserViewCtrl",["$scope","$http","$stateParams","$translate","FileUploader","$cookieStore","Auth","xAlert",function(a,b,c,d,e,f,g,h){a.Auth=g,a.updatePassword=function(){var e,f;g.isAdmin()?(e="/api/users/password/"+c.id+"/reset",f={newPassword:a.user.newPwd}):(e="/api/users/password/",f={oldPassword:a.user.currentPwd,newPassword:a.user.newPwd}),b.put(e,f).success(function(a){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})};var i=a.uploader=new e({url:"api/users/"+c.id+"/avatar",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+f.get("token")}});i.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),i.onSuccessItem=function(b,c,e,f){a.user.userpic=c.userpic,a.user.id===g.getCurrentUser().id&&(g.getCurrentUser().userpic=c.userpic),h.show(d.instant("MESSAGE_WELL_DONE"),"success")},i.onErrorItem=function(a,b,c,e){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},i.onCompleteAll=function(){i.clearQueue()},a.initView=function(){b.get("/api/users/"+c.id).success(function(b){a.user=b,a.user.transport=a.user.transport?a.user.transport.split(","):[],a.user.allow=a.user.allow?a.user.allow.split(";"):[]}).error(function(a){a.errors.forEach(function(b){h.show(a.message+": "+b.message,"danger")})})},a.updateItem=function(){var e=angular.copy(a.user),f=angular.copy(a.user);delete e.password,delete e.md5secret,e.transport=e.transport.join(","),e.allow=e.allow.join(";"),b.put("/api/users/"+c.id,e).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(b){a.user=f,b.errors.forEach(function(a){h.show(b.message+": "+a.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.users.view",{url:"/view/:id",templateUrl:"app/user/view/view.html",controller:"UserViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.users.view.account",{url:"/account",templateUrl:"app/user/view/view.account.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css","assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("UserWizardCtrl",["$scope","$http","$location","WizardHandler","xAlert","$translate",function(a,b,c,d,e,f){a.forms={info:void 0,voice:void 0},a.item={role:"user",host:"dynamic",context:"from-sip"},a.next=function(){d.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/users/",a.item).success(function(){e.show(f.instant("MESSAGE_WELL_DONE"),"success"),c.path("/users/list")}).error(function(a){a.errors.forEach(function(b){e.show(a.message+": "+b.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.users.wizard",{url:"/wizard",templateUrl:"app/user/wizard/wizard.html",controller:"UserWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("VariableListCreateModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.ok=function(){a.item.model=JSON.stringify({title:a.item.name}),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VariableListCtrl",["$scope","$http","socket","$rootScope","$translate","xAlert","Modal","stResource","$uibModal","$log",function(a,b,c,d,e,f,g,h,i,j){a.conf={variablesByPage:{name:"10",value:10}},a.variablesByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.Variables={checked:[]},a.check=function(b,c){c?a.Variables.checked=angular.copy(_.pluck(a.displayedVariables,"id")):a.Variables.checked=[]},a.getVariables=function(b){return _.map(a.displayedVariables,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){c.unsyncUpdates("variable"),b.url="/api/variables",h.getPage(b).then(function(c){a.displayedVariables=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.variablesByPage,a.displayedVariables.length),d.updateTableConfig(a.conf.variablesByPage,a.displayedVariables.length)}),c.socket.on("variable:save",function(){a.initList(b)}),c.socket.on("variable:remove",function(c){a.Variables.checked=_.without(a.Variables.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/variables/"+a).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/variables",{params:{id:a.Variables.checked}}).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.create=function(){var a=i.open({animation:!0,templateUrl:"app/variable/list/create.modal.html",controller:"VariableListCreateModalCtrl"});a.result.then(function(a){b.post("/api/variables",a).then(function(a){f.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.data.message,"danger")})},function(){j.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.variables.list",{url:"/list",templateUrl:"app/variable/list/list.html",controller:"VariableListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.variables",{url:"/variables",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VariableViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.getVariable=function(){b.get("/api/variables/"+e.id).success(function(b){a.variable=b}).error(function(a){console.error(a),f.path("/variables/list")})},a.updateVariable=function(){var f=angular.copy(a.variable);b.put("/api/variables/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.variable=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.variables.view",{url:"/view/:id",templateUrl:"app/variable/view/view.html",controller:"VariableViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.variables.view.settings",{url:"/settings",templateUrl:"app/variable/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.contexts",{url:"/contexts",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceContextListCtrl",["$scope","$http","socket","$rootScope","$translate","xAlert","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={contextsByPage:{name:"10",value:10}},a.contextsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.voiceContexts={checked:[]},a.check=function(b,c){c?a.voiceContexts.checked=angular.copy(_.pluck(a.displayedVoiceContexts,"id")):a.voiceContexts.checked=[]},a.getVoiceContexts=function(b){return _.map(a.displayedVoiceContexts,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){c.unsyncUpdates("voice_context"),b.url="/api/voice/contexts",h.getPage(b).then(function(c){a.displayedVoiceContexts=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.contextsByPage,a.displayedVoiceContexts.length),d.updateTableConfig(a.conf.contextsByPage,a.displayedVoiceContexts.length)}),c.socket.on("voice_context:save",function(){a.initList(b)}),c.socket.on("voice_context:remove",function(c){a.voiceContexts.checked=_.without(a.voiceContexts.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/voice/contexts/"+a).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/voice/contexts",{params:{id:a.voiceContexts.checked}}).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.contexts.list",{url:"/list",templateUrl:"app/voice/context/list/list.html",controller:"VoiceContextListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceContextViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.getContext=function(){b.get("/api/voice/contexts/"+e.id).success(function(b){a.context=b}).error(function(a){console.error(a),f.path("/voice/contexts/list")})},a.updateVoiceContext=function(){var f=angular.copy(a.context);b.put("/api/voice/contexts/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.context=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.contexts.view",{url:"/view/:id",templateUrl:"app/voice/context/view/view.html",controller:"VoiceContextViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.voice.contexts.view.settings",{url:"/settings",templateUrl:"app/voice/context/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("VoiceContextWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","$translate",function(a,b,c,d,e,f){a.forms={context:void 0},a.item={},a.next=function(){b.post("/api/voice/contexts/validate/",a.item).success(function(a){console.log(a),a.length?e.show(f.instant("MESSAGE_EXIST_CONTEXT"),"danger"):c.wizard().next()}).error(function(a){e.show(f.instant(a.message),"danger")})},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/voice/contexts/",a.item).success(function(){d.path("/voice/contexts/list")}).error(function(a){e.show(f.instant(a.message),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.contexts.wizard",{url:"/wizard",templateUrl:"app/voice/context/wizard/wizard.html",controller:"VoiceContextWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("VoiceMohListCtrl",["$scope","$http","$translate","$rootScope","xAlert","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={mohsByPage:{name:"10",value:10},labels:["name","directory","sort","description"]},a.mohsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.mohs={checked:[]},a.check=function(b,c){c?a.mohs.checked=angular.copy(_.pluck(a.displayedMohs,"id")):a.mohs.checked=[]},a.getMohs=function(b){return _.map(a.displayedMohs,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("voice_musiconhold"),b.url="/api/voice/musiconholds",h.getPage(b).then(function(c){a.displayedMohs=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.mohsByPage,a.displayedMohs.length),d.updateTableConfig(a.conf.mohsByPage,a.displayedMohs.length)}),f.socket.on("voice_musiconhold:save",function(){a.initList(b)}),f.socket.on("voice_musiconhold:remove",function(c){a.mohs.checked=_.without(a.mohs.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/voice/musiconholds/"+a).success(function(){e.show(c.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){e.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/voice/musiconholds",{params:{id:a.mohs.checked}}).success(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){e.show(c.instant(a.message),"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.mohs.list",{url:"/list",templateUrl:"app/voice/moh/list/list.html",controller:"VoiceMohListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.mohs",{url:"/mohs",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceMohViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","Modal","$sce","$location",function(a,b,c,d,e,f,g,h,i){a.$translate=d,a.audioSources={},a.sortOptions=[{value:"random",name:"APPLICATION_RANDOM"},{value:"alpha",name:"APPLICATION_ALPHABETICAL"}],a.getMoh=function(){b.get("/api/voice/musiconholds/"+e.id).success(function(b){delete b.stamp,a.moh=b}).error(function(a){console.error(a),i.path("/voice/mohs/list")})},a.updateVoiceMoh=function(){console.log("update");var f=angular.copy(a.moh);b.put("/api/voice/musiconholds/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.voiceMoh=f})},a.addMohs=function(){b.post("/api/voice/musiconholds/"+e.id+"/files",a.item).success(function(){i.path("voice/mohs/view/"+e.id+"/audios")}).error(function(a){c.show(d.instant(a.message),"danger")})},a.getAudioFiles=function(){b.get("/api/voice/musiconholds/"+e.id+"/files").success(function(b){a.audioFiles=b.files,a.mohPath=b.path,a.audioFiles.forEach(function(a){j(a)})}).error(function(a){console.error(a)})},a.getSecureSrc=function(a){return h.trustAsResourceUrl(a)};var j=function(c){b.get("/api/voice/musiconholds/stream",{params:{path:encodeURI(a.mohPath+"/"+c)}}).success(function(b){a.audioSources[c]="data:audio/ogg;base64,"+b}).error(function(a){console.error(a)})};a.getSounds=function(){a.item={sounds:[]},b.get("/api/uploads").success(function(b){a.soundList=b}).error(function(a){console.error(a)})},a.deleteItem=g.confirm["delete"](function(f){b["delete"]("/api/voice/musiconholds/"+e.id+"/files",{params:{filename:f}}).success(function(){_.remove(a.audioFiles,function(a){return a===f}),c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){c.show(a.message,"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.mohs.view",{url:"/view/:id",templateUrl:"app/voice/moh/view/view.html",controller:"VoiceMohViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.voice.mohs.view.settings",{url:"/settings",templateUrl:"app/voice/moh/view/view.settings.html"}).state("main.voice.mohs.view.audios",{url:"/audios",templateUrl:"app/voice/moh/view/view.audios.html",cache:!1}).state("main.voice.mohs.view.add",{url:"/add",templateUrl:"app/voice/moh/view/view.addFiles.html",cache:!1})}]),angular.module("xCallyShuttleApp").controller("VoiceMohWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","socket","$translate",function(a,b,c,d,e,f,g){a.$translate=g,a.initWizard=function(){a.forms={},a.item={sort:"alpha"}},a.next=function(){b.post("/api/voice/musiconholds/validate/",a.item).success(function(a){
+url:"/view/:id",templateUrl:"app/trigger/view/view.html",controller:"TriggerViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.triggers.view.settings",{url:"/settings",templateUrl:"app/trigger/view/view.settings.html"}).state("main.triggers.view.routes",{url:"/routes",templateUrl:"app/trigger/view/view.routes.html"}).state("main.triggers.view.application",{url:"/application",templateUrl:"app/trigger/view/view.application.html"})}]),angular.module("xCallyShuttleApp").controller("TriggerWizardCtrl",["$scope","$http","$location","xAlert","triggers","WizardHandler",function(a,b,c,d,e,f){a.$triggers=e,a.tempData={voice:{},mail:{},chat:{},fax:{}},a.item={},a.fields={},a.properties=e.properties,a.forms={general:{}};var g={group:{"boolean":"AND",rules:[],type:"CONDITION",main:!0}},h={group:{rules:[],type:"ACTION"}};a.conditionsFilter=_.clone(g,!0),a.actionsFilter=_.clone(h,!0),a.$watch("item.channel",function(b,c){c&&(a.tempData[c].conditionsFilter=_.clone(a.conditionsFilter,!0),a.tempData[c].actionsFilter=_.clone(a.actionsFilter,!0)),a.conditionsFilter=a.tempData[b].conditionsFilter?a.tempData[b].conditionsFilter:_.clone(g,!0),a.actionsFilter=a.tempData[b].actionsFilter?a.tempData[b].actionsFilter:_.clone(h,!0),a.fields.conditions=a.$triggers.triggers[b].conditions,a.fields.actions=a.$triggers.triggers[b].actions},!0),a.item.channel="voice",a.getProperties=function(){i(),k(),j()};var i=function(){b.get("/api/mail/templates/").success(function(b){a.mailTemplates=b.rows;var c=[];b.rows.forEach(function(a){c.push({name:a.name,value:a.id})}),a.properties.mail.template=c}).error(function(a){d.show(a.message,"danger")})},j=function(){b.get("/api/mail/servers/out/").success(function(b){a.stmpAccounts=b;var c=[];b.forEach(function(a){c.push({name:a.username,value:a.username})}),a.properties.mail.smtp=c}).error(function(a){d.show(a.message,"danger")})},k=function(){b.get("/api/voice/queues/").success(function(b){a.voiceQueues=b.rows;var c=[];b.rows.forEach(function(a){c.push({name:a.name,value:a.name})}),a.properties.voice.queue=c}).error(function(a){d.show(a.message,"danger")})};a.createItem=function(){a.item.conditions=angular.toJson(a.conditionsFilter),a.item.actions=angular.toJson(a.actionsFilter),b.post("/api/triggers",a.item).success(function(){c.path("/triggers/list")}).error(function(a){d.show(a.message,"danger")})},a.next=function(){f.wizard().next()},a.previous=function(){f.wizard().previous()},a.exitValidation=function(a){return a}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.triggers.wizard",{url:"/wizard",templateUrl:"app/trigger/wizard/wizard.html",controller:"TriggerWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("TrunkListCtrl",["$scope","$http","$translate","$rootScope","xAlert","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={trunksByPage:{name:"10",value:10},labels:["name","host","context","description"]},a.trunksByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.trunks={checked:[]},a.check=function(b,c){c?a.trunks.checked=angular.copy(_.pluck(a.displayedTrunks,"id")):a.trunks.checked=[]},a.getTrunks=function(b){return _.map(a.displayedTrunks,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("trunk"),b.url="/api/trunks",console.log(b),h.getPage(b).then(function(c){a.displayedTrunks=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.trunksByPage,a.displayedTrunks.length),d.updateTableConfig(a.conf.trunksByPage,a.displayedTrunks.length)}),f.socket.on("trunk:save",function(){a.initList(b)}),f.socket.on("trunk:remove",function(c){a.trunks.checked=_.without(a.trunks.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/trunks/"+a).success(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){e.show(c.instant(a.message),"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/trunks",{params:{id:a.trunks.checked}}).success(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){e.show(c.instant(a.message),"danger")})}),a.$on("$destroy",function(){console.log("trunks destroy")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.trunks.list",{url:"/list",templateUrl:"app/trunk/list/list.html",controller:"TrunkListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.trunks",{url:"/trunks",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TrunkViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$location",function(a,b,c,d,e,f,g){a.getTrunk=function(){b.get("/api/trunks/"+e.id).success(function(b){b.nat=""===b.nat?[]:b.nat.split(","),b.allow=""===b.allow?[]:b.allow.split(";"),b.insecure=""===b.insecure?[]:b.insecure.split(","),b.transport=""===b.transport?[]:b.transport.split(","),delete b.secret,a.trunk=b}).error(function(a){console.error(a),g.path("/trunks/list")})},a.updateTrunk=function(){""===a.trunk.password&&delete a.trunk.password;var f=angular.copy(a.trunk);f.nat=f.nat.join(","),f.allow=f.allow.join(";"),f.insecure=f.insecure.join(","),f.transport=f.transport.join(","),b.put("/api/trunks/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),f.nat=f.nat.split(","),f.naallowt=f.allow.split(";"),f.insecure=f.insecure.split(","),f.transport=f.transport.split(","),a.trunk=f})},a.getContexts=function(){b.get("/api/voice/contexts").success(function(b){a.voiceContexts=b.rows,f.syncUpdates("voice_context",a.voiceContexts)}).error(function(a){c.show(d.instant(a.message),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.trunks.view",{url:"/view/:id",templateUrl:"app/trunk/view/view.html",controller:"TrunkViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.trunks.view.settings",{url:"/settings",templateUrl:"app/trunk/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TrunkWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","socket","$translate",function(a,b,c,d,e,f,g){a.initWizard=function(){a.forms={},a.item={context:"from-voip-provider"}},a.next=function(d){d?b.post("/api/trunks/validate/",a.item).success(function(a){console.log(a),a.length?e.show(g.instant("MESSAGE_EXIST_TRUNK"),"danger"):c.wizard().next()}).error(function(a){e.show(g.instant(a.message),"danger")}):c.wizard().next()},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/trunks/",a.item).success(function(){d.path("/trunks/list")}).error(function(a){e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.trunks.wizard",{url:"/wizard",templateUrl:"app/trunk/wizard/wizard.html",controller:"TrunkWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("UpdateListCheckoutCtrl",["$scope","Update","$uibModalInstance",function(a,b,c){a.modal={dismissable:!0,title:"Confirm Checkout",html:"Are you sure you want to checkout?",buttons:[{classes:"btn btn-success",text:"Checkout",click:function(){c.close()}},{classes:"btn default",text:"Cancel",click:function(){c.dismiss("cancel")}}]},a.initList=function(){b.get(function(b){a.updates=b.all})}}]),angular.module("xCallyShuttleApp").controller("UpdateListCtrl",["$scope","$uibModal","$log","$translate","Update","xAlert",function(a,b,c,d,e,f){a.conf={updatesByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.updatesByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.pull=function(){var a=b.open({animation:!0,templateUrl:"app/update/list/checkout/checkout.html",controller:"UpdateListCheckoutCtrl"});a.result.then(function(){e.pull(function(a){a.summary.changes?f.show(d.instant("APPLICATION_UPDATED_TO_LATEST_VERSION"),"success"):f.show(d.instant("APPLICATION_ALREADY_UP_TO_DATE"),"info")},function(a){f.show(a,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.checkout=function(a){var g=b.open({animation:!0,templateUrl:"app/update/list/checkout/checkout.html",controller:"UpdateListCheckoutCtrl",resolve:{hash:function(){return a}}});g.result.then(function(){e.checkout({controller:a.replace(/["']+/g,"")},function(){f.show(d.instant("APPLICATION_WELL_DONE"),"success")},function(a){f.show(a,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.initList=function(){e.query(function(b){console.log(b),a.updates=b})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.updates.list",{url:"/list",templateUrl:"app/update/list/list.html",controller:"UpdateListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Update",["$resource",function(a){return a("/api/updates/:id/:controller",{id:"@id"},{pull:{method:"GET",params:{id:"pull"}},checkout:{method:"GET",params:{id:"checkout"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.updates",{url:"/updates",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("UpdateViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$cookieStore","socket","FileUploader","Auth",function(a,b,c,d,e,f,g,h,i){a.Auth=i,a.updatePassword=function(){var f,g;i.isAdmin()?(f="/api/updates/password/"+e.id+"/reset",g={newPassword:a.update.newPwd}):(f="/api/updates/password/",g={oldPassword:a.update.currentPwd,newPassword:a.update.newPwd}),b.put(f,g).success(function(a){c.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){c.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})};var j=a.uploader=new h({url:"api/users/"+e.id+"/avatar",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+f.get("token")}});j.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),j.onSuccessItem=function(b,e,f,g){a.update.userpic=e.userpic,a.update.id===i.getCurrentUser().id&&(i.getCurrentUser().userpic=e.userpic),c.show(d.instant("MESSAGE_WELL_DONE"),"success")},j.onErrorItem=function(a,b,e,f){c.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},j.onCompleteAll=function(){j.clearQueue()},a.initView=function(){b.get("/api/updates/"+e.id).success(function(b){a.update=b,a.update.transport=a.update.transport?a.update.transport.split(","):[],a.update.allow=a.update.allow?a.update.allow.split(";"):[]}).error(function(a){c.show(a.message,"danger")})},a.updateItem=function(){var f=angular.copy(a.update),g=angular.copy(a.update);delete f.password,delete f.md5secret,f.transport=f.transport.join(","),f.allow=f.allow.join(";"),b.put("/api/updates/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(b){a.update=g,b.errors.forEach(function(a){c.show(a.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.updates.view",{url:"/view/:id",templateUrl:"app/update/view/view.html",controller:"UpdateViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.updates.view.account",{url:"/account",templateUrl:"app/update/view/view.account.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("UpdateWizardCtrl",["$scope","$http","xAlert","$location","WizardHandler","$translate",function(a,b,c,d,e,f){a.forms={info:void 0,voice:void 0},a.item={role:"update",allow:["alaw","ulaw","gsm"],transport:["udp"],context:"from-sip"},a.next=function(){b.post("/api/updates/validate/",a.item).success(function(a){console.log(a),a.length?c.show(f.instant("MESSAGE_EXIST_INTERNAL"),"danger"):e.wizard().next()}).error(function(a){c.show(f.instant(a.message),"danger")})},a.getFirstFreeInternal=function(){b.get("/api/settings/internal").success(function(b){a.item.internal=b.value}).error(function(a){c.show(f.instant(a.message),"danger")})},a.exitValidation=function(a){return a},a.createItem=function(){a.item.transport&&(a.item.transport=a.item.transport.join(",")),a.item.allow&&(a.item.allow=a.item.allow.join(";")),b.post("/api/updates/",a.item).success(function(){d.path("/updates/list")}).error(function(a){a.errors.forEach(function(a){c.show(a.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.updates.wizard",{url:"/wizard",templateUrl:"app/update/wizard/wizard.html",controller:"UpdateWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("UserListCtrl",["$scope","$http","xAlert","$rootScope","$translate","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={usersByPage:{name:"10",value:10}},a.usersByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.users={checked:[]},a.check=function(b,c){c?a.users.checked=angular.copy(_.pluck(a.displayedUsers,"id")):a.users.checked=[]},a.getUsers=function(b){return _.map(a.displayedUsers,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/users/"+a).success(function(){c.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){a.errors.forEach(function(b){c.show(a.message+": "+b.message,"danger")})})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/users",{params:{id:a.users.checked}}).success(function(){c.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){a.errors.forEach(function(b){c.show(a.message+": "+b.message,"danger")})})}),a.initList=function(b){f.unsyncUpdates("user"),b.url="/api/users/",h.getPage(b).then(function(c){a.displayedUsers=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.usersByPage,a.displayedUsers.length),d.updateTableConfig(a.conf.usersByPage,a.displayedUsers.length)}),f.socket.on("user:save",function(){a.initList(b)}),f.socket.on("user:remove",function(c){a.users.checked=_.without(a.users.checked,c.id),a.initList(b)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.users.list",{url:"/list",templateUrl:"app/user/list/list.html",controller:"UserListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.users",{url:"/users",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("UserViewCtrl",["$scope","$http","$stateParams","$translate","FileUploader","$cookieStore","Auth","xAlert",function(a,b,c,d,e,f,g,h){a.Auth=g,a.updatePassword=function(){var e,f;g.isAdmin()?(e="/api/users/password/"+c.id+"/reset",f={newPassword:a.user.newPwd}):(e="/api/users/password/",f={oldPassword:a.user.currentPwd,newPassword:a.user.newPwd}),b.put(e,f).success(function(a){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})};var i=a.uploader=new e({url:"api/users/"+c.id+"/avatar",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+f.get("token")}});i.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),i.onSuccessItem=function(b,c,e,f){a.user.userpic=c.userpic,a.user.id===g.getCurrentUser().id&&(g.getCurrentUser().userpic=c.userpic),h.show(d.instant("MESSAGE_WELL_DONE"),"success")},i.onErrorItem=function(a,b,c,e){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},i.onCompleteAll=function(){i.clearQueue()},a.initView=function(){b.get("/api/users/"+c.id).success(function(b){a.user=b,a.user.transport=a.user.transport?a.user.transport.split(","):[],a.user.allow=a.user.allow?a.user.allow.split(";"):[]}).error(function(a){a.errors.forEach(function(b){h.show(a.message+": "+b.message,"danger")})})},a.updateItem=function(){var e=angular.copy(a.user),f=angular.copy(a.user);delete e.password,delete e.md5secret,e.transport=e.transport.join(","),e.allow=e.allow.join(";"),b.put("/api/users/"+c.id,e).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(b){a.user=f,b.errors.forEach(function(a){h.show(b.message+": "+a.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.users.view",{url:"/view/:id",templateUrl:"app/user/view/view.html",controller:"UserViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.users.view.account",{url:"/account",templateUrl:"app/user/view/view.account.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css","assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("UserWizardCtrl",["$scope","$http","$location","WizardHandler","xAlert","$translate",function(a,b,c,d,e,f){a.forms={info:void 0,voice:void 0},a.item={role:"user",host:"dynamic",context:"from-sip"},a.next=function(){d.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/users/",a.item).success(function(){e.show(f.instant("MESSAGE_WELL_DONE"),"success"),c.path("/users/list")}).error(function(a){a.errors.forEach(function(b){e.show(a.message+": "+b.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.users.wizard",{url:"/wizard",templateUrl:"app/user/wizard/wizard.html",controller:"UserWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("VariableListCreateModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.ok=function(){a.item.model=JSON.stringify({title:a.item.name}),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VariableListCtrl",["$scope","$http","socket","$rootScope","$translate","xAlert","Modal","stResource","$uibModal","$log",function(a,b,c,d,e,f,g,h,i,j){a.conf={variablesByPage:{name:"10",value:10}},a.variablesByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.Variables={checked:[]},a.check=function(b,c){c?a.Variables.checked=angular.copy(_.pluck(a.displayedVariables,"id")):a.Variables.checked=[]},a.getVariables=function(b){return _.map(a.displayedVariables,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){c.unsyncUpdates("variable"),b.url="/api/variables",h.getPage(b).then(function(c){a.displayedVariables=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.variablesByPage,a.displayedVariables.length),d.updateTableConfig(a.conf.variablesByPage,a.displayedVariables.length)}),c.socket.on("variable:save",function(){a.initList(b)}),c.socket.on("variable:remove",function(c){a.Variables.checked=_.without(a.Variables.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/variables/"+a).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/variables",{params:{id:a.Variables.checked}}).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.create=function(){var a=i.open({animation:!0,templateUrl:"app/variable/list/create.modal.html",controller:"VariableListCreateModalCtrl"});a.result.then(function(a){b.post("/api/variables",a).then(function(a){f.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.data.message,"danger")})},function(){j.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.variables.list",{url:"/list",templateUrl:"app/variable/list/list.html",controller:"VariableListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.variables",{url:"/variables",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VariableViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.getVariable=function(){b.get("/api/variables/"+e.id).success(function(b){a.variable=b}).error(function(a){console.error(a),f.path("/variables/list")})},a.updateVariable=function(){var f=angular.copy(a.variable);b.put("/api/variables/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.variable=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.variables.view",{url:"/view/:id",templateUrl:"app/variable/view/view.html",controller:"VariableViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.variables.view.settings",{url:"/settings",templateUrl:"app/variable/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.contexts",{url:"/contexts",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceContextListCtrl",["$scope","$http","socket","$rootScope","$translate","xAlert","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={contextsByPage:{name:"10",value:10}},a.contextsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.voiceContexts={checked:[]},a.check=function(b,c){c?a.voiceContexts.checked=angular.copy(_.pluck(a.displayedVoiceContexts,"id")):a.voiceContexts.checked=[]},a.getVoiceContexts=function(b){return _.map(a.displayedVoiceContexts,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){c.unsyncUpdates("voice_context"),b.url="/api/voice/contexts",h.getPage(b).then(function(c){a.displayedVoiceContexts=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.contextsByPage,a.displayedVoiceContexts.length),d.updateTableConfig(a.conf.contextsByPage,a.displayedVoiceContexts.length)}),c.socket.on("voice_context:save",function(){a.initList(b)}),c.socket.on("voice_context:remove",function(c){a.voiceContexts.checked=_.without(a.voiceContexts.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/voice/contexts/"+a).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/voice/contexts",{params:{id:a.voiceContexts.checked}}).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.contexts.list",{url:"/list",templateUrl:"app/voice/context/list/list.html",controller:"VoiceContextListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceContextViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.getContext=function(){b.get("/api/voice/contexts/"+e.id).success(function(b){a.context=b}).error(function(a){console.error(a),f.path("/voice/contexts/list")})},a.updateVoiceContext=function(){var f=angular.copy(a.context);b.put("/api/voice/contexts/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.context=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.contexts.view",{url:"/view/:id",templateUrl:"app/voice/context/view/view.html",controller:"VoiceContextViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.voice.contexts.view.settings",{url:"/settings",templateUrl:"app/voice/context/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("VoiceContextWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","$translate",function(a,b,c,d,e,f){a.forms={context:void 0},a.item={},a.next=function(){b.post("/api/voice/contexts/validate/",a.item).success(function(a){console.log(a),a.length?e.show(f.instant("MESSAGE_EXIST_CONTEXT"),"danger"):c.wizard().next()}).error(function(a){e.show(f.instant(a.message),"danger")})},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/voice/contexts/",a.item).success(function(){d.path("/voice/contexts/list")}).error(function(a){e.show(f.instant(a.message),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.contexts.wizard",{url:"/wizard",templateUrl:"app/voice/context/wizard/wizard.html",controller:"VoiceContextWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("VoiceMohListCtrl",["$scope","$http","$translate","$rootScope","xAlert","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={mohsByPage:{name:"10",value:10},labels:["name","directory","sort","description"]},a.mohsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.mohs={checked:[]},a.check=function(b,c){c?a.mohs.checked=angular.copy(_.pluck(a.displayedMohs,"id")):a.mohs.checked=[]},a.getMohs=function(b){return _.map(a.displayedMohs,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("voice_musiconhold"),b.url="/api/voice/musiconholds",h.getPage(b).then(function(c){a.displayedMohs=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.mohsByPage,a.displayedMohs.length),d.updateTableConfig(a.conf.mohsByPage,a.displayedMohs.length)}),f.socket.on("voice_musiconhold:save",function(){a.initList(b)}),f.socket.on("voice_musiconhold:remove",function(c){a.mohs.checked=_.without(a.mohs.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/voice/musiconholds/"+a).success(function(){e.show(c.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){e.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/voice/musiconholds",{params:{id:a.mohs.checked}}).success(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){e.show(c.instant(a.message),"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.mohs.list",{url:"/list",templateUrl:"app/voice/moh/list/list.html",controller:"VoiceMohListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.mohs",{url:"/mohs",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceMohViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","Modal","$sce","$location",function(a,b,c,d,e,f,g,h,i){a.$translate=d,a.audioSources={},a.sortOptions=[{value:"random",name:"APPLICATION_RANDOM"},{value:"alpha",name:"APPLICATION_ALPHABETICAL"}],a.getMoh=function(){b.get("/api/voice/musiconholds/"+e.id).success(function(b){delete b.stamp,a.moh=b}).error(function(a){console.error(a),i.path("/voice/mohs/list")})},a.updateVoiceMoh=function(){console.log("update");var f=angular.copy(a.moh);b.put("/api/voice/musiconholds/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.voiceMoh=f})},a.addMohs=function(){b.post("/api/voice/musiconholds/"+e.id+"/files",a.item).success(function(){i.path("voice/mohs/view/"+e.id+"/audios")}).error(function(a){c.show(d.instant(a.message),"danger")})},a.getAudioFiles=function(){b.get("/api/voice/musiconholds/"+e.id+"/files").success(function(b){a.audioFiles=b.files,a.mohPath=b.path,a.audioFiles.forEach(function(a){j(a)})}).error(function(a){console.error(a)})},a.getSecureSrc=function(a){return h.trustAsResourceUrl(a)};var j=function(c){b.get("/api/voice/musiconholds/stream",{params:{path:encodeURI(a.mohPath+"/"+c)}}).success(function(b){a.audioSources[c]="data:audio/ogg;base64,"+b}).error(function(a){console.error(a)})};a.getSounds=function(){a.item={sounds:[]},b.get("/api/uploads").success(function(b){a.soundList=b}).error(function(a){console.error(a)})},a.deleteItem=g.confirm["delete"](function(f){b["delete"]("/api/voice/musiconholds/"+e.id+"/files",{params:{filename:f}}).success(function(){_.remove(a.audioFiles,function(a){return a===f}),c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){c.show(a.message,"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.mohs.view",{url:"/view/:id",templateUrl:"app/voice/moh/view/view.html",controller:"VoiceMohViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.voice.mohs.view.settings",{url:"/settings",templateUrl:"app/voice/moh/view/view.settings.html"}).state("main.voice.mohs.view.audios",{url:"/audios",templateUrl:"app/voice/moh/view/view.audios.html",cache:!1}).state("main.voice.mohs.view.add",{url:"/add",templateUrl:"app/voice/moh/view/view.addFiles.html",cache:!1})}]),angular.module("xCallyShuttleApp").controller("VoiceMohWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","socket","$translate",function(a,b,c,d,e,f,g){a.$translate=g,a.initWizard=function(){a.forms={},a.item={sort:"alpha"}},a.next=function(){b.post("/api/voice/musiconholds/validate/",a.item).success(function(a){
console.log(a),a.length?e.show(g.instant("MESSAGE_EXIST_MOH"),"danger"):c.wizard().next()}).error(function(a){e.show(g.instant(a.message),"danger")})},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/voice/musiconholds/",a.item).success(function(a){d.path("/voice/mohs/view/"+a.id+"/audios")}).error(function(a){e.show(g.instant(a.message),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.mohs.wizard",{url:"/wizard",templateUrl:"app/voice/moh/wizard/wizard.html",controller:"VoiceMohWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("VoiceQueueListCtrl",["$scope","$http","socket","$translate","$rootScope","Modal","xAlert","stResource",function(a,b,c,d,e,f,g,h){a.conf={voiceQueuesByPage:{name:"10",value:10},labels:["name","description","strategy","context"]},a.voiceQueuesByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.queues={checked:[]},a.check=function(b,c){c?a.queues.checked=angular.copy(_.pluck(a.displayedQueues,"name")):a.queues.checked=[]},a.getQueues=function(b){return _.map(a.displayedQueues,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){c.unsyncUpdates("voice_queue"),b.url="/api/voice/queues",h.getPage(b).then(function(c){a.displayedQueues=c.rows,b.pagination.numberOfPages=c.total_pages,e.updateTableConfig(a.voiceQueuesByPage,a.displayedQueues.length),e.updateTableConfig(a.conf.voiceQueuesByPage,a.displayedQueues.length)}),c.socket.on("voice_queue:save",function(){a.initList(b)}),c.socket.on("voice_queue:remove",function(c){console.log("remove"),a.queues.checked=_.without(a.queues.checked,c.name),a.initList(b)})},a.deleteItem=f.confirm["delete"](function(a){b["delete"]("/api/voice/queues/"+a).success(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){g.show(a.message,"danger")})}),a.deleteItems=f.confirm["delete"](function(){b["delete"]("/api/voice/queues",{params:{name:a.queues.checked}}).success(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){g.show(d.instant(a.message),"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.queues.list",{url:"/list",templateUrl:"app/voice/queue/list/list.html",controller:"VoiceQueueListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.queues",{url:"/queues",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceQueueViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$location",function(a,b,c,d,e,f,g){a.binaryChoices=[{name:"Yes",value:1},{name:"No",value:0}],a.monitorFormats=[{name:"wav",value:"wav"},{name:"gsm",value:"gsm"},{name:"Inactive",value:""}],a.queueAnnounces=[{display_name:"Default",value:null},{display_name:"Disabled",value:""}];var h=function(){return{select:function(c){b.post("/api/voice/queues/"+a.queue.name+"/agents",{agents:c}).success(function(){a.getTeams()}).error(function(a){console.error(a)})},deselect:function(c){b.put("/api/voice/queues/"+a.queue.name+"/agents",{agents:c}).success(function(){a.getTeams()}).error(function(a){console.error(a)})}}};a.getQueue=function(){b.get("/api/voice/queues/"+e.id).success(function(b){b.joinempty=""===b.joinempty?[]:b.joinempty.split(","),b.leavewhenempty=""===b.leavewhenempty?[]:b.leavewhenempty.split(","),b.periodic_announce=""===b.periodic_announce?[]:b.periodic_announce.split(","),a.queue=b}).error(function(a){g.path("/voice/queues/list")})},a.updateVoiceQueue=function(){var f=angular.copy(a.queue);f.joinempty=f.joinempty.join(","),f.leavewhenempty=f.leavewhenempty.join(","),f.periodic_announce=f.periodic_announce.join(","),f.context||(f.context=null),b.put("/api/voice/queues/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),f.joinempty=f.joinempty.split(","),f.leavewhenempty=f.leavewhenempty.split(","),f.periodic_announce=f.periodic_announce.split(","),a.queue=f})},a.getTeams=function(){b.get("/api/teams").success(function(c){a.teams=c.rows,b({url:"/api/voice/user_has_queues",method:"GET",params:{queue:a.queue.name}}).success(function(b){ComponentsDropdowns.bindQueue(a.teams,_.pluck(b,"UserId"),h)})}).error(function(a){console.error(a)})},a.getContexts=function(){b.get("/api/voice/contexts").success(function(b){a.voiceContexts=b.rows,f.syncUpdates("voice_context",a.voiceContexts)}).error(function(a){c.show(d.instant(a.message),"danger")})},a.getMohs=function(){b.get("/api/voice/musiconholds").success(function(b){a.voiceMohs=b.rows,f.syncUpdates("voice_musiconhold",a.voiceMohs)}).error(function(a){c.show(a.message,"danger")})},a.getSounds=function(){b.get("/api/uploads").success(function(b){a.queueAnnounces=a.queueAnnounces.concat(b),a.periodicAnnounces=angular.copy(b),b.unshift({display_name:"None",converted_path:null,value:""}),a.sounds=b,f.syncUpdates("upload",a.sounds)}).error(function(a){console.error(a)})},a.returnAnnouncePath=function(a){return console.log("func"),a.converted_path?a.converted_path+"/"+a.save_name:null===a.value?null:a.value}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.queues.view",{url:"/view/:id",templateUrl:"app/voice/queue/view/view.html",controller:"VoiceQueueViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.voice.queues.view.settings",{url:"/settings",templateUrl:"app/voice/queue/view/view.settings.html"}).state("main.voice.queues.view.agents",{url:"/agents",templateUrl:"app/voice/queue/view/view.agents.html",cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/scripts/components-dropdowns.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceQueueWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","socket","$translate",function(a,b,c,d,e,f,g){a.forms={queue:void 0},a.item={},a.next=function(){b.post("/api/voice/queues/validate/",a.item).success(function(a){console.log(a),a.length?e.show(g.instant("MESSAGE_EXIST_QUEUE"),"danger"):c.wizard().next()}).error(function(a){e.show(g.instant(a.message),"danger")})},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/voice/queues/",a.item).success(function(){d.path("/voice/queues/list")}).error(function(a){e.show(g.instant(a.message),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.queues.wizard",{url:"/wizard",templateUrl:"app/voice/queue/wizard/wizard.html",controller:"VoiceQueueWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.realtime",{url:"/realtime",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewAgentCtrl",["$scope","$http","$log","$uibModal","$translate","socket","xAlert",function(a,b,c,d,e,f,g){a.conf={agentsByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.agentsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.$on("$destroy",function(){f.unsyncUpdates("user_has_voice_queue")}),a.groups=[],a.pauses=["pausa1","pausa2","pausa3"],a.pause=function(f,h){var i=d.open({animation:!0,size:f,templateUrl:"app/voice/realtime/view/agent/pause.modal.html",controller:"VoiceRealtimeViewAgentPauseModalCtrl",resolve:{items:function(){return a.pauses},data:function(){return h}}});i.result.then(function(a){b.post("/api/ami",a).then(function(a){console.log(a),g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.log(a),g.show(a.data.message,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.add=function(f,h){var i=d.open({animation:!0,size:f,templateUrl:"app/voice/realtime/view/agent/queue.modal.add.html",controller:"VoiceRealtimeViewAgentQueueModalCtrl",resolve:{pauses:function(){return a.pauses},data:function(){return h}}});i.result.then(function(a){console.log(a),b.post("/api/voice/user_has_queues",a).then(function(){a.login?b.post("/api/ami",a).then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")}):g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.remove=function(a,f){var h=d.open({animation:!0,size:a,templateUrl:"app/voice/realtime/view/agent/queue.modal.remove.html",controller:"VoiceRealtimeViewAgentQueueModalCtrl",resolve:{pauses:function(){return null},data:function(){return f}}});h.result.then(function(a){_.isArray(a)?a.forEach(function(a){b.post("/api/ami",a).then(function(){a.logout?b.put("/api/voice/queues/"+a.queue+"/agents",{agents:[a.UserId]}).then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")}):g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")})}):b.post("/api/ami",a).then(function(){a.logout?b.put("/api/voice/queues/"+a.queue+"/agents",{agents:[a.UserId]}).then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")}):g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.initAgents=function(){b.get("/api/voice/user_has_queues").success(function(b){a.agents=b,a.groups=_.map(_.groupBy(a.agents,"membername"),function(a,b){return{membername:b,queues:a}}),f.socket.on("user_has_voice_queue:save",function(b){var c=_.find(a.groups,{membername:b.membername}),d=a.groups.indexOf(c);if(c){var e=_.find(c.queues,{queue:b.queue});e?_.merge(e,b):a.groups[d].queues.push(b)}else{var f={membername:b.membername,queues:[b]};a.groups.unshift(f)}}),f.socket.on("user_has_voice_queue:remove",function(b){var c=_.find(a.groups,{membername:b.membername});_.remove(c.queues,{queue:b.queue}),c.queues.length||_.remove(a.groups,{membername:b.membername})}),f.socket.on("report_agent:save",function(b){var c=_.find(a.groups,{membername:b.membername}),d=a.groups.indexOf(c);if(c){var e=_.find(c.queues,{queue:b.queue});e?_.merge(e,b):a.groups[d].queues.push(b)}else{var f={membername:b.membername,queues:[b]};a.groups.unshift(f)}})}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewAgentPauseModalCtrl",["$scope","$uibModalInstance","items","data",function(a,b,c,d){a.items=c,a.data=d,a.selected={item:a.items[0],queue:_.isArray(d)?a.data[0].queue:a.data.queue,membername:_.isArray(d)?a.data[0].membername:a.data.membername,"interface":_.isArray(d)?a.data[0]["interface"]:a.data["interface"]},a.ok=function(c){var e={action:"QueuePause","interface":a.selected["interface"],paused:c,reason:a.selected.item};_.isArray(d)||(e.queue=a.selected.queue),b.close(e)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewAgentQueueModalCtrl",["$scope","$uibModalInstance","$http","pauses","data",function(a,b,c,d,e){a.initAdd=function(){a.data=e,a.pauses=d,a.selected={membername:a.data[0].membername,"interface":a.data[0]["interface"],penalty:0,paused:!1,reason:a.pauses[0],UserId:a.data[0].UserId},c.get("/api/voice/queues",{params:{page:0,per_page:100}}).success(function(b){a.queues=_.reject(b.rows,function(b){return _.find(a.data,{queue:b.name})?!0:!1}),a.selected.queue=a.queues[0]?a.queues[0].name:null,console.log(a.queues)}).error(function(a){console.error(a)})},a.initRemove=function(){a.data=e,_.isArray(e)?a.selected={membername:a.data[0].membername,"interface":a.data[0]["interface"],logout:!1,UserId:a.data[0].UserId}:a.selected={membername:a.data.membername,"interface":a.data["interface"],queue:a.data.queue,logout:!1,UserId:a.data.UserId}},a.okAdd=function(){console.log(a.selected);var c={action:"QueueAdd",logged:a.data[0].logged,loggedAt:a.data[0].loggedAt,queue:a.selected.queue,membername:a.selected.membername,"interface":a.selected["interface"],penalty:a.selected.penalty,paused:a.selected.paused,UserId:a.selected.UserId};c.paused&&(c.reason=a.selected.reason),b.close(c)},a.okRemove=function(){var c;_.isArray(a.data)?(c=[],a.data.forEach(function(b){c.push({action:"QueueRemove",queue:b.queue,"interface":b["interface"],logout:a.selected.logout,UserId:b.UserId})})):c={action:"QueueRemove",queue:a.selected.queue,logout:a.selected.logout,"interface":a.selected["interface"],UserId:a.selected.UserId},b.close(c)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewAgentReportCtrl",["$scope","$http","socket",function(a,b,c){a.$on("$destroy",function(){c.unsyncUpdates("report_agent")}),a.conf={agentsByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.agentsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.initReport=function(){a.agents=[],b.get("/api/report/agents").success(function(b){a.agents=b,c.syncUpdates("report_agent",a.agents)}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").filter("VoiceRealtimeViewAgentReportFilter",function(){return function(a){return new Date(1970,0,1).setSeconds(a)}}),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewQueueReportCtrl",["$scope","$http","socket",function(a,b,c){a.$on("$destroy",function(){c.unsyncUpdates("report_queue")}),a.conf={queuesByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.queuesByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.initReport=function(){a.queues=[],b.get("/api/report/queues").success(function(b){console.log(b),a.queues=b,c.syncUpdates("report_queue",a.queues)}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").filter("VoiceRealtimeViewQueueReportFilter",function(){return function(a){return new Date(1970,0,1).setSeconds(a)}}),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewQueuePauseModalCtrl",["$scope","$uibModalInstance","items","data",function(a,b,c,d){a.items=c,a.data=d,console.log(d),a.selected={item:a.items[0],queue:_.isArray(d)?a.data[0].queue:a.data.queue,membername:_.isArray(d)?a.data[0].membername:a.data.membername,"interface":_.isArray(d)?a.data[0]["interface"]:a.data["interface"]},a.ok=function(c,e){var f;_.isArray(d)?(f=[],d.forEach(function(b){f.push({action:"QueuePause",queue:b.queue,membername:b.membername,"interface":b["interface"],paused:c,reason:a.selected.item})})):f={action:"QueuePause",queue:a.selected.queue,membername:a.selected.membername,"interface":a.selected["interface"],paused:c,reason:a.selected.item},b.close(f)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewQueueCtrl",["$scope","$http","$log","$uibModal","$translate","socket","xAlert",function(a,b,c,d,e,f,g){a.conf={agentsByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.agentsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.$on("$destroy",function(){f.unsyncUpdates("user_has_voice_queue")}),a.groups=[],a.pauses=["pausa1","pausa2","pausa3"],a.pause=function(f,h){var i=d.open({animation:!0,size:f,templateUrl:"app/voice/realtime/view/queue/pause.modal.html",controller:"VoiceRealtimeViewQueuePauseModalCtrl",resolve:{items:function(){return a.pauses},data:function(){return h}}});i.result.then(function(a){_.isArray(a)?a.forEach(function(a){b.post("/api/ami",a).then(function(a){console.log(a),g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.log(a),g.show(a.data.message,"danger")})}):b.post("/api/ami",a).then(function(a){console.log(a),g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.log(a),g.show(a.data.message,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.add=function(f,h){var i=d.open({animation:!0,size:f,templateUrl:"app/voice/realtime/view/queue/queue.modal.add.html",controller:"VoiceRealtimeViewQueueQueueModalCtrl",resolve:{pauses:function(){return a.pauses},data:function(){return h}}});i.result.then(function(a){console.log("action",a),b.post("/api/voice/user_has_queues",a).then(function(){a.login?b.post("/api/ami",a).then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")}):g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.message,"danger")}),console.log(a)},function(){c.info("Modal dismissed at: "+new Date)})},a.remove=function(a,f){var h=d.open({animation:!0,size:a,templateUrl:"app/voice/realtime/view/queue/queue.modal.remove.html",controller:"VoiceRealtimeViewQueueQueueModalCtrl",resolve:{pauses:function(){return null},data:function(){return f}}});h.result.then(function(a){_.isArray(a)?a.forEach(function(a){b.post("/api/ami",a).then(function(){a.logout?b.put("/api/voice/queues/"+a.queue+"/agents",{agents:[a.UserId]}).then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")}):g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")})}):b.post("/api/ami",a).then(function(){a.logout?b.put("/api/voice/queues/"+a.queue+"/agents",{agents:[a.UserId]}).then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")}):g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.initQueues=function(){b.get("/api/voice/user_has_queues").success(function(b){a.queues=b,a.groups=_.map(_.groupBy(a.queues,"queue"),function(a,b){return{queue:b,agents:a}}),console.log("ok"),f.socket.on("user_has_voice_queue:save",function(b){console.log("item",b);var c=_.find(a.groups,{queue:b.queue}),d=a.groups.indexOf(c);if(c){var e=_.find(c.agents,{membername:b.membername});e?_.merge(e,b):a.groups[d].agents.push(b)}else{var f={queue:b.queue,agents:[b]};a.groups.unshift(f)}}),f.socket.on("user_has_voice_queue:remove",function(b){var c=_.find(a.groups,{queue:b.queue});_.remove(c.agents,{membername:b.membername}),c.agents.length||_.remove(a.groups,{queue:b.queue})}),f.socket.on("report_agent:save",function(b){var c=_.find(a.groups,{queue:b.queue}),d=a.groups.indexOf(c);if(c){var e=_.find(c.agents,{membername:b.membername});e?_.merge(e,b):a.groups[d].agents.push(b)}else{var f={queue:b.queue,agents:[b]};a.groups.unshift(f)}})}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewQueueQueueModalCtrl",["$scope","$uibModalInstance","$http","pauses","data",function(a,b,c,d,e){a.initAdd=function(){a.data=e,a.pauses=d,a.selected={penalty:0,paused:!1,reason:a.pauses[0]},a.$watch("selected.agent",function(b){b&&(a.selected.membername=b.name,a.selected["interface"]="SIP/"+b.name,a.selected.UserId=b.id)}),c.get("/api/agents",{params:{page:0,per_page:500}}).success(function(b){a.agents=_.reject(b.rows,function(b){return _.find(a.data,{membername:b.name})?!0:!1}),a.selected.queue=a.data[0]?a.data[0].queue:null}).error(function(a){console.error(a)})},a.initRemove=function(){a.data=e,console.log(e),_.isArray(e)?a.selected={queue:a.data[0].queue,logout:!1}:a.selected={membername:a.data.membername,"interface":a.data["interface"],queue:a.data.queue,logout:!1,UserId:a.data.UserId}},a.okAdd=function(){var c={action:"QueueAdd",queue:a.selected.queue,membername:a.selected.membername,"interface":a.selected["interface"],penalty:a.selected.penalty,paused:a.selected.paused,UserId:a.selected.UserId};c.paused&&(c.reason=a.selected.reason),b.close(c)},a.okRemove=function(){var c;_.isArray(a.data)?(c=[],a.data.forEach(function(b){c.push({action:"QueueRemove",queue:b.queue,"interface":b["interface"],logout:a.selected.logout,UserId:b.UserId})})):c={action:"QueueRemove",queue:a.selected.queue,logout:a.selected.logout,"interface":a.selected["interface"],UserId:a.selected.UserId},b.close(c)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewCtrl",["$scope",function(a){a.agents=[{name:"View1",link:"main.voice.realtime.view.agents"},{name:"View2",link:"main.voice.realtime.view.areports"}],a.queues=[{name:"View1",link:"main.voice.realtime.view.queues"},{name:"View2",link:"main.voice.realtime.view.qreports"}]}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.realtime.view",{url:"/view",templateUrl:"app/voice/realtime/view/view.html",controller:"VoiceRealtimeViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.voice.realtime.view.queues",{url:"/queues",controller:"VoiceRealtimeViewQueueCtrl",templateUrl:"app/voice/realtime/view/queue/queue.html"}).state("main.voice.realtime.view.qreports",{url:"/qreport/:search",controller:"VoiceRealtimeViewQueueReportCtrl",templateUrl:"app/voice/realtime/view/qreport/report.html"}).state("main.voice.realtime.view.agents",{url:"/agents",controller:"VoiceRealtimeViewAgentCtrl",templateUrl:"app/voice/realtime/view/agent/agent.html"}).state("main.voice.realtime.view.areports",{url:"/areport",controller:"VoiceRealtimeViewAgentReportCtrl",templateUrl:"app/voice/realtime/view/areport/report.html"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.routes.inbound",{url:"/inbound",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInboundListCtrl",["$scope","$http","socket","$translate","$rootScope","xAlert","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={routesByPage:{name:"10",value:10}},a.routesByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.routes={checked:[]},a.check=function(b){b?a.routes.checked=angular.copy(_.pluck(a.displayedRoutes,"id")):a.routes.checked=[]},a.getRoutes=function(b){return _.map(a.displayedRoutes,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){c.unsyncUpdates("voice_extension"),b.url="/api/voice/extensions/route/inbound",h.getPage(b).then(function(c){a.displayedRoutes=c.rows,b.pagination.numberOfPages=c.total_pages,e.updateTableConfig(a.routesByPage,a.displayedRoutes.length),e.updateTableConfig(a.conf.routesByPage,a.displayedRoutes.length)}),c.socket.on("voice_extension:save",function(c){"inbound"===c.type&&a.initList(b)}),c.socket.on("voice_extension:remove",function(c){"inbound"===c.type&&(a.routes.checked=_.without(a.routes.checked,c.id),a.initList(b))})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/voice/extensions/"+a).success(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/voice/extensions/",{params:{id:a.routes.checked}}).success(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(d.instant(a.message),"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.routes.inbound.list",{url:"/list",templateUrl:"app/voice/route/inbound/list/list.html",controller:"VoiceRouteInboundListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInboundViewCtrl",["$scope","$http","$translate","$stateParams","socket","$location","WizardHandler","Modal","xAlert","application","interval",function(a,b,c,d,e,f,g,h,i,j,k){a.$translate=c,a.$application=j.application,a.$interval=k.interval,a.initApplication=function(){a.forms={settings:void 0,interval:void 0},a.application={VoiceExtensionId:d.id,type:"inbound"},a.interval={intType:"always",t_from:moment(new Date),t_to:moment(new Date),wd_from:"always",wd_to:"always",md_from:"always",md_to:"always",m_from:"always",m_to:"always",alwaysTime:!0},a.main={app:""}},a.joinInterval=function(a){console.log(a);var b,c,d,e;return b=a.t_from&&a.t_to&&!a.alwaysTime?moment(a.t_from).format("HH:mm")+"-"+moment(a.t_to).format("HH:mm"):"*",a.wd_from&&"always"!==a.wd_from?(c=a.wd_from.toLowerCase(),a.wd_to&&"always"!==a.wd_to&&(c+="-"+a.wd_to.toLowerCase())):c="*",a.md_from&&"always"!==a.md_from?(d=a.md_from,a.md_to&&"always"!==a.md_to&&(d+="-"+a.md_to)):d="*",a.m_from&&"always"!==a.m_from?(e=a.m_from.toLowerCase(),a.m_to&&"always"!==a.m_to&&(e+="-"+a.m_to.toLowerCase())):e="*",b+","+c+","+d+","+e},a.$watch("main.app",function(c){if(c){var e,f;switch(d.appId||(a.application={VoiceExtensionId:d.id,type:"inbound",interval:a.application.interval}),c){case"Queue":e="api/voice/queues",f="/api/uploads";break;case"Playback":e="/api/uploads";break;case"AGI":e="/api/square/projects";break;case"Goto":e="/api/voice/contexts";break;default:e=null,f=null}e&&b.get(e).success(function(b){a.items="Playback"!==c?b.rows:b}),f&&b.get(f).success(function(b){a.items2=b})}},!0),a.getIntervals=function(){b.get("/api/intervals").success(function(b){a.Intervals=b.rows,e.syncUpdates("interval",a.Intervals)}).error(function(a){i.show(c.instant(a.message),"danger")})},a.getRouteApplications=function(){b.get("/api/voice/extensions/"+d.id+"/applications").success(function(b){a.routeApplications=b,e.unsyncUpdates("voice_extension"),e.socket.on("voice_extension:remove",function(b){b.where.appGroup&&_.remove(a.routeApplications,function(a){return b.where.appGroup==a.appGroup})}),e.socket.on("voice_extension:save",function(b){if(b.VoiceExtensionId===d.id&&b.isApp){var c=_.find(a.routeApplications,{id:b.id});c||a.routeApplications.push(b)}})})},a.sortableOptions={stop:function(){b.post("api/voice/extensions/"+d.id+"/applications",{applications:_.pluck(a.routeApplications,"appGroup")}).success(function(b){a.getRouteApplications()}).error(function(a){console.error(a)})},"ui-floating":!0},a.getRoute=function(){b.get("/api/voice/extensions/"+d.id).success(function(b){a.route=b,e.socket.on("voice_extension:update",function(b){b.id==d.id&&(a.route=b)})}).error(function(a){f.path("/voice/routes/inbound/list")})},a.getApplication=function(){b.get("/api/voice/extensions/applications/"+d.appId).success(function(b){var c=_.filter(a.$application.applications,function(a){return a.value===b.app});if(c.length>0&&!b.customApp?a.main.app=b.app:a.main.app="custom",a.application=b,a.interval.t_from=moment(new Date),a.interval.t_to=moment(new Date),"Queue"===b.app&&(a.application.app_options=b.app_options?b.app_options.split(","):[]),a.interval.intType=b.IntervalId?"list":"*,*,*,*"===b.interval?"always":"custom",a.interval.IntervalId=b.IntervalId,!b.IntervalId){var d,e=b.interval?b.interval.split(","):["*","*","*","*"];e.forEach(function(b,c){switch(c){case 0:"*"!==b?(d=b.split("-"),a.interval.t_from=moment(d[0],"HH:mm"),a.interval.t_to=moment(d[1],"HH:mm"),a.interval.alwaysTime=!1):(a.interval.t_from=moment(new Date),a.interval.t_to=moment(new Date),a.interval.alwaysTime=!0);break;case 1:"*"!==b?(d=b.split("-"),a.interval.wd_from=_.capitalize(d[0]),a.interval.wd_to=d[1]?_.capitalize(d[1]):"always"):(a.interval.wd_from="always",a.interval.wd_to="always");break;case 2:"*"!==b?(d=b.split("-"),a.interval.md_from=d[0],a.interval.md_to=d[1]?d[1]:"always"):(a.interval.md_from="always",a.interval.md_to="always");break;case 3:"*"!==b?(d=b.split("-"),a.interval.m_from=_.capitalize(d[0]),a.interval.m_to=d[1]?_.capitalize(d[1]):"always"):(a.interval.m_from="always",a.interval.m_to="always")}})}}).error(function(a){f.path("/voice/routes/inbound/view/"+d.id+"/applications")})},a.updateRoute=function(){var e=angular.copy(a.route);b.put("/api/voice/extensions/"+d.id,e).success(function(){i.show(c.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){i.show(c.instant(b.message),"danger"),a.route=e})},a.getContexts=function(){b.get("/api/voice/contexts").success(function(b){a.voiceContexts=b.rows,e.syncUpdates("voice_context",a.voiceContexts)}).error(function(a){i.show(c.instant(a.message),"danger")})},a.createItem=function(){switch(a.application.app=a.main.app,a.application.exten=a.route.exten,a.application.context=a.route.context,a.application.app_options&&"Queue"===a.application.app&&(a.application.app_options=a.application.app_options.join(",")),a.interval.intType){case"list":a.application.IntervalId=a.interval.IntervalId,a.application.interval=_.result(_.find(a.Intervals,{id:a.interval.IntervalId}),"name");break;case"custom":a.application.IntervalId=null,a.application.interval=a.joinInterval(a.interval);break;case"always":a.application.IntervalId=null,a.application.interval="*,*,*,*"}b.post("/api/voice/extensions/",a.application).success(function(){f.path("/voice/routes/inbound/view/"+d.id+"/applications")}).error(function(a){i.show(c.instant(a.message),"danger")})},a.updateItem=function(){switch(a.application.app_options&&"Queue"===a.application.app&&(a.application.app_options=a.application.app_options.join(",")),a.interval.intType){case"list":a.application.IntervalId=a.interval.IntervalId,a.application.interval=_.result(_.find(a.Intervals,{id:a.interval.IntervalId}),"name");break;case"custom":a.application.IntervalId=null,a.application.interval=a.joinInterval(a.interval);break;case"always":a.application.IntervalId=null,a.application.interval="*,*,*,*"}b.put("/api/voice/extensions/applications/"+d.appId,a.application).success(function(){i.show(c.instant("MESSAGE_WELL_DONE")+"!","success"),f.path("/voice/routes/inbound/view/"+d.id+"/applications")}).error(function(a){i.show(c.instant(a.message),"danger")})},a.deleteItem=h.confirm["delete"](function(d){b["delete"]("/api/voice/extensions/"+d).success(function(){a.getRouteApplications(),i.show(c.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){i.show(c.instant(a.message),"danger")})}),a.goNext=function(){g.wizard().next()},a.previous=function(){g.wizard().previous()},a.formValidation=function(a){return a},a.$on("destroy",function(){e.unsyncUpdates("voice_extension")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.routes.inbound.view",{url:"/view/:id",templateUrl:"app/voice/route/inbound/view/view.html",controller:"VoiceRouteInboundViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.voice.routes.inbound.view.settings",{url:"/settings",templateUrl:"app/voice/route/inbound/view/view.settings.html"}).state("main.voice.routes.inbound.view.applications",{url:"/applications",templateUrl:"app/voice/route/inbound/view/view.applications.html",cache:!1}).state("main.voice.routes.inbound.view.application",{url:"/application",templateUrl:"app/voice/route/inbound/view/view.application.html",authenticate:!0}).state("main.voice.routes.inbound.view.applications.settings",{url:"/settings/:appId",templateUrl:"app/voice/route/inbound/view/view.applicationSettings.html",
authenticate:!0,controller:"VoiceRouteInboundViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInboundWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","socket","$translate",function(a,b,c,d,e,f,g){a.forms={route:void 0},a.item={type:"inbound",appdata:"Inbound Call",context:"from-voip-provider"},a.next=function(){b.post("/api/voice/extensions/validate/",a.item).success(function(a){console.log(a),a.length?e.show(g.instant("MESSAGE_EXIST_ROUTE"),"danger"):c.wizard().next()}).error(function(a){e.show(g.instant(a.message),"danger")})},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/voice/extensions/",a.item).success(function(a){d.path("/voice/routes/inbound/view/"+a.id+"/applications")}).error(function(a){e.show(g.instant(a.message),"danger")})},a.getContexts=function(){b.get("/api/voice/contexts").success(function(b){a.voiceContexts=b,f.syncUpdates("voice_context",a.voiceContexts)}).error(function(a){e.show(g.instant(a.message),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.routes.inbound.wizard",{url:"/wizard",templateUrl:"app/voice/route/inbound/wizard/wizard.html",controller:"VoiceRouteInboundWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.routes.internal",{url:"/internal",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInternalListCtrl",["$scope","$http","socket","$translate","$rootScope","xAlert","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={routesByPage:{name:"10",value:10}},a.routesByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.routes={checked:[]},a.check=function(b){b?a.routes.checked=angular.copy(_.pluck(a.displayedRoutes,"id")):a.routes.checked=[]},a.getRoutes=function(b){return _.map(a.displayedRoutes,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){c.unsyncUpdates("voice_extension"),b.url="/api/voice/extensions/route/internal",h.getPage(b).then(function(c){a.displayedRoutes=c.rows,b.pagination.numberOfPages=c.total_pages,e.updateTableConfig(a.routesByPage,a.displayedRoutes.length),e.updateTableConfig(a.conf.routesByPage,a.displayedRoutes.length)}),c.socket.on("voice_extension:save",function(c){"internal"===c.type&&a.initList(b)}),c.socket.on("voice_extension:remove",function(c){"internal"===c.type&&(a.routes.checked=_.without(a.routes.checked,c.id),a.initList(b))})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/voice/extensions/"+a).success(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/voice/extensions/",{params:{id:a.routes.checked}}).success(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(d.instant(a.message),"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.routes.internal.list",{url:"/list",templateUrl:"app/voice/route/internal/list/list.html",controller:"VoiceRouteInternalListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInternalViewCtrl",["$scope","$http","$translate","$stateParams","socket","$location","WizardHandler","Modal","xAlert","application","interval",function(a,b,c,d,e,f,g,h,i,j,k){a.$translate=c,a.$application=j.application,a.$interval=k.interval,a.initApplication=function(){a.forms={settings:void 0,interval:void 0},a.application={VoiceExtensionId:d.id,type:"internal"},a.interval={intType:"always",t_from:moment(new Date),t_to:moment(new Date),wd_from:"always",wd_to:"always",md_from:"always",md_to:"always",m_from:"always",m_to:"always",alwaysTime:!0},a.main={app:""}},a.joinInterval=function(a){console.log(a);var b,c,d,e;return b=a.t_from&&a.t_to&&!a.alwaysTime?moment(a.t_from).format("HH:mm")+"-"+moment(a.t_to).format("HH:mm"):"*",a.wd_from&&"always"!==a.wd_from?(c=a.wd_from.toLowerCase(),a.wd_to&&"always"!==a.wd_to&&(c+="-"+a.wd_to.toLowerCase())):c="*",a.md_from&&"always"!==a.md_from?(d=a.md_from,a.md_to&&"always"!==a.md_to&&(d+="-"+a.md_to)):d="*",a.m_from&&"always"!==a.m_from?(e=a.m_from.toLowerCase(),a.m_to&&"always"!==a.m_to&&(e+="-"+a.m_to.toLowerCase())):e="*",b+","+c+","+d+","+e},a.$watch("main.app",function(c){if(c){var e,f;switch(d.appId||(a.application={VoiceExtensionId:d.id,type:"internal",interval:a.application.interval}),c){case"Queue":e="api/voice/queues",f="/api/uploads";break;case"Playback":e="/api/uploads";break;case"AGI":e="/api/square/projects";break;case"Goto":e="/api/voice/contexts";break;default:e=null,f=null}e&&b.get(e).success(function(b){a.items="Playback"!==c?b.rows:b}),f&&b.get(f).success(function(b){a.items2=b})}},!0),a.getIntervals=function(){b.get("/api/intervals").success(function(b){a.Intervals=b.rows,e.syncUpdates("interval",a.Intervals)}).error(function(a){i.show(c.instant(a.message),"danger")})},a.getRouteApplications=function(){b.get("/api/voice/extensions/"+d.id+"/applications").success(function(b){a.routeApplications=b,e.unsyncUpdates("voice_extension"),e.socket.on("voice_extension:remove",function(b){b.where.appGroup&&_.remove(a.routeApplications,function(a){return b.where.appGroup==a.appGroup})}),e.socket.on("voice_extension:save",function(b){if(b.VoiceExtensionId===d.id&&b.isApp){var c=_.find(a.routeApplications,{id:b.id});c||a.routeApplications.push(b)}})})},a.sortableOptions={stop:function(){b.post("api/voice/extensions/"+d.id+"/applications",{applications:_.pluck(a.routeApplications,"appGroup")}).success(function(b){a.getRouteApplications()}).error(function(a){console.error(a)})},"ui-floating":!0},a.getRoute=function(){b.get("/api/voice/extensions/"+d.id).success(function(b){a.route=b,e.socket.on("voice_extension:update",function(b){b.id==d.id&&(a.route=b)})}).error(function(a){console.error(a),f.path("/voice/routes/internal/list")})},a.getApplication=function(){b.get("/api/voice/extensions/applications/"+d.appId).success(function(b){var c=_.filter(a.applications,function(a){return a.value===b.app});if(c.length>0&&!b.customApp?a.main.app=b.app:a.main.app="custom",a.application=b,a.interval.t_from=moment(new Date),a.interval.t_to=moment(new Date),"Queue"===b.app&&(a.application.app_options=b.app_options?b.app_options.split(","):[]),a.interval.intType=b.IntervalId?"list":"custom",a.interval.IntervalId=b.IntervalId,!b.IntervalId){var d,e=b.interval?b.interval.split(","):["*","*","*","*"];e.forEach(function(b,c){switch(c){case 0:"*"!==b?(d=b.split("-"),a.interval.t_from=moment(d[0],"HH:mm"),a.interval.t_to=moment(d[1],"HH:mm"),a.interval.alwaysTime=!1):(a.interval.t_from=moment(new Date),a.interval.t_to=moment(new Date),a.interval.alwaysTime=!0);break;case 1:"*"!==b?(d=b.split("-"),a.interval.wd_from=_.capitalize(d[0]),a.interval.wd_to=d[1]?_.capitalize(d[1]):"always"):(a.interval.wd_from="always",a.interval.wd_to="always");break;case 2:"*"!==b?(d=b.split("-"),a.interval.md_from=d[0],a.interval.md_to=d[1]?d[1]:"always"):(a.interval.md_from="always",a.interval.md_to="always");break;case 3:"*"!==b?(d=b.split("-"),a.interval.m_from=_.capitalize(d[0]),a.interval.m_to=d[1]?_.capitalize(d[1]):"always"):(a.interval.m_from="always",a.interval.m_to="always")}})}}).error(function(a){f.path("/voice/routes/internal/view/"+d.id+"/applications")})},a.updateRoute=function(){var e=angular.copy(a.route);b.put("/api/voice/extensions/"+d.id,e).success(function(){i.show(c.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){i.show(c.instant(b.message),"danger"),a.route=e})},a.getContexts=function(){b.get("/api/voice/contexts").success(function(b){a.voiceContexts=b.rows,e.syncUpdates("voice_context",a.voiceContexts)}).error(function(a){i.show(c.instant(a.message),"danger")})},a.createItem=function(){switch(a.application.app=a.main.app,a.application.exten=a.route.exten,a.application.context=a.route.context,a.application.app_options&&"Queue"===a.application.app&&(a.application.app_options=a.application.app_options.join(",")),a.interval.intType){case"list":a.application.IntervalId=a.interval.IntervalId,a.application.interval=_.result(_.find(a.Intervals,{id:a.interval.IntervalId}),"name");break;case"custom":a.application.IntervalId=null,a.application.interval=a.joinInterval(a.interval);break;case"always":a.application.IntervalId=null,a.application.interval="*,*,*,*"}b.post("/api/voice/extensions/",a.application).success(function(){f.path("/voice/routes/internal/view/"+d.id+"/applications")}).error(function(a){i.show(c.instant(a.message),"danger")})},a.updateItem=function(){switch(a.application.app_options&&"Queue"===a.application.app&&(a.application.app_options=a.application.app_options.join(",")),a.interval.intType){case"list":a.application.IntervalId=a.interval.IntervalId,a.application.interval=_.result(_.find(a.Intervals,{id:a.interval.IntervalId}),"name");break;case"custom":a.application.IntervalId=null,a.application.interval=a.joinInterval(a.interval);break;case"always":a.application.IntervalId=null,a.application.interval="*,*,*,*"}b.put("/api/voice/extensions/applications/"+d.appId,a.application).success(function(){i.show(c.instant("MESSAGE_WELL_DONE")+"!","success"),f.path("/voice/routes/internal/view/"+d.id+"/applications")}).error(function(a){i.show(c.instant(a.message),"danger")})},a.deleteItem=h.confirm["delete"](function(d){b["delete"]("/api/voice/extensions/"+d).success(function(b){a.getRouteApplications(),i.show(c.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){i.show(c.instant(a.message),"danger")})}),a.goNext=function(){g.wizard().next()},a.previous=function(){g.wizard().previous()},a.formValidation=function(a){return a},a.$on("destroy",function(){e.unsyncUpdates("voice_extension")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.routes.internal.view",{url:"/view/:id",templateUrl:"app/voice/route/internal/view/view.html",controller:"VoiceRouteInternalViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.voice.routes.internal.view.settings",{url:"/settings",templateUrl:"app/voice/route/internal/view/view.settings.html"}).state("main.voice.routes.internal.view.applications",{url:"/applications",templateUrl:"app/voice/route/internal/view/view.applications.html",cache:!1}).state("main.voice.routes.internal.view.application",{url:"/application",templateUrl:"app/voice/route/internal/view/view.application.html",authenticate:!0}).state("main.voice.routes.internal.view.applications.settings",{url:"/settings/:appId",templateUrl:"app/voice/route/internal/view/view.applicationSettings.html",authenticate:!0,controller:"VoiceRouteInternalViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInternalWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","socket","$translate",function(a,b,c,d,e,f,g){a.forms={route:void 0},a.item={type:"internal",appdata:"Iternal Call",context:"from-sip"},a.next=function(){b.post("/api/voice/extensions/validate/",a.item).success(function(a){console.log(a),a.length?e.show(g.instant("MESSAGE_EXIST_ROUTE"),"danger"):c.wizard().next()}).error(function(a){e.show(g.instant(a.message),"danger")})},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/voice/extensions/",a.item).success(function(a){d.path("/voice/routes/internal/view/"+a.id+"/applications")}).error(function(a){e.show(g.instant(a.message),"danger")})},a.getContexts=function(){b.get("/api/voice/contexts").success(function(b){a.voiceContexts=b,f.syncUpdates("voice_context",a.voiceContexts)}).error(function(a){e.show(g.instant(a.message),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.routes.internal.wizard",{url:"/wizard",templateUrl:"app/voice/route/internal/wizard/wizard.html",controller:"VoiceRouteInternalWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteOutboundListCtrl",["$scope","$http","socket","$rootScope","$translate","xAlert","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={routesByPage:{name:"10",value:10}},a.routesByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.routes={checked:[]},a.check=function(b){b?a.routes.checked=angular.copy(_.pluck(a.displayedRoutes,"id")):a.routes.checked=[]},a.getRoutes=function(b){return _.map(a.displayedRoutes,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){c.unsyncUpdates("voice_extension"),b.url="/api/voice/extensions/route/outbound",h.getPage(b).then(function(c){a.displayedRoutes=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.routesByPage,a.displayedRoutes.length),d.updateTableConfig(a.conf.routesByPage,a.displayedRoutes.length)}),c.socket.on("voice_extension:save",function(c){"outbound"===c.type&&a.initList(b)}),c.socket.on("voice_extension:remove",function(c){"outbound"===c.type&&(a.routes.checked=_.without(a.routes.checked,c.id),a.initList(b))})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/voice/extensions/"+a).success(function(){f(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/voice/extensions/",{params:{id:a.routes.checked}}).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(e.instant(a.message),"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.routes.outbound.list",{url:"/list",templateUrl:"app/voice/route/outbound/list/list.html",controller:"VoiceRouteOutboundListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.routes.outbound",{url:"/outbound",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteOutboundViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$location","WizardHandler","Modal","application","interval",function(a,b,c,d,e,f,g,h,i,j,k){a.$translate=d,a.$application=j.application,a.$interval=k.interval,a.initApplication=function(){a.forms={info:void 0,interval:void 0},a.application={VoiceExtensionId:e.id,type:"outbound"},a.interval={intType:"always",t_from:moment(new Date),t_to:moment(new Date),wd_from:"always",wd_to:"always",md_from:"always",md_to:"always",m_from:"always",m_to:"always",alwaysTime:!0},a.main={app:""},a.applications=[{name:"Dial",value:"Dial"},{name:"Custom",value:"custom"}]},a.joinInterval=function(a){console.log(a);var b,c,d,e;return b=a.t_from&&a.t_to&&!a.alwaysTime?moment(a.t_from).format("HH:mm")+"-"+moment(a.t_to).format("HH:mm"):"*",a.wd_from&&"always"!==a.wd_from?(c=a.wd_from.toLowerCase(),a.wd_to&&"always"!==a.wd_to&&(c+="-"+a.wd_to.toLowerCase())):c="*",a.md_from&&"always"!==a.md_from?(d=a.md_from,a.md_to&&"always"!==a.md_to&&(d+="-"+a.md_to)):d="*",a.m_from&&"always"!==a.m_from?(e=a.m_from.toLowerCase(),a.m_to&&"always"!==a.m_to&&(e+="-"+a.m_to.toLowerCase())):e="*",b+","+c+","+d+","+e},a.$watch("main.app",function(c){if(c){var d,f;switch(e.appId||(a.application={VoiceExtensionId:e.id,type:"outbound",interval:a.application.interval}),c){case"Dial":d="api/trunks",f="/api/voice/contexts";break;default:d=null,f=null}d&&b.get(d).success(function(b){a.items="Dial"===c?b.rows:b}),f&&b.get(f).success(function(b){a.items2="Dial"===c?b.rows:b})}},!0),a.$watch("application.TrunkId",function(b){b&&(a.application.trunk=_.result(_.find(a.items,{id:b}),"name"))},!0),a.getIntervals=function(){b.get("/api/intervals").success(function(b){a.Intervals=b.rows,f.syncUpdates("interval",a.Intervals)}).error(function(a){c.show(d.instant(a.message),"danger")})},a.getRouteApplications=function(){b.get("/api/voice/extensions/"+e.id+"/applications").success(function(b){a.routeApplications=b,f.unsyncUpdates("voice_extension"),f.socket.on("voice_extension:remove",function(b){b.where.appGroup&&_.remove(a.routeApplications,function(a){return b.where.appGroup==a.appGroup})}),f.socket.on("voice_extension:save",function(b){if(b.VoiceExtensionId===e.id&&b.isApp){var c=_.find(a.routeApplications,{id:b.id});c||a.routeApplications.push(b)}})})},a.sortableOptions={stop:function(){b.post("api/voice/extensions/"+e.id+"/applications",{applications:_.pluck(a.routeApplications,"appGroup")}).success(function(){a.getRouteApplications()}).error(function(a){console.error(a)})},"ui-floating":!0},a.getRoute=function(){b.get("/api/voice/extensions/"+e.id).success(function(b){a.route=b,f.socket.on("voice_extension:update",function(b){b.id==e.id&&(a.route=b)})}).error(function(a){g.path("/voice/routes/outbound/list")})},a.getApplication=function(){b.get("/api/voice/extensions/applications/"+e.appId).success(function(b){var c=_.filter(a.applications,function(a){return a.value===b.app});if(c.length>0&&!b.customApp?a.main.app=b.app:a.main.app="custom",a.application=b,a.interval.intType=b.IntervalId?"list":"custom",a.interval.IntervalId=b.IntervalId,!b.IntervalId){var d,e=b.interval?b.interval.split(","):["*","*","*","*"];e.forEach(function(b,c){switch(c){case 0:"*"!==b?(d=b.split("-"),a.interval.t_from=moment(d[0],"HH:mm"),a.interval.t_to=moment(d[1],"HH:mm"),a.interval.alwaysTime=!1):(a.interval.t_from=moment(new Date),a.interval.t_to=moment(new Date),a.interval.alwaysTime=!0);break;case 1:"*"!==b?(d=b.split("-"),a.interval.wd_from=_.capitalize(d[0]),a.interval.wd_to=d[1]?_.capitalize(d[1]):"always"):(a.interval.wd_from="always",a.interval.wd_to="always");break;case 2:"*"!==b?(d=b.split("-"),a.interval.md_from=d[0],a.interval.md_to=d[1]?d[1]:"always"):(a.interval.md_from="always",a.interval.md_to="always");break;case 3:"*"!==b?(d=b.split("-"),a.interval.m_from=_.capitalize(d[0]),a.interval.m_to=d[1]?_.capitalize(d[1]):"always"):(a.interval.m_from="always",a.interval.m_to="always")}})}}).error(function(a){console.error(a),g.path("/voice/routes/outbound/view/"+e.id+"/routes")})},a.updateRoute=function(){var f=angular.copy(a.route);b.put("/api/voice/extensions/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.route=f})},a.getContexts=function(){b.get("/api/voice/contexts").success(function(b){a.voiceContexts=b.rows,f.syncUpdates("voice_context",a.voiceContexts)}).error(function(a){c.show(d.instant(a.message),"danger")})},a.createItem=function(){switch(a.application.app=a.main.app,a.application.exten=a.route.exten,a.application.context=a.route.context,a.interval.intType){case"list":a.application.IntervalId=a.interval.IntervalId,a.application.interval=_.result(_.find(a.Intervals,{id:a.interval.IntervalId}),"name");break;case"custom":a.application.IntervalId=null,a.application.interval=a.joinInterval(a.interval);break;case"always":a.application.IntervalId=null,a.application.interval="*,*,*,*"}b.post("/api/voice/extensions/",a.application).success(function(){g.path("/voice/routes/outbound/view/"+e.id+"/routes")}).error(function(a){c.show(d.instant(a.message),"danger")})},a.updateItem=function(){switch(a.interval.intType){case"list":a.application.IntervalId=a.interval.IntervalId,a.application.interval=_.result(_.find(a.Intervals,{id:a.interval.IntervalId}),"name");break;case"custom":a.application.IntervalId=null,a.application.interval=a.joinInterval(a.interval);break;case"always":a.application.IntervalId=null,a.application.interval="*,*,*,*"}b.put("/api/voice/extensions/applications/"+e.appId,a.application).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success"),g.path("/voice/routes/outbound/view/"+e.id+"/routes")}).error(function(a){c.show(d.instant(a.message),"danger")})},a.deleteItem=i.confirm["delete"](function(e){b["delete"]("/api/voice/extensions/"+e).success(function(b){a.getRouteApplications(),c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){c.show(d.instant(a.message),"danger")})}),a.goNext=function(){h.wizard().next()},a.previous=function(){h.wizard().previous()},a.formValidation=function(a){return a},a.$on("destroy",function(){f.unsyncUpdates("voice_extension")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.routes.outbound.view",{url:"/view/:id",templateUrl:"app/voice/route/outbound/view/view.html",controller:"VoiceRouteOutboundViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.voice.routes.outbound.view.settings",{url:"/settings",templateUrl:"app/voice/route/outbound/view/view.settings.html"}).state("main.voice.routes.outbound.view.routes",{url:"/routes",templateUrl:"app/voice/route/outbound/view/view.routes.html",cache:!1}).state("main.voice.routes.outbound.view.route",{url:"/route",templateUrl:"app/voice/route/outbound/view/view.route.html",authenticate:!0}).state("main.voice.routes.outbound.view.routes.settings",{url:"/settings/:appId",templateUrl:"app/voice/route/outbound/view/view.routeSettings.html",authenticate:!0,controller:"VoiceRouteOutboundViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteOutboundWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","socket","$translate",function(a,b,c,d,e,f,g){a.forms={route:void 0},a.item={type:"outbound",appdata:"Outbound Call",context:"from-sip"},a.next=function(){b.post("/api/voice/extensions/validate/",a.item).success(function(a){console.log(a),a.length?e.show(g.instant("MESSAGE_EXIST_ROUTE"),"danger"):c.wizard().next()}).error(function(a){e.show(g.instant(a.message),"danger")})},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/voice/extensions/",a.item).success(function(a){d.path("/voice/routes/outbound/view/"+a.id+"/routes")}).error(function(a){e.show(g.instant(a.message),"danger")})},a.getContexts=function(){b.get("/api/voice/contexts").success(function(b){a.voiceContexts=b,f.syncUpdates("voice_context",a.voiceContexts)}).error(function(a){e.show(g.instant(a.message),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.routes.outbound.wizard",{url:"/wizard",templateUrl:"app/voice/route/outbound/wizard/wizard.html",controller:"VoiceRouteOutboundWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.routes",{url:"/routes",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice",{url:"/voice",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceVoicemailListCtrl",["$scope","$http","$translate","$rootScope","xAlert","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={voicemailsByPage:{name:"10",value:10},labels:["mailbox","fullname","email"]},a.voicemailsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.voicemails={checked:[]},a.check=function(b,c){c?a.voicemails.checked=angular.copy(_.pluck(a.displayedVoicemails,"uniqueid")):a.voicemails.checked=[]},a.getVoicemails=function(b){return _.map(a.displayedVoicemails,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("voice_voicemail"),b.url="/api/voice/voicemails",h.getPage(b).then(function(c){a.displayedVoicemails=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.voicemailsByPage,a.displayedVoicemails.length),d.updateTableConfig(a.conf.voicemailsByPage,a.displayedVoicemails.length)}),f.socket.on("voice_voicemail:save",function(){a.initList(b)}),f.socket.on("voice_voicemail:remove",function(c){a.voicemails.checked=_.without(a.voicemails.checked,c.uniqueid),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/voice/voicemails/"+a).success(function(){e.show(c.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){e.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/voice/voicemails",{params:{uniqueid:a.voicemails.checked}}).success(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){e.show(c.instant(a.message),"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.voicemails.list",{url:"/list",templateUrl:"app/voice/voicemail/list/list.html",controller:"VoiceVoicemailListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceVoicemailViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$sce","Modal","$location",function(a,b,c,d,e,f,g,h,i){a.getVoicemail=function(){b.get("/api/voice/voicemails/"+e.uniqueid).success(function(b){delete b.password,delete b.stamp,a.voicemail=b}).error(function(a){console.error(a),i.path("/voice/voicemails/list")})},a.updateVoiceVoicemail=function(){var f=angular.copy(a.voicemail);b.put("/api/voice/voicemails/"+e.uniqueid,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.voicemail=f})},a.getContexts=function(){b.get("/api/voice/contexts").success(function(b){a.voiceContexts=b.rows,f.syncUpdates("voice_context",a.voiceContexts)}).error(function(a){c.show(a.message,"danger")})},a.getMessages=function(){b.get("/api/voice/voicemails/"+e.uniqueid+"/messages/").success(function(b){a.voicemailMessages=b,f.syncUpdates("voice_voicemail_messages",a.voicemailMessages)}).error(function(a){c.show(a.message,"danger")})},a.encodeRecording=function(a){return g.trustAsResourceUrl("data:audio/ogg;base64,"+j(a.data))},a.returnMessageDate=function(a){return a.split("T")[0]},a.returnDuration=function(a){return 1e3*a},a.deleteItem=h.confirm["delete"](function(a){b["delete"]("/api/voice/voicemails/messages/"+a+"/delete").success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){console.log(a),c.show(a.message,"danger")})});var j=function(a){for(var b=new Uint8Array(a),c=b.byteLength,d="",e=0;c>e;e++)d+=String.fromCharCode(b[e]);return window.btoa(d)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.voicemails.view",{url:"/view/:uniqueid",templateUrl:"app/voice/voicemail/view/view.html",controller:"VoiceVoicemailViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.voice.voicemails.view.settings",{url:"/settings",templateUrl:"app/voice/voicemail/view/view.settings.html"}).state("main.voice.voicemails.view.messages",{url:"/messages",templateUrl:"app/voice/voicemail/view/view.messages.html"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.voicemails",{url:"/voicemails",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceVoicemailWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","socket","$translate",function(a,b,c,d,e,f,g){a.initWizard=function(){a.forms={},a.item={}},a.next=function(){b.post("/api/voice/voicemails/validate/",a.item).success(function(a){a.length?e.show(g.instant("MESSAGE_EXIST_MAILBOX"),"danger"):c.wizard().next()}).error(function(a){e.show(a.message,"danger")})},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){a.item.customer_id=a.item.mailbox,b.post("/api/voice/voicemails/",a.item).success(function(){d.path("/voice/voicemails/list")}).error(function(a){e.show(a.message,"danger")})},a.getContexts=function(){b.get("/api/voice/contexts").success(function(b){a.voiceContexts=b.rows,f.syncUpdates("voice_context",a.voiceContexts)}).error(function(a){e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.voice.voicemails.wizard",{url:"/wizard",templateUrl:"app/voice/voicemail/wizard/wizard.html",controller:"VoiceVoicemailWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("YourdashboardListCreateModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.ok=function(){a.item.model=JSON.stringify({title:a.item.name}),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("YourdashboardListCtrl",["$scope","$http","socket","$rootScope","$translate","xAlert","Modal","stResource","$uibModal","$log",function(a,b,c,d,e,f,g,h,i,j){a.conf={dashboardsByPage:{name:"10",value:10}},a.dashboardsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.dashboards={checked:[]},a.check=function(b,c){c?a.dashboards.checked=angular.copy(_.pluck(a.displayedDashboards,"id")):a.dashboards.checked=[]},a.getDashboards=function(b){return _.map(a.displayedDashboards,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){b.url="/api/dashboards",h.getPage(b).then(function(c){a.displayedDashboards=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.dashboardsByPage,a.displayedDashboards.length),d.updateTableConfig(a.conf.dashboardsByPage,a.displayedDashboards.length)}),c.socket.on("dashboard:save",function(){a.initList(b)}),c.socket.on("dashboard:remove",function(c){a.dashboards.checked=_.without(a.dashboards.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/dashboards/"+a).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/dashboards",{params:{id:a.dashboards.checked}}).success(function(){f.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}),a.create=function(){var a=i.open({animation:!0,templateUrl:"app/yourdashboard/list/create.modal.html",controller:"YourdashboardListCreateModalCtrl"});a.result.then(function(a){b.post("/api/dashboards",a).then(function(a){f.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.data.message,"danger")})},function(){j.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.yourdashboards.list",{url:"/list",templateUrl:"app/yourdashboard/list/list.html",controller:"YourdashboardListCtrl"})}]),angular.module("xCallyShuttleApp").controller("YourdashboardShowCtrl",["$scope","localStorageService","$http","xAlert","$translate","Auth","$stateParams","$location",function(a,b,c,d,e,f,g,h){a.Auth=f,a.dashboard={name:"dashboard",structure:"4-8",enableconfirmdelete:!0,editable:f.isAdmin()?!0:!1,maximizable:!0,collapsible:!0},a.getDashboard=function(){c.get("/api/dashboards/"+g.id).success(function(b){b.model=JSON.parse(b.model),a.dashboard=_.merge(a.dashboard,b)}).error(function(a){h.path("/yourdashboards/list");
})};var i=function(b,f,h){var i=angular.copy(a.dashboard);i.name=a.dashboard.model.title,i.model=JSON.stringify(i.model),c.put("/api/dashboards/"+g.id,i).success(function(){d.show(e.instant("MESSAGE_DASHBOARD_SAVED")+"!","success")}).error(function(b){d.show(b.message,"danger"),i.model=JSON.parse(i.model),i.name="dashboard",a.dashboard=i})};a.$on("adfDashboardChanged",i),a.$on("destroy",function(){console.log("main dashboard")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.yourdashboards.show",{url:"/show/:id",templateUrl:"app/yourdashboard/show/show.html",controller:"YourdashboardShowCtrl"})}]),angular.module("xCallyShuttleApp").controller("YourdashboardViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.radioSwitch={isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.getDashboard=function(){b.get("/api/dashboards/"+e.id).success(function(b){delete b.model,a.dashboard=b}).error(function(a){f.path("/yourdashboards/list")})},a.updateDashboard=function(){var f=angular.copy(a.dashboard);b.put("/api/dashboards/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.dashboard=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.yourdashboards.view",{url:"/view/:id",templateUrl:"app/yourdashboard/view/view.html",controller:"YourdashboardViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.yourdashboards.view.settings",{url:"/settings",templateUrl:"app/yourdashboard/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.yourdashboards",{url:"/yourdashboards",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ZendeskListCtrl",["$scope","$http","$rootScope","xAlert","$translate","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={accountsByPage:{name:"10",value:10}},a.accountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.accounts={checked:[]},a.check=function(b,c){c?a.accounts.checked=angular.copy(_.pluck(a.displayedZdAccounts,"id")):a.accounts.checked=[]},a.getAccounts=function(b){return _.map(a.displayedZdAccounts,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("zendesk_account"),b.url="/api/zendesk/accounts",h.getPage(b).then(function(d){a.displayedZdAccounts=d.rows,b.pagination.numberOfPages=d.total_pages,c.updateTableConfig(a.accountsByPage,a.displayedZdAccounts.length),c.updateTableConfig(a.conf.accountsByPage,a.displayedZdAccounts.length)}),f.socket.on("zendesk_account:save",function(){a.initList(b)}),f.socket.on("zendesk_account:remove",function(c){a.accounts.checked=_.without(a.accounts.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/zendesk/accounts/"+a).success(function(){d.show(e.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/zendesk/accounts",{params:{id:a.accounts.checked}}).success(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.checkAccount=function(a){b.get("/api/zendesk/accounts/"+a+"/check").then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.list",{url:"/list",templateUrl:"app/zendesk/list/list.html",controller:"ZendeskListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("ZendeskViewCtrl",["$scope","$http","$stateParams","$translate","$location","WizardHandler","socket","xAlert","Modal",function(a,b,c,d,e,f,g,h,i){a.$stateParams=c,a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:500,scrollInertia:0},a.initConfiguration=function(){a.formsConfiguration={},a.configuration={}},a.goNext=function(){f.wizard().next()},a.formValidation=function(a){return a},a.$on("$destroy",function(){g.unsyncUpdates("zendesk_configuration"),g.unsyncUpdates("zendesk_field")}),a.initView=function(){b.get("/api/zendesk/accounts/"+c.id).success(function(b){a.account=b}).error(function(a){h.show(a.message,"danger")})},a.updateItem=function(){b.put("/api/zendesk/accounts/"+c.id,a.account).success(function(){h.show(d.instant("MESSAGE_WELL_DONE")+".","success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getConfigurations=function(){b.get("/api/zendesk/configurations",{params:{ZendeskAccountId:c.id}}).success(function(b){a.configurations=b,g.socket.on("zendesk_configuration:remove",function(b){_.remove(a.configurations,{id:b.id})})}).error(function(a){h.show(a.message,"danger")})},a.deleteConfiguration=i.confirm["delete"](function(a){b["delete"]("api/zendesk/configurations/"+a).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.createConfiguration=function(){a.configuration.ZendeskAccountId=c.id,b.post("api/zendesk/configurations",a.configuration).success(function(a){e.path("zendesk/view/"+c.id+"/configurations/settings/"+a.id)}).error(function(){h.show("Something went wrong!","danger")})},a.fieldType=["string","variable"],a.descFieldType=["string","key_value"],a.getFields=function(){b.get("/api/zendesk/accounts/"+c.id+"/fields").success(function(b){_.remove(b,function(a){return"subject"===a.type||"description"===a.type||"assignee"===a.type}),a.accountFields=b}).error(function(a){h.show(a.message,"danger")})},a.getConfiguration=function(){b.get("/api/zendesk/configurations/"+c.configurationId).success(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,g.socket.on("zendesk_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})}).error(function(a){h.show(a.message,"danger")})},a.getVariables=function(){b.get("/api/variables").success(function(b){a.variables=b.rows}).error(function(a){h.show(a.message,"danger")})},a.removeItem=function(a){b["delete"]("api/zendesk/fields/"+a.id).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.addItemSubject=function(){var d={type:"string",content:""};b.post("/api/zendesk/configurations/"+c.configurationId+"/subject",d).success(function(b){a.subjectConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemDescription=function(){var d={type:"string",content:""};b.post("/api/zendesk/configurations/"+c.configurationId+"/description",d).success(function(b){a.descriptionConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemDescription=function(){var d={type:"string",content:""};b.post("/api/zendesk/configurations/"+c.configurationId+"/description",d).success(function(b){a.descriptionConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemField=function(){var d={content:""};b.post("/api/zendesk/configurations/"+c.configurationId+"/field",d).success(function(b){a.fieldConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.updateField=function(a){b.put("/api/zendesk/fields/"+a.id,a).success(function(){}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.changeType=function(b){"variable"===b.type?b.content="":"string"===b.type&&(b.VariableId=null),a.updateField(b)},a.changeDescType=function(b){"key_value"===b.type?(b.content="","string"===b.keyType?b.VariableId=null:"variable"===b.keyType&&(b.keyContent="")):"string"===b.type&&(b.VariableId=null,b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){b.content="",a.updateField(b)},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"id",b);return c?c.system_field_options?c.system_field_options:null:void 0}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.view",{url:"/view/:id",templateUrl:"app/zendesk/view/view.html",controller:"ZendeskViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.zendesk.view.account",{url:"/account",templateUrl:"app/zendesk/view/view.account.html"}).state("main.zendesk.view.configurations",{url:"/configurations",templateUrl:"app/zendesk/view/view.configurations.html"}).state("main.zendesk.view.configurations.settings",{url:"/settings/:configurationId",templateUrl:"app/zendesk/view/view.configurationSettings.html",controller:"ZendeskViewCtrl"}).state("main.zendesk.view.configuration",{url:"/configuration",templateUrl:"app/zendesk/view/view.configuration.html"})}]),angular.module("xCallyShuttleApp").controller("ZendeskWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={},a.item.authType="password"},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("api/zendesk/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/zendesk/list")}).error(function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.wizard",{url:"/wizard",templateUrl:"app/zendesk/wizard/wizard.html",controller:"ZendeskWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk",{url:"/zendesk",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").service("application",function(){var a={applications:[{name:"Queue",value:"Queue"},{name:"Playback",value:"Playback"},{name:"Dial",value:"Dial"},{name:"Cally-Square IVR",value:"AGI"},{name:"GoTo",value:"Goto"},{name:"Hangup",value:"Hangup"},{name:"Set",value:"Set"},{name:"Custom",value:"custom"},{name:"VoiceMail",value:"Voicemail"}],queueOptions:[{value:"C",name:"APPLICATION_QUEUE_OPTION_C"},{value:"c",name:"APPLICATION_QUEUE_OPTION_c"},{value:"d",name:"APPLICATION_QUEUE_OPTION_d"},{value:"F",name:"APPLICATION_QUEUE_OPTION_F"},{value:"h",name:"APPLICATION_QUEUE_OPTION_h"},{value:"H",name:"APPLICATION_QUEUE_OPTION_H"},{value:"n",name:"APPLICATION_QUEUE_OPTION_n"},{value:"i",name:"APPLICATION_QUEUE_OPTION_i"},{value:"I",name:"APPLICATION_QUEUE_OPTION_I"},{value:"r",name:"APPLICATION_QUEUE_OPTION_r"},{value:"R",name:"APPLICATION_QUEUE_OPTION_R"},{value:"t",name:"APPLICATION_QUEUE_OPTION_t"},{value:"T",name:"APPLICATION_QUEUE_OPTION_T"},{value:"w",name:"APPLICATION_QUEUE_OPTION_w"},{value:"W",name:"APPLICATION_QUEUE_OPTION_W"},{value:"k",name:"APPLICATION_QUEUE_OPTION_k"},{value:"K",name:"APPLICATION_QUEUE_OPTION_K"},{value:"x",name:"APPLICATION_QUEUE_OPTION_x"},{value:"X",name:"APPLICATION_QUEUE_OPTION_X"}],audioOptions:[{value:"skip",name:"APPLICATION_PLAYBACK_OPTION_SKIP"},{value:"noanswer",name:"APPLICATION_PLAYBACK_OPTION_NOANSWER"},{value:"j",name:"APPLICATION_PLAYBACK_OPTION_J"},{value:"say",name:"APPLICATION_PLAYBACK_OPTION_SAY"}],hangupCauses:[{value:"",name:"--"},{value:"1",name:"APPLICATION_HANGUP_CAUSE_1"},{value:"16",name:"APPLICATION_HANGUP_CAUSE_16"},{value:"17",name:"APPLICATION_HANGUP_CAUSE_17"},{value:"18",name:"APPLICATION_HANGUP_CAUSE_18"},{value:"21",name:"APPLICATION_HANGUP_CAUSE_21"},{value:"22",name:"APPLICATION_HANGUP_CAUSE_22"},{value:"27",name:"APPLICATION_HANGUP_CAUSE_27"},{value:"38",name:"APPLICATION_HANGUP_CAUSE_38"},{value:"41",name:"APPLICATION_HANGUP_CAUSE_41"}],intTypes:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"custom",name:"APPLICATION_CUSTOM"},{value:"list",name:"APPLICATION_FROM_LIST"}]};return{application:a}}),angular.module("xCallyShuttleApp").factory("Auth",["$location","$rootScope","$http","User","$cookieStore","$q",function(a,b,c,d,e,f){var g={};return e.get("token")&&(g=d.me()),{login:function(a,h){var i=h||angular.noop,j=f.defer();return c.post("/auth/local",{name:a.name,password:a.password,remember:a.remember}).success(function(a){return e.put("token",a.token),e.put("userId",a.userId),g=d.me({},function(){b.$broadcast("login")}),j.resolve(a),i()}).error(function(a){return this.logout(),j.reject(a),i(a)}.bind(this)),j.promise},loginWithToken:function(a,b,c){e.put("token",a),e.put("userId",b),e.put("name",c),g=d.me()},logout:function(){c.put("/api/users/"+g.id,{online:!1}).success(function(){e.remove("token"),e.remove("userId"),g={},b.$broadcast("logout")}).error(function(a){return a})},createUser:function(a,b){var c=b||angular.noop;return d.save(a,function(b){return e.put("token",b.token),g=d.me(),c(a)},function(a){return this.logout(),c(a)}.bind(this)).$promise},changePassword:function(a,b,c){var e=c||angular.noop;return d.changePassword({id:g.id},{oldPassword:a,newPassword:b},function(a){return e(null,a)},function(a){return e(a)}).$promise},getCurrentUser:function(){return g},isLoggedIn:function(){return g.hasOwnProperty("role")},isLoggedInAsync:function(a){g.hasOwnProperty("$promise")?g.$promise.then(function(){a(!0)})["catch"](function(){a(!1)}):a(g.hasOwnProperty("role")?!0:!1)},isAdmin:function(){return"admin"===g.role},getRole:function(){return g.role},getToken:function(){return e.get("token")},getUserId:function(){return console.log(e.get("userId")),e.get("userId")},getName:function(){return e.get("name")}}}]),angular.module("xCallyShuttleApp").factory("User",["$resource",function(a){return a("/api/users/:id/:controller",{id:"@id"},{changePassword:{method:"PUT",params:{controller:"password"}},me:{method:"GET",params:{id:"me"}}})}]),angular.module("xCallyShuttleApp").service("automations",function(){var a={voice:{conditions:[],actions:[]},mail:{conditions:[{name:"APPLICATION_STATUS",value:"status",propertyField:"select",operators:"equals"},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",propertyField:"number",operators:"noequals"}],actions:[{name:"APPLICATION_STATUS",value:"status",propertyField:"select"}]},chat:{conditions:[],actions:[]},fax:{conditions:[{name:"APPLICATION_STATUS",value:"status",propertyField:"select",operators:"equals"},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",propertyField:"number",operators:"noequals"}],actions:[{name:"APPLICATION_STATUS",value:"status",propertyField:"select"}]}},b=["voice","mail","chat","fax"],c={equals:[{value:"=",name:"APPLICATION_EQUALS_TO"},{value:"<>",name:"APPLICATION_NOT_EQUALS_TO"}],all:[{value:"=",name:"APPLICATION_EQUALS_TO"},{value:"<>",name:"APPLICATION_NOT_EQUALS_TO"},{value:">=",name:"APPLICATION_GTE_TO"},{value:"<=",name:"APPLICATION_LTE_TO"},{value:">",name:"APPLICATION_GREATER_THAN"},{value:"<",name:"APPLICATION_LESS_THAN"}],noequals:[{value:">=",name:"APPLICATION_GTE_TO"},{value:"<=",name:"APPLICATION_LTE_TO"},{value:">",name:"APPLICATION_GREATER_THAN"},{value:"<",name:"APPLICATION_LESS_THAN"}]},d={voice:{},mail:{status:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_PENDING",value:"PENDING"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"},{name:"APPLICATION_STATUS_SOLVED",value:"SOLVED"}]},chat:{},fax:{status:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_PENDING",value:"PENDING"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"},{name:"APPLICATION_STATUS_SOLVED",value:"SOLVED"}]}};return{automations:a,properties:d,channels:b,operators:c}}),angular.module("xCallyShuttleApp").service("desk_com",function(){var a=[{id:"priority",label:"Priority",custom:!1,data:{choices:[1,2,3,4,5,6,7,8,9,10]}},{id:"status",label:"Status",custom:!1,data:{choices:["new","open","pending","resolved","closed"]}},{id:"type",label:"Type",custom:!1,data:{choices:["chat","twitter","email","qna","facebook","phone"]}}];return{fields:a}}),angular.module("xCallyShuttleApp").controller("FooterController",["$scope","$http",function(a,b){a.$on("$includeContentLoaded",function(){Layout.initFooter()}),a.initFooter=function(){b.get("/api/settings/info").success(function(b){a.info=b}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("HeaderController",["$scope","$rootScope","$location","$state","$http","$notification","Auth","xAlert","socket","ngAudio","settings","toastr","localStorageService",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.toggleQuickSidebar=function(){k.layout.pageQuickSidebarOpened=!k.layout.pageQuickSidebarOpened,k.layout.pageQuickSidebarOpened||m.remove("chatRoomId")},a.initHeader=function(){var c=j.load("api/xchatty/assets?resource=notification/xc_blubb.mp3");"agent"===g.getCurrentUser().role&&(i.socket.on("report_mail:save",function(a){c.play();var b=f("MAIL CHANNEL",{icon:"assets/images/media/channels/mail64.png",body:"NEW Incoming Mail Message!",delay:1e3*a.timeslot});b.$on("click",function(){e.put("/api/report/mails/"+a.id,{connect:!0}).success(function(){b.close(),h.show("Mail properly assigned","success")}).error(function(a){h.show(a.message,"danger")})})}),i.socket.on("report_chat:save",function(a){c.play();var d=f("CHAT CHANNEL",{icon:"assets/images/media/channels/chat64.png",body:"NEW Incoming Chat Visitor!",delay:1e3*a.timeslot});d.$on("click",function(){e.put("/api/report/chats/"+a.id,{connect:!0}).success(function(){d.close(),h.show("Chat properly assigned","success"),b.$broadcast("chatMessageEvent",{type:"external",chatRoomId:a.chatroomid})}).error(function(a){h.show(a.message,"danger")})})}),i.socket.on("chat_message:save",function(a){console.log("data",a);var d=m.get("chatRoomId");if(!d||d!==a.ChatRoomId){c.play();var e=f(a.User.fullname,{icon:"assets/images/media/channels/chat64.png",body:a.body.length>35?a.body.substring(0,35)+"...":a.body,delay:1e4});e.$on("click",function(){b.$broadcast("chatMessageEvent",{type:"internal",chatRoomId:a.ChatRoomId})})}})),e({url:"/api/fax/user_has_queues",method:"GET",params:{UserId:g.getCurrentUser().id}}).success(function(b){a.faxQueues=_.pluck(b,"FaxQueueId"),a.faxQueues.forEach(function(a){i.socket.on("FAX:QUEUE:"+a,function(a,b){var c=f("FAX CHANNEL",{icon:"assets/images/media/channels/telephone124.png",body:"NEW Incoming Fax Message!",delay:1e3*a.timeout});c.$on("click",function(){e.put("/api/fax/rooms/"+a.roomId,{UserId:g.getCurrentUser().id}).success(function(){c.close(),b(g.getCurrentUser().id),l.success("Fax properly assigned","Success",{closeButton:!0,timeOut:5e3})}).error(function(){l.warning("Fax already assigned","Warning",{closeButton:!0,timeOut:5e3})})})})}),i.socket.on("FAX:AGENT:"+g.getCurrentUser().id,function(a,b){var c=f("FAX CHANNEL",{icon:"assets/images/media/channels/telephone124.png",body:"NEW Incoming Fax Message!",delay:1e3*a.timeout});c.$on("click",function(){e.put("/api/fax/rooms/"+a.roomId,{UserId:g.getCurrentUser().id}).success(function(){c.close(),b(g.getCurrentUser().id),l.success("Fax properly assigned","Success",{closeButton:!0,timeOut:5e3})}).error(function(){b(g.getCurrentUser().id),l.warning("Fax already assigned","Warning",{closeButton:!0,timeOut:5e3})})})})}).error(function(a){console.error(a)}),i.socket.on("user_has_fax_queue:save",function(b){b=_.map(b,function(a){return a.UserId=parseInt(a.UserId,10),a}),b=_.find(b,{UserId:g.getCurrentUser().id}),b&&-1===_.indexOf(a.faxQueues,b.FaxQueueId)&&(a.faxQueues.push(b.FaxQueueId),i.socket.on("FAX:QUEUE:"+b.FaxQueueId,function(a,b){var c=f("FAX CHANNEL",{icon:"assets/images/media/channels/telephone124.png",body:"NEW Incoming Fax Message!",delay:1e3*a.timeout});c.$on("click",function(){e.put("/api/fax/rooms/"+a.roomId,{UserId:g.getCurrentUser().id}).success(function(){c.close(),b(g.getCurrentUser().id),l.success("Fax properly assigned","Success",{closeButton:!0,timeOut:5e3})}).error(function(){b(g.getCurrentUser().id),l.warning("Fax already assigned","Warning",{closeButton:!0,timeOut:5e3})})})}))}),i.socket.on("user_has_fax_queue:remove",function(b){_.indexOf(b.where.UserId,g.getCurrentUser().id.toString())>=0&&_.indexOf(a.faxQueues,b.where.FaxQueueId)>=0&&(a.faxQueues=_.remove(a.faxQueues,b.where.FaxQueueId),i.socket.removeAllListeners("FAX:QUEUE:"+b.where.FaxQueueId))})},a.logout=function(){e.get("/auth/local/logout").success(function(){g.logout(),c.path("/login")}).error(function(a){console.error(a)})},a.isActive=function(a){return a===c.path()}}]),angular.module("xCallyShuttleApp").service("interval",function(){var a={months:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"jan",name:"APPLICATION_JANUARY"},{value:"feb",name:"APPLICATION_FEBRUARY"},{value:"mar",name:"APPLICATION_MARCH"},{value:"apr",name:"APPLICATION_APRIL"},{value:"may",name:"APPLICATION_MAY"},{value:"jun",name:"APPLICATION_JUNE"},{value:"jul",name:"APPLICATION_JULY"},{value:"aug",name:"APPLICATION_AUGUST"},{value:"sep",name:"APPLICATION_SEPTEMBER"},{value:"oct",name:"APPLICATION_OCTOBER"},{value:"nov",name:"APPLICATION_NOVEMBER"},{value:"dec",name:"APPLICATION_DECEMBER"}],daysOfWeek:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"mon",name:"APPLICATION_MONDAY"},{value:"tue",name:"APPLICATION_TUESDAY"},{value:"wed",name:"APPLICATION_WEDNESDAY"},{value:"thu",name:"APPLICATION_THURSDAY"},{value:"fri",name:"APPLICATION_FRIDAY"},{value:"sat",name:"APPLICATION_SATURDAY"},{value:"sun",name:"APPLICATION_SUNDAY"}],daysOfMonth:["always",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]};return{interval:a}}),angular.module("xCallyShuttleApp").factory("Modal",["$rootScope","$uibModal",function(a,b){function c(c,d){console.log("openModal",d);var e=a.$new();return c=c||{},d=d||"modal-default",angular.extend(e,c),b.open({templateUrl:"components/modal/delete.html",windowClass:d,scope:e})}return{confirm:{"delete":function(a){return a=a||angular.noop,function(){var b,d=Array.prototype.slice.call(arguments),e=d.shift();b=c({modal:{dismissable:!0,title:"Confirm Delete",html:"<p>Are you sure you want to delete"+(e?"<strong> "+e+"</strong>":" selected items")+"?</p>",buttons:[{classes:"btn red",text:"Delete",click:function(a){b.close(a)}},{classes:"btn default",text:"Cancel",click:function(a){b.dismiss(a)}}]}},"over-topbar center"),b.result.then(function(b){a.apply(b,d)})}}}}}]),angular.module("xCallyShuttleApp").controller("QuickSidebarControllerAddModal",["$scope","$uibModalInstance","Agent","items",function(a,b,c,d){a.items=d,a.agents=c.get(function(b){a.agents=b,a.items.forEach(function(b){_.remove(a.agents.rows,{id:b.id})})}),a.selected={items:[]},a.modal={title:"APPLICATION_AGENTS_SELECTION"},a.ok=function(){b.close(_.union(_.pluck(a.selected.items,"id"),_.pluck(a.items,"id")))},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").controller("QuickSidebarControllerCloseModal",["$scope","$uibModalInstance",function(a,b){a.modal={title:"APPLICATION_CONFIRM_CLOSE",text:"MESSAGE_ARE_YOU_SURE_YOU_WANT_TO_CLOSE_THE_CHAT"},a.ok=function(){b.close()},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").controller("QuickSidebarController",["$scope","$rootScope","$window","$http","$uibModal","$log","$timeout","$notification","$interval","Auth","Agent","User","ChatRoom","ChatMessage","socket","settings","localStorageService","xAlert","$translate","QuickSidebarFactory",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){a.emojiMessage={},a.options=t.options,a.message={body:"",user:""};var u=a.currentUser=j.getCurrentUser();a.$on("$includeContentLoaded",function(){q.get("chatRoomId")&&m.get({id:q.get("chatRoomId")},v,w),q.get("currentTab")&&(a.currentTab=q.get("currentTab"))}),a.agents=k.get({page:0,per_page:1e3},function(){o.syncUpdates("agent",a.agents.rows)}),a.users=l.get({page:0,per_page:1e3},function(){o.syncUpdates("user",a.users.rows)}),a.chatRooms=m.me(function(b){a.chatRooms=b,o.syncUpdates("chat_room",a.chatRooms)},function(a){console.error(a)}),a.currentTab=0,a.messagesTab=!1,o.socket.on("chat_message:save",function(b){console.log("chatMessage",b),a.chatRoom&&a.chatRoom.id===b.ChatRoomId&&(a.chatRoom.ChatMessages.push(b),angular.element("page-quick-sidebar-chat-user-messages").mCustomScrollbar("scrollTo","last"))}),b.$on("chatMessageEvent",function(b,c){switch(c.type){case"internal":a.currentTab=0;break;case"external":a.currentTab=2}m.get({id:c.chatRoomId},v,w)}),a.goToTab=function(b){a.currentTab=b,a.messagesTab=!1,a.chatRoom=null,q.set("currentTab",a.currentTab),q.set("messagesTab",a.messagesTab),q.remove("chatRoomId")},a.goToMessage=function(a,b){a?m.users({users:[u.id,a]},v,w):(console.log("chatRoomId"),m.get({id:b},v,w))},a.sendMessage=function(){a.message.body.trim().length&&n.save({ChatRoomId:a.chatRoom.id,body:a.message.body},function(){a.message.body=""},function(a){console.error(a)})},a.goBack=function(){a.messagesTab=!1,a.chatRoom=null,q.set("messagesTab",a.messagesTab),q.remove("chatRoomId")},a.chatRoomsGroupsGreaterThan=function(a){return function(b){return b.Users?"external"!==b.type&&b.Users.length>a:!1}},a.closeChatRoom=function(a,b){var c=e.open({animation:!0,size:b,templateUrl:"components/quickSidebar/modal/close.html",controller:"QuickSidebarControllerCloseModal"});c.result.then(function(){m.update({id:a,status:"close"}).$promise.then(function(){r.show(s.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){r.show(a.data.message,"danger")})},function(){f.info("Modal dismissed at: "+new Date)})},a.addAgent=function(b,c){var g=e.open({animation:!0,size:c,templateUrl:"components/quickSidebar/modal/add.html",controller:"QuickSidebarControllerAddModal",resolve:{items:function(){return _.map(a.chatRoom.Users?a.chatRoom.Users:[],function(a){return{id:a.id,fullname:a.fullname}})}}});g.result.then(function(c){d.put("/api/chat/rooms/"+b+"/users",{users:c}).then(function(b){a.chatRoom=b.data,a.currentTab=3,a.messagesTab=!0;var c=_.find(a.chatRooms,{id:b.id}),d=a.chatRooms.indexOf(c);c?_.merge(a.chatRooms[d],b.data):a.chatRooms.push(b.data),o.socket.on("chat_message:save",function(c){console.log("chatMessage",c),c.ChatRoomId===b.data.id&&(a.chatRoom.ChatMessages.push(c),angular.element("page-quick-sidebar-chat-user-messages").mCustomScrollbar("scrollTo","last"))}),r.show(s.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){r.show(a.data.message,"danger")})},function(){f.info("Modal dismissed at: "+new Date)})};var v=function(b){console.log("chatRoom",b),console.log("chatRoom",a.chatRooms),a.messagesTab=!0,p.layout.pageQuickSidebarOpened=!0,q.set("chatRoomId",b.id),q.set("messagesTab",a.messagesTab),a.chatRoom=b,g(function(){angular.element("page-quick-sidebar-chat-user-messages").mCustomScrollbar("scrollTo","last")},1500)},w=function(a){console.error(a)},x=function(){var b=angular.element(c),d=function(){return{h:b.height(),w:b.width()}};a.$watch(d,function(b){a.style={height:b.h-46-46-46+"px"},a.style2={height:b.h-46-46-46-180+"px"}},!0),b.bind("resize",function(){a.$apply()})};x(),a.$on("$destroy",function(){o.unsyncUpdates("agent"),o.unsyncUpdates("user")})}]),angular.module("xCallyShuttleApp").directive("resizeQuickSidebar",["$window",function(a){return function(b){var c=angular.element(a);b.getWindowDimensions=function(){return{h:c.height(),w:c.width()}},b.$watch(b.getWindowDimensions,function(a){b.style={height:a.h-46-46-46+"px"}},!0),c.bind("resize",function(){b.$apply()})}}]),angular.module("xCallyShuttleApp").factory("QuickSidebarFactory",["$window",function(a){return{options:{link:!0,linkTarget:"_blank",pdf:{embed:!1},image:{embed:!0},audio:{embed:!0},code:{highlight:!0,lineNumbers:!1},basicVideo:!1,video:{embed:!1,width:null,height:null,ytTheme:"dark",details:!1,ytAuthKey:"_nkO9h1A7HlVyiUICO17oA"}}}}]),angular.module("xCallyShuttleApp").filter("salesforce",function(){var a=["CallDisposition","CallDurationInSeconds","CallObject","CallType","IsArchived","Priority","Status","Type"];return function(b){return _.remove(b,function(b){return b.custom===!1&&a.indexOf(b.name)<0}),b}}),angular.module("xCallyShuttleApp").controller("SidebarController",["$scope","$rootScope","$resource","$location","Auth","$http","xAlert","$stateParams","socket",function(a,b,c,d,e,f,g,h,i){a.Auth=e,a.$stateParams=h,a.$on("$includeContentLoaded",function(){Metronic.init(),Layout.initSidebar()}),a.isAssociated=function(a){if(e.isAdmin())return!0;if(e.getCurrentUser().Modules)for(var b=0;b<e.getCurrentUser().Modules.length;b++)if(e.getCurrentUser().Modules[b].name===a)return!0;return!1},a.getSidebarDashboards=function(){f.get("/api/dashboards").then(function(b){a.dashboards=b.data.rows,i.syncUpdates("dashboard",a.dashboards)})["catch"](function(a){g.show("Error loading your dashboards","danger")})},a.isActive=function(a){return a===d.path()},a.$on("destroy",function(){i.unsyncUpdates("dashboard")})}]),angular.module("xCallyShuttleApp").factory("socket",["$rootScope","socketFactory","Auth",function(a,b,c){var d=c.getCurrentUser(),e=io("",{query:"token="+c.getToken()+"&userId="+(d.id||c.getUserId())+"&name="+(d.name||c.getName())+"&role="+(d.role||"agent")+"&source=browser",path:"/socket.io-client"}),f=b({ioSocket:e});return a.$on("login",function(){e=io("",{forceNew:!0,query:"token="+c.getToken()+"&userId="+c.getCurrentUser().id+"&name="+c.getCurrentUser().name+"&role="+c.getCurrentUser().role+"&source=browser",path:"/socket.io-client"})}),a.$on("logout",function(){f&&f.disconnect(!0)}),{socket:f,syncUpdates:function(a,b,c){c=c||angular.noop,f.on(a+":save",function(a){var d=_.find(b,{id:a.id}),e=b.indexOf(d),f="created";d?(_.merge(b[e],a),f="updated"):b.unshift(a),c(f,a,b)}),f.on(a+":remove",function(a){var d="deleted";_.remove(b,{id:a.id}),c(d,a,b)})},unsyncUpdates:function(a){f.removeAllListeners(a+":save"),f.removeAllListeners(a+":remove")},syncUpdatesByAttributes:function(a,b,c,d){d=d||angular.noop,f.on(a+":save",function(a){var e=!0;if(_.forIn(b,function(b,c){return a[c]&&a[c]===b?!0:e=!1}),e){var f=_.find(c,{id:a.id}),g=c.indexOf(f),h="created";f?(_.merge(c[g],a),h="updated"):c.unshift(a),d(h,a,c)}}),f.on(a+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},syncMailMessageUpdates:function(a,b,c,d){d=d||angular.noop,f.on(a+":"+b+":save",function(a){var b=_.find(c,{id:a.id}),e=c.indexOf(b),f="created";b?(_.merge(c[e],a),f="updated"):c.unshift(a),d(f,a)}),f.on(a+":"+b+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},unsyncMailMessageUpdates:function(a,b){f.removeAllListeners(a+":"+b+":save"),f.removeAllListeners(a+":"+b+":remove")},syncFaxMessageUpdates:function(a,b,c,d){d=d||angular.noop,f.on(a+":"+b+":save",function(a){var b=_.find(c,{id:a.id}),e=c.indexOf(b),f="created";b?(_.merge(c[e],a),f="updated"):c.unshift(a),d(f,a)}),f.on(a+":"+b+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},unsyncFaxMessageUpdates:function(a,b){f.removeAllListeners(a+":"+b+":save"),f.removeAllListeners(a+":"+b+":remove")}}}]),angular.module("xCallyShuttleApp").service("triggers",function(){var a={voice:{conditions:[{name:"APPLICATION_QUEUE",value:"queue",propertyField:"select",operators:"equals"},{name:"APPLICATION_CALL_STATUS",value:"lastevent",propertyField:"select",operators:"equals"}],actions:[{
a.put("app/sound/list/list.html",'<div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-music-tone-alt"></i>\n <a href="#">{{ \'APPLICATION_SOUNDS\' | translate }}</a>\n </li>\n </ul>\n <div class="page-toolbar">\n </div>\n</div>\n<!-- END PAGE HEADER-->\n<!-- BEGIN PAGE CONTENT-->\n<!-- Audio Portlets -->\n<div class="headline">\n <h3><i class="icon-music-tone-alt sounds-title-icon"></i> {{ \'APPLICATION_SOUNDS\' | translate }}</h3>\n</div>\n<div class="portlet light bg-inverse">\n <div class="portlet-title collapsible" ng-click="isCollapsed = !isCollapsed">\n <div class="caption">\n <i class="icon-puzzle font-red-flamingo"></i>\n <span class="caption-subject bold font-red-flamingo uppercase">\n {{\'APPLICATION_FILE_UPLOAD\' | translate}} </span>\n </div>\n <div class="tools">\n <a href="" ng-class="{\'collapse\': !isCollapsed, \'expand\' : isCollapsed}">\n </a>\n <a href="" class="fullscreen">\n </a>\n </div>\n </div>\n <div class="portlet-body" ng-slide-down="!isCollapsed">\n <div class="row" nv-file-drop="" uploader="uploader" filters="queueLimit, customFilter">\n <div class="col-md-4">\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-settings font-green-sharp"></i>\n <span class="caption-subject bold uppercase">{{\'APPLICATION_SELECT_FILES\' | translate}}</span>\n <span class="caption-helper hide"></span>\n </div>\n <div class="actions">\n </div>\n </div>\n <div class="portlet-body">\n <div ng-show="uploader.isHTML5">\n <div class="file-drop-zone margin-bottom-20" nv-file-over="" uploader="uploader" over-class="file-drop-zone-over">\n Base drop zone\n </div>\n </div>\n <span class="btn default btn-file">\n <span class="fileinput-new">\n {{\'APPLICATION_FILE_UPLOAD\' | translate}}</span>\n <input type="file" nv-file-select="" uploader="uploader" />\n </span>\n <span class="btn default btn-file">\n <span class="fileinput-new">\n {{\'APPLICATION_MULTI_FILE_UPLOAD\' | translate}}</span>\n <input type="file" nv-file-select="" uploader="uploader" multiple /><br/>\n </span>\n <p>\n </br>\n {{ \'MESSAGE_SUPPORTED_FORMATS\' | translate }} <b>wav, mp3, gsm, ogg</b>.\n </p>\n <p>\n {{ \'MESSAGE_MAXIMUM_SOUND_UPLOAD_SIZE\' | translate }} <b>15 Mb</b>.\n </p>\n </div>\n </div>\n </div>\n <div class="col-md-8">\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-settings font-green-sharp"></i>\n <span class="caption-subject bold uppercase">{{\'APPLICATION_UPLOAD_QUEUE\' | translate}}</span>\n <span class="caption-helper">{{\'APPLICATION_QUEUE_LENGTH\' | translate}}: {{ uploader.queue.length }}</span>\n </div>\n <div class="actions">\n </div>\n </div>\n <div class="portlet-body">\n <div class="table-scrollable table-scrollable-borderless">\n <table class="table table-hover table-light">\n <thead>\n <tr class="uppercase">\n <th width="50%">{{\'APPLICATION_NAME\' | translate}}</th>\n <th ng-show="uploader.isHTML5">{{\'APPLICATION_SIZE\' | translate}}</th>\n <th ng-show="uploader.isHTML5">{{\'APPLICATION_PROGRESS\' | translate}}</th>\n <th>{{\'APPLICATION_STATUS\' | translate}}</th>\n <th>{{\'APPLICATION_MESSAGE\' | translate}}</th>\n <th>{{\'APPLICATION_ACTIONS\' | translate}}</th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="item in uploader.queue">\n <td><strong>{{ item.file.name }}</strong></td>\n <td ng-show="uploader.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>\n <td ng-show="uploader.isHTML5">\n <div class="progress progress-sm" style="margin-bottom: 0;">\n <div class="progress-bar progress-bar-info" role="progressbar" ng-style="{ \'width\': item.progress + \'%\' }"></div>\n </div>\n </td>\n <td class="text-center">\n <span ng-show="item.isSuccess" class="text-success"><i class="glyphicon glyphicon-ok"></i></span>\n <span ng-show="item.isCancel" class="text-info"><i class="glyphicon glyphicon-ban-circle"></i></span>\n <span ng-show="item.isError" class="text-danger"><i class="glyphicon glyphicon-remove"></i></span>\n <span ng-show="item.isUploading" class="text-info"><i class="glyphicon glyphicon-upload"></i></span>\n </td>\n <td class="text-center">\n <span ng-show="item.responseMessage" class="text-danger">{{item.responseMessage}}</span>\n </td>\n <td nowrap>\n <button type="button" class="btn btn-success btn-xs" ng-click="item.upload()" ng-disabled="item.isReady || item.isUploading || item.isSuccess">\n <span class="glyphicon glyphicon-upload"></span> {{\'APPLICATION_UPLOAD\' | translate}}\n </button>\n <button type="button" class="btn btn-warning btn-xs" ng-click="item.cancel()" ng-disabled="!item.isUploading">\n <span class="glyphicon glyphicon-ban-circle"></span> {{\'APPLICATION_CANCEL\' | translate}}\n </button>\n <button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">\n <span class="glyphicon glyphicon-trash"></span> {{\'APPLICATION_REMOVE\' | translate}}\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div>\n <p>{{\'APPLICATION_UPLOAD_QUEUE_PROGRESS\' | translate}}:</p>\n <div class="progress progress-sm" style="">\n <div class="progress-bar progress-bar-info" role="progressbar" ng-style="{ \'width\': uploader.progress + \'%\' }"></div>\n </div>\n </div>\n <button type="button" class="btn btn-success btn-s" ng-click="uploader.uploadAll()" ng-disabled="!uploader.getNotUploadedItems().length">\n <span class="glyphicon glyphicon-upload"></span> {{\'APPLICATION_UPLOAD_ALL\' | translate}}\n </button>\n <button type="button" class="btn btn-warning btn-s" ng-click="uploader.cancelAll()" ng-disabled="!uploader.isUploading">\n <span class="glyphicon glyphicon-ban-circle"></span> {{\'APPLICATION_CANCEL_ALL\' | translate}}\n </button>\n <button type="button" class="btn btn-danger btn-s" ng-click="uploader.clearQueue()" ng-disabled="!uploader.queue.length">\n <span class="glyphicon glyphicon-trash"></span> {{\'APPLICATION_REMOVE_ALL\' | translate}}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n<div class="row thumbnails" data-ng-init="initList()">\n <div class="row" ng-show="sounds.length == 0">\n <div class="col-md-12 page-404">\n <div class="details">\n <h3>{{ \'MESSAGE_NO_SOUNDS\' | translate }}</h3>\n <p>\n <a href="/">\n {{ \'MESSAGE_RETURN_HOME\' | translate }} </a>\n {{ \'MESSAGE_OR_UPLOAD_SOUND_FILE\' | translate }}\n </p>\n </div>\n </div>\n </div>\n <div class="audio-portlet-wrapper animate-repeat" ng-repeat="sound in sounds">\n <div class="audio-portlet">\n <div class="audio-portlet-title"><a href="#" editable-text="sound.display_name" onbeforesave="updateAudio(sound.id,{display_name : $data})">{{ sound.display_name || "Empty" }}</a></div>\n <img src="../assets/images/note_placeholder.png" alt="" class="img-responsive"/>\n <div class="file-info">\n <div class="audio-tag-wrapper">\n <audio controls ng-src="{{getSecureSrc(audioSources[sound.id])}}" preload="none">\n {{ \'MESSAGE_AUDIO_NOT_SUPPORTED\' | translate }}\n </audio>\n </div>\n <p id="description_div">\n <a href="#" editable-text="sound.description" onbeforesave="updateAudio(sound.id,{description : $data})">{{ sound.description || "Empty" }}</a>\n </p>\n <p class="float-right">\n <button class="btn btn-xs green-meadow" tooltip-html-unsafe="<ul class=\'list-unstyled\'><li><b>Format : </b>{{sound.original_format}}</li><li><b>Duration : </b>{{sound.original_duration | date: \'mm:ss\'}}</li><li><b>Channels : </b>{{sound.original_channelCount}}</li><li><b>Bitrate : </b>{{sound.original_bitRate/1024}} kbs</li><li><b>Sample Rate : </b>{{sound.original_sampleRate/1000}} KHz</li></ul>"><i class="icon-list"></i></button>\n <a class="btn btn-xs blue-hoki" href="{{getSecureDownloadSrc(audioSources[sound.id])}}" download="{{sound.name+\'.\'+sound.original_format}}" target="_self" tooltip="Download"><i class="icon-cloud-download"></i></a>\n <button class="btn btn-xs red-sunglo" ng-click="delete(sound.display_name, sound.id)" tooltip="Delete"><i class="icon-close" ></i></button>\n </p>\n </div>\n </div>\n </div>\n</div>\n<!-- End Audio Portlets -->\n'),a.put("app/sound/sound.html","<!-- BEGIN PAGE CONTENT-->\n<div ui-view></div>\n<!-- END PAGE CONTENT-->\n"),a.put("app/square/odbc/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-docs"></i>\n <a href="/square/odbcs/list">{{ \'APPLICATION_ODBCS\' | translate }}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-docs font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_ODBCS\' | translate }}</a> </span>\n </div>\n <div class="actions">\n <div class="btn-group" data-ng-show="Odbcs.checked.length">\n <a class="btn red" href="#" data-ng-click="deleteItems()">\n <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </div>\n <div class="btn-group">\n <a class="btn green-jungle " href="#" data-toggle="dropdown">\n <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ODBC\' | translate }} <i class="fa fa-angle-down"></i>\n </a>\n <ul class="dropdown-menu pull-right">\n <li>\n <a href="/square/odbcs/wizard">\n <i class="icon-user-following"></i> {{ \'APPLICATION_WIZARD\' | translate }} </a>\n </li>\n </ul>\n </div>\n <a class="btn btn-icon-only btn-default" href="#" ng-csv="getOdbcs([\'name\', \'description\'])" csv-header="[\'Name\', \'Description\']" field-separator=";" filename="square_odbcs.csv">\n <i class="icon-cloud-download"></i></a>\n <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n </div>\n </div>\n <div class="portlet-body">\n <!-- START TABLE -->\n <table st-table="displayedOdbcs" st-pipe="initList" class="table table-striped table-bordered table-hover">\n <div class="table-responsive">\n <thead>\n <tr>\n <th colspan="4">\n <div class="row">\n <div class="col-md-6">\n <ui-select class="input-xsmall" ng-model="conf.odbcsByPage" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="odbcByPage in odbcsByPage | filter: $select.search">\n <div ng-bind-html="odbcByPage.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n <div class="col-md-6">\n <div class="input-group input-medium pull-right">\n <input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n <span class="input-group-addon">\n <i class="fa fa-search"></i>\n </span>\n </div>\n </div>\n </div>\n </th>\n </tr>\n <tr>\n <th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(odbc, checked)" checklist-model checklist-value="id"></th>\n <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n <th st-sort="description">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n </tr>\n </thead>\n <tbody>\n <tr data-ng-repeat="odbc in displayedOdbcs" class="animate-repeat">\n <td style="text-align: center; vertical-align: middle"><input data-ng-hide="odbc.defaultEntry" type="checkbox" checklist-model="Odbcs.checked" checklist-value="odbc.id"></td>\n <td>{{odbc.name}}</td>\n <td>{{odbc.description}}</td>\n <td>\n <a class="btn default btn-xs blue-stripe" data-ng-href="/square/odbcs/view/{{odbc.id}}/settings" data-ng-class="{\'disabled\': odbc.defaultEntry}">\n {{ \'APPLICATION_SETTINGS\' | translate}}\n </a>\n <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(odbc.name,odbc.id)" data-ng-class="{\'disabled\': odbc.defaultEntry}">\n {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </td>\n </tr>\n <tr data-ng-hide="displayedOdbcs.length">\n <td colspan="4" style="text-align:center;">\n <i>{{ \'MESSAGE_NO_ODBCS_AVAILABLE\' | translate }}</i>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td/>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="description" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_DESCRIPTION\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td/>\n </tr>\n <tr>\n <td colspan="4" class="text-center">\n <div st-pagination class="pagination" st-items-by-page="conf.odbcsByPage.value" st-displayed-pages="7"></div>\n </td>\n </tr>\n </tfoot>\n </div>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/square/odbc/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getOdbc()">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-docs"></i>\n <a href="/square/odbcs/list">{{ \'APPLICATION_ODBCS\' | translate }}</a>\n <i data-ng-show="odbc" class="fa fa-angle-right"></i>\n </li>\n <li data-ng-show="odbc">\n <a href="#">{{odbc.name}}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN PROFILE SIDEBAR -->\n <div class="profile-sidebar">\n <!-- PORTLET MAIN -->\n <div class="portlet light profile-sidebar-portlet">\n <!-- SIDEBAR USERPIC -->\n <div class="profile-image">\n <img data-ng-src="assets/images/media/odbc.png" class="img-responsive">\n </div>\n <!-- END SIDEBAR USERPIC -->\n <!-- SIDEBAR USER TITLE -->\n <div class="profile-usertitle">\n <div class="profile-usertitle-name">\n {{odbc.name}}\n </div>\n <!-- <div class="profile-usertitle-job">\n {{user.role}}\n </div> -->\n </div>\n <!-- END SIDEBAR USER TITLE -->\n\n <!-- SIDEBAR MENU -->\n <div class="profile-usermenu">\n <ul class="nav">\n <li data-ng-class="{active: $state.is(\'main.square.odbcs.view.settings\')}">\n <a data-ng-href="/square/odbcs/view/{{odbc.id}}/settings">\n <i class="icon-settings"></i>\n {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n </li>\n </ul>\n </div>\n <!-- END MENU -->\n </div>\n <!-- END PORTLET MAIN -->\n </div>\n <!-- END BEGIN PROFILE SIDEBAR -->\n <!-- BEGIN PROFILE CONTENT -->\n <div ui-view class="profile-content">\n </div>\n <!-- END PROFILE CONTENT -->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/square/odbc/view/view.settings.html",'<div class="row">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_ODBC\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n </div>\n <ul class="nav nav-tabs">\n <li class="active">\n <a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n </li>\n </ul>\n </div>\n\n <div class="portlet-body">\n <div class="tab-content">\n <!-- GENERAL TAB -->\n <div class="tab-pane active" id="tab_1_1">\n <form name="forms.general" data-ng-submit="forms.general.$valid && updateOdbc()" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="odbc.name" required/>\n <span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START DSN -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.odbc.dsn.$touched || forms.odbc.$submitted) && forms.odbc.dsn.$invalid}">\n <label class="control-label">{{\'APPLICATION_DSN\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="dsn" placeholder="{{\'APPLICATION_DSN\' | translate}}" class="form-control" data-ng-model="odbc.dsn" required/>\n <span data-ng-show="(forms.odbc.dsn.$touched || forms.odbc.$submitted) && forms.odbc.dsn.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END DSN -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="odbc.description"></textarea>\n </div>\n <!-- END DESCRIPTION -->\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END ADVANCED TAB -->\n\n </div>\n </div>\n </div>\n </div>\n</div>\n'),a.put("app/square/odbc/wizard/wizard.html",'<div class="col-md-12">\n <!-- BEGIN PAGE HEADER-->\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-docs"></i>\n <a href="/square/odbcs/list">{{ \'APPLICATION_ODBCS\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-options"></i>\n <a href="/square/odbcs/wizard">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n </li>\n </ul>\n </div>\n <!-- END PAGE HEADER-->\n\n <!-- BEGIN PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-docs font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_ODBC\' | translate }} WIZARD</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <wizard on-finish="createItem()">\n <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="exitValidation(forms.odbc.$valid)">\n <form name="forms.odbc" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.odbc.name.$touched || forms.odbc.$submitted) && forms.odbc.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n <span data-ng-show="(forms.odbc.name.$touched || forms.odbc.$submitted) && forms.odbc.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START DSN -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.odbc.dsn.$touched || forms.odbc.$submitted) && forms.odbc.dsn.$invalid}">\n <label class="control-label">{{\'APPLICATION_DSN\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="dsn" placeholder="{{\'APPLICATION_DSN\' | translate}}" class="form-control" data-ng-model="item.dsn" required/>\n <span data-ng-show="(forms.odbc.dsn.$touched || forms.odbc.$submitted) && forms.odbc.dsn.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END DSN -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n </div>\n <!-- END DESCRIPTION -->\n <button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n </wz-step>\n </wizard>\n </div>\n </div>\n <!-- END PORTLET-->\n</div>\n'),a.put("app/square/project/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="fa fa-slack"></i>\n <a href="/square/projects/list">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-docs font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_PROJECTS\' | translate }}</a> </span>\n </div>\n <div class="actions">\n <div class="btn-group" data-ng-show="Projects.checked.length">\n <a class="btn red" href="#" data-ng-click="deleteItems()">\n <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </div>\n <div class="btn-group">\n <a class="btn green-jungle " href="#" data-toggle="dropdown">\n <i class="icon-plus"></i> {{ \'APPLICATION_NEW_PROJECT\' | translate }} <i class="fa fa-angle-down"></i>\n </a>\n <ul class="dropdown-menu pull-right">\n <li>\n <a href="/square/projects/wizard">\n <i class="icon-user-following"></i> {{ \'APPLICATION_WIZARD\' | translate }} </a>\n </li>\n </ul>\n </div>\n <a class="btn btn-icon-only btn-default" href="#" ng-csv="getProjects([\'name\', \'description\'])" csv-header="[\'Name\', \'Description\']" field-separator=";" filename="square_projects.csv">\n <i class="icon-cloud-download"></i></a>\n <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n </div>\n </div>\n <div class="portlet-body">\n <!-- START TABLE -->\n <table st-table="displayedProjects" st-pipe="initList" class="table table-striped table-bordered table-hover">\n <div class="table-responsive">\n <thead>\n <tr>\n <th colspan="4">\n <div class="row">\n <div class="col-md-6">\n <ui-select class="input-xsmall" ng-model="conf.projectsByPage" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="projectByPage in projectsByPage | filter: $select.search">\n <div ng-bind-html="projectByPage.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n <div class="col-md-6">\n <div class="input-group input-medium pull-right">\n <input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n <span class="input-group-addon">\n <i class="fa fa-search"></i>\n </span>\n </div>\n </div>\n </div>\n </th>\n </tr>\n <tr>\n <th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(agent, checked)" checklist-model checklist-value="id"></th>\n <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n <th st-sort="description">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n </tr>\n </thead>\n <tbody>\n <tr data-ng-repeat="project in displayedProjects" class="animate-repeat">\n <td style="text-align: center; vertical-align: middle"><input data-ng-hide="project.defaultEntry" type="checkbox" checklist-model="Projects.checked" checklist-value="project.id"></td>\n <td>{{project.name}}</td>\n <td>{{project.description}}</td>\n <td>\n <a class="btn default btn-xs blue-stripe" data-ng-href="/square/projects/view/{{project.id}}" data-ng-class="{\'disabled\': project.defaultEntry}">\n {{ \'APPLICATION_SETTINGS\' | translate}}\n </a>\n <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(project.name,project.id)" data-ng-class="{\'disabled\': project.defaultEntry}">\n {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </td>\n </tr>\n <tr data-ng-hide="displayedProjects.length">\n <td colspan="4" style="text-align:center;">\n <i>{{ \'MESSAGE_NO_PROJECTS_AVAILABLE\' | translate }}</i>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td/>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="description" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_DESCRIPTION\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td/>\n </tr>\n <tr>\n <td colspan="4" class="text-center">\n <div st-pagination class="pagination" st-items-by-page="conf.projectsByPage.value" st-displayed-pages="7"></div>\n </td>\n </tr>\n </tfoot>\n </div>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/square/project/view/view.html",'<div class="row" data-ng-init="getProject()">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="fa fa-superscript"></i>\n <a href="/square/projects">{{ \'APPLICATION_CALLYSQUARE\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="fa fa-slack"></i>\n <a href="/square/projects">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <a ng-href="/square/projects/view/{{squareProject.id}}">{{squareProject.name}}</a>\n </li>\n </ul>\n </div>\n </div>\n</div>\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <div id="geEditor" class="geEditor"></div>\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n<script>\n\n\n</script>\n'),a.put("app/square/project/wizard/wizard.html",'<div class="col-md-12">\n <!-- BEGIN PAGE HEADER-->\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-docs"></i>\n <a href="/square/projects/list">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-options"></i>\n <a href="/square/projects/wizard">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n </li>\n </ul>\n </div>\n <!-- END PAGE HEADER-->\n\n <!-- BEGIN PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-docs font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_PROJECT\' | translate }} WIZARD</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <wizard on-finish="createItem()">\n <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="exitValidation(forms.project.$valid)">\n <form name="forms.project" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.project.name.$touched || forms.project.$submitted) && forms.project.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n <span data-ng-show="(forms.project.name.$touched || forms.project.$submitted) && forms.project.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n </div>\n <!-- END DESCRIPTION -->\n <button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n </wz-step>\n </wizard>\n </div>\n </div>\n <!-- END PORTLET-->\n</div>\n'),
a.put("app/tag/list/create.modal.html",'<div class="modal-header">\n <h3 class="modal-title">{{ \'APPLICATION_NEW_TAG\' | translate }}</h3>\n</div>\n<div class="modal-body">\n <form name="forms.tag" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.tag.name.$touched || forms.tag.$submitted) && forms.tag.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n <span data-ng-show="(forms.tag.name.$touched || forms.tag.$submitted) && forms.tag.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n </div>\n <!-- END DESCRIPTION -->\n\n </form>\n</div>\n<div class="modal-footer">\n <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.tag.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tag/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-tag"></i>\n <a href="/tags/list">{{ \'APPLICATION_TAGS\' | translate }}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-docs font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_TAGS\' | translate }}</a> </span>\n </div>\n <div class="actions">\n <div class="btn-group" data-ng-show="Tags.checked.length">\n <a class="btn red" href="#" data-ng-click="deleteItems()">\n <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </div>\n <div class="btn-group">\n <button class="btn green-jungle " ng-click="create()">\n <i class="icon-plus"></i> {{ \'APPLICATION_NEW_TAG\' | translate }}\n </button>\n </div>\n <a class="btn btn-icon-only btn-default" href="#" ng-csv="getTags([\'name\', \'description\'])" csv-header="[\'Name\', \'Description\']" field-separator=";" filename="tags.csv">\n <i class="icon-cloud-download"></i></a>\n <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n </div>\n </div>\n <div class="portlet-body">\n <!-- START TABLE -->\n <table st-table="displayedTags" st-pipe="initList" class="table table-striped table-bordered table-hover">\n <div class="table-responsive">\n <thead>\n <tr>\n <th colspan="4">\n <div class="row">\n <div class="col-md-6">\n <ui-select class="input-xsmall" ng-model="conf.tagsByPage" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="tagByPage in tagsByPage | filter: $select.search">\n <div ng-bind-html="tagByPage.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n <div class="col-md-6">\n <div class="input-group input-medium pull-right">\n <input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n <span class="input-group-addon">\n <i class="fa fa-search"></i>\n </span>\n </div>\n </div>\n </div>\n </th>\n </tr>\n <tr>\n <th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(tag, checked)" checklist-model checklist-value="id"></th>\n <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n <th st-sort="description">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n </tr>\n </thead>\n <tbody>\n <tr data-ng-repeat="tag in displayedTags" class="animate-repeat">\n <td style="text-align: center; vertical-align: middle"><input data-ng-hide="tag.defaultEntry" type="checkbox" checklist-model="Tags.checked" checklist-value="tag.id"></td>\n <td>{{tag.name}}</td>\n <td>{{tag.description}}</td>\n <td>\n <a class="btn default btn-xs blue-stripe" data-ng-href="/tags/view/{{tag.id}}/settings" data-ng-class="{\'disabled\': tag.defaultEntry}">\n {{ \'APPLICATION_SETTINGS\' | translate}}\n </a>\n <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(tag.name,tag.id)" data-ng-class="{\'disabled\': tag.defaultEntry}">\n {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </td>\n </tr>\n <tr data-ng-hide="displayedTags.length">\n <td colspan="4" style="text-align:center;">\n <i>{{ \'MESSAGE_NO_TAGS_AVAILABLE\' | translate }}</i>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td/>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="description" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_DESCRIPTION\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td/>\n </tr>\n <tr>\n <td colspan="4" class="text-center">\n <div st-pagination class="pagination" st-items-by-page="conf.tagsByPage.value" st-displayed-pages="7"></div>\n </td>\n </tr>\n </tfoot>\n </div>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tag/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getTag()">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-tag"></i>\n <a href="/tags/list">{{ \'APPLICATION_TAGS\' | translate }}</a>\n <i data-ng-show="tag" class="fa fa-angle-right"></i>\n </li>\n <li data-ng-show="tag">\n <a href="#">{{tag.name}}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN PROFILE SIDEBAR -->\n <div class="profile-sidebar">\n <!-- PORTLET MAIN -->\n <div class="portlet light profile-sidebar-portlet">\n <!-- SIDEBAR USERPIC -->\n <div class="profile-image">\n <img data-ng-src="assets/images/media/tag.png" class="img-responsive">\n </div>\n <!-- END SIDEBAR USERPIC -->\n <!-- SIDEBAR USER TITLE -->\n <div class="profile-usertitle">\n <div class="profile-usertitle-name">\n {{tag.name}}\n </div>\n <!-- <div class="profile-usertitle-job">\n {{user.role}}\n </div> -->\n </div>\n <!-- END SIDEBAR USER TITLE -->\n\n <!-- SIDEBAR MENU -->\n <div class="profile-usermenu">\n <ul class="nav">\n <li data-ng-class="{active: $state.is(\'main.tags.view.settings\')}">\n <a data-ng-href="/tags/view/{{tag.id}}/settings">\n <i class="icon-settings"></i>\n {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n </li>\n </ul>\n </div>\n <!-- END MENU -->\n </div>\n <!-- END PORTLET MAIN -->\n </div>\n <!-- END BEGIN PROFILE SIDEBAR -->\n <!-- BEGIN PROFILE CONTENT -->\n <div ui-view class="profile-content">\n </div>\n <!-- END PROFILE CONTENT -->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tag/view/view.settings.html",'<div class="row">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_TAG\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n </div>\n <ul class="nav nav-tabs">\n <li class="active">\n <a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n </li>\n </ul>\n </div>\n\n <div class="portlet-body">\n <div class="tab-content">\n <!-- GENERAL TAB -->\n <div class="tab-pane active" id="tab_1_1">\n <form name="forms.general" data-ng-submit="forms.general.$valid && updateTag()" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="tag.name" required/>\n <span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="tag.description"></textarea>\n </div>\n <!-- END DESCRIPTION -->\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END ADVANCED TAB -->\n\n </div>\n </div>\n </div>\n </div>\n</div>\n'),a.put("app/team/list/list.html",'<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-shield"></i>\n <a href="#">{{ \'APPLICATION_TEAMS\' | translate }}</a>\n </li>\n </ul>\n </div>\n </div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-shield font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_TEAMS\' | translate }}</a> </span>\n </div>\n <div class="actions">\n <div class="btn-group" data-ng-show="teams.checked.length">\n <a class="btn red" href="#" data-ng-click="deleteItems()">\n <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </div>\n <div class="btn-group">\n <a class="btn green-jungle " href="#" data-toggle="dropdown">\n <i class="icon-plus"></i> {{ \'APPLICATION_NEW_TEAM\' | translate }} <i class="fa fa-angle-down"></i>\n </a>\n <ul class="dropdown-menu pull-right">\n <!-- <li>\n <a href="#">\n <i class="icon-user"></i> {{ \'APPLICATION_QUICK\' | translate }} </a>\n </li> -->\n <li>\n <a href="/teams/wizard">\n <i class="icon-user-following"></i> {{ \'APPLICATION_WIZARD\' | translate }} </a>\n </li>\n <!-- <li>\n <a href="#">\n <i class="icon-users"></i> {{ \'APPLICATION_BULK\' | translate }} </a>\n </li> -->\n </ul>\n </div>\n <a class="btn btn-icon-only btn-default" href="#" ng-csv="getTeams([\'name\', \'description\'])" csv-header="[\'Name\', \'Description\']" field-separator=";" filename="teams.csv">\n <i class="icon-cloud-download"></i></a>\n <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n </div>\n </div>\n <div class="portlet-body">\n <!-- START TABLE -->\n <table st-table="displayedTeams" st-pipe="initList" class="table table-striped table-bordered table-hover">\n <div class="table-responsive">\n <thead>\n <tr>\n <th colspan="5">\n <div class="row">\n <div class="col-md-6">\n <ui-select class="input-xsmall" ng-model="conf.teamsByPage" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="teamByPage in teamsByPage | filter: $select.search">\n <div ng-bind-html="teamByPage.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n <div class="col-md-6">\n <div class="input-group input-medium pull-right">\n <input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n <span class="input-group-addon">\n <i class="fa fa-search"></i>\n </span>\n </div>\n </div>\n </div>\n </th>\n </tr>\n <tr>\n <th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(agent, checked)" checklist-model checklist-value="id"></th>\n <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n <th st-sort="description">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n </tr>\n </thead>\n <tbody>\n <tr data-ng-repeat="team in displayedTeams" class="animate-repeat">\n <td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="teams.checked" checklist-value="team.id"></td>\n <td>{{team.name}}</td>\n <td>{{team.description}}</td>\n <td>\n <a class="btn default btn-xs blue-stripe" data-ng-href="/teams/view/{{team.id}}/settings" data-ng-class="{\'disabled\': team.defaultEntry}">\n {{ \'APPLICATION_PROFILE\' | translate }}\n </a>\n <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(team.name, team.id)" data-ng-class="{\'disabled\': team.defaultEntry}">\n {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </td>\n </tr>\n <tr data-ng-hide="displayedTeams.length">\n <td colspan="5" style="text-align:center;">\n <i>No teams available</i>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td/>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="description" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_DESCRIPTION\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n </td>\n </tr>\n <tr>\n <td colspan="5" class="text-center">\n <div st-pagination class="pagination" st-items-by-page="conf.teamsByPage.value" st-displayed-pages="7"></div>\n </td>\n </tr>\n </tfoot>\n </div>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/team/view/view.agents.html",'<div class="row" data-ng-init="initAgents()">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n </div>\n </div>\n <div class="portlet-body">\n <!-- GENERAL TAB -->\n <!-- BEGIN PORTLET-->\n <!-- BEGIN FORM-->\n <form action="index.html" class="form-horizontal form-row-seperated">\n <div class="form-body">\n <div class="form-group last">\n <div class="col-md-9" id="multi-select-team">\n </div>\n </div>\n </div>\n </form>\n <!-- END FORM-->\n <!-- END PORTLET-->\n <!-- END GENERAL TAB -->\n </div>\n </div>\n </div>\n</div>\n'),a.put("app/team/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-shield"></i>\n <a href="/teams/list">{{ \'APPLICATION_TEAMS\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <a href="#">{{team.name}}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN PROFILE SIDEBAR -->\n <div class="profile-sidebar">\n <!-- PORTLET MAIN -->\n <div class="portlet light profile-sidebar-portlet">\n <!-- SIDEBAR USERPIC -->\n <div class="profile-image">\n <img ng-src="assets/images/media/team.png" class="img-responsive">\n </div>\n <!-- END SIDEBAR USERPIC -->\n <!-- SIDEBAR USER TITLE -->\n <div class="profile-usertitle">\n <div class="profile-usertitle-name">\n {{team.name}}\n </div>\n\n </div>\n <!-- END SIDEBAR USER TITLE -->\n\n <!-- SIDEBAR MENU -->\n <div class="profile-usermenu">\n <ul class="nav">\n <li data-ng-class="{active: $state.is(\'main.teams.view.settings\')}">\n <a data-ng-href="/teams/view/{{team.id}}/settings">\n <i class="icon-settings"></i>\n {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n </li>\n <li data-ng-class="{active: $state.is(\'main.teams.view.agents\')}">\n <a data-ng-href="/teams/view/{{team.id}}/agents">\n <i class="icon-users"></i>\n {{ \'APPLICATION_AGENTS\' | translate}} </a>\n </li>\n </ul>\n </div>\n <!-- END MENU -->\n </div>\n <!-- END PORTLET MAIN -->\n </div>\n <!-- END BEGIN PROFILE SIDEBAR -->\n <!-- BEGIN PROFILE CONTENT -->\n <div ui-view class="profile-content">\n </div>\n <!-- END PROFILE CONTENT -->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/team/view/view.settings.html",'<div class="row">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_ACCOUNT\' | translate}}</span>\n </div>\n </div>\n\n <div class="portlet-body">\n <!-- PERSONAL INFO TAB -->\n <div>\n\n <form name="forms.info" data-ng-submit="updateItem()" novalidate>\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="team.name" required/>\n <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="team.description"/>\n </div>\n <!-- END DESCRIPTION -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END PERSONAL INFO TAB -->\n </div>\n </div>\n </div>\n</div>\n'),a.put("app/team/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-shield"></i>\n <a href="/teams/list">{{ \'APPLICATION_TEAMS\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-user-following"></i>\n <a href="#">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n </li>\n </ul>\n </div>\n </div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div id="team" class="row" data-ng-init="getAgents()">\n <div class="col-md-12">\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-notebook font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_TEAM\' | translate }} WIZARD</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <wizard on-finish="createItem()">\n <wz-step title="{{\'APPLICATION_TEAM_INFO\' | translate}}" canexit="formValidation(forms.info.$valid)">\n <form name="forms.info" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid && forms.info.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n </div>\n <!-- END DESCRIPTION -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="goNext()"/>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n </wz-step>\n </wizard>\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/trigger/list/list.html",'<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-bulb"></i>\n <a href="#">{{ \'APPLICATION_TRIGGERS\' | translate }}</a>\n </li>\n </ul>\n </div>\n </div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-bulb font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_TRIGGERS\' | translate }}</a> </span>\n </div>\n <div class="actions">\n <div class="btn-group" data-ng-show="Triggers.checked.length">\n <a class="btn red" href="#" data-ng-click="deleteItems()">\n <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </div>\n <div class="btn-group">\n <a class="btn green-jungle " href="#" data-toggle="dropdown">\n <i class="icon-plus"></i> {{ \'APPLICATION_NEW_TRIGGER\' | translate }} <i class="fa fa-angle-down"></i>\n </a>\n <ul class="dropdown-menu pull-right">\n <li>\n <a href="/triggers/wizard">\n <i class="icon-user-following"></i> {{ \'APPLICATION_WIZARD\' | translate }} </a>\n </li>\n </ul>\n </div>\n <a class="btn btn-icon-only btn-default" href="#" ng-csv="getTriggers([\'name\', \'description\'])" csv-header="[\'Name\', \'Description\']" field-separator=";" filename="triggers.csv">\n <i class="icon-cloud-download"></i></a>\n <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n </div>\n </div>\n <div class="portlet-body">\n <!-- START TABLE -->\n <table st-table="displayedTriggers" st-pipe="initList" class="table table-striped table-bordered table-hover">\n <div class="table-responsive">\n <thead>\n <tr>\n <th colspan="6">\n <div class="row">\n <div class="col-md-6">\n <ui-select class="input-xsmall" ng-model="conf.TriggersByPage" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="TriggerByPage in TriggersByPage | filter: $select.search">\n <div ng-bind-html="TriggerByPage.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n <div class="col-md-6">\n <div class="input-group input-medium pull-right">\n <input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n <span class="input-group-addon">\n <i class="fa fa-search"></i>\n </span>\n </div>\n </div>\n </div>\n </th>\n </tr>\n <tr>\n <!-- <th st-sort="id" width="5%" st-sort-default="reverse">{{ \'APPLICATION_ID\' | translate }}</th> -->\n <th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(Trigger, checked)" checklist-model checklist-value="id"></th>\n <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n <th st-sort="description">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n <th st-sort="channel">{{ \'APPLICATION_CHANNEL\' | translate }}</th>\n <th>{{ \'APPLICATION_STATUS\' | translate }}</th>\n <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n </tr>\n </thead>\n <tbody>\n <tr data-ng-repeat="Trigger in displayedTriggers">\n <td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="Triggers.checked" checklist-value="Trigger.id"></td>\n <td>{{Trigger.name}}</td>\n <td>{{Trigger.description}}</td>\n <td>{{Trigger.channel | capitalize}}</td>\n <td>\n <input\n data-ng-change="updateItem(Trigger.id, Trigger.status)",\n bs-switch\n ng-model="Trigger.status"\n type="checkbox"\n switch-active="{{ isActive }}"\n switch-on-text="{{ onText }}"\n switch-off-text="{{ offText }}"\n switch-on-color="{{ onColor }}"\n switch-off-color="{{ offColor }}"\n switch-animate="{{ animate }}"\n switch-size="{{ size }}"\n switch-label="{{ label }}"\n switch-icon="{{ icon }}"\n switch-radio-off="{{ radioOff }}"\n switch-label-width="{{ labelWidth }}"\n switch-handle-width="{{ handleWidth }}">\n </td>\n <td>\n <a class="btn default btn-xs blue-stripe" data-ng-href="/triggers/view/{{Trigger.id}}/settings">\n {{ \'APPLICATION_EDIT\' | translate }}\n </a>\n <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(Trigger.name, Trigger.id)">\n {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </td>\n </tr>\n <tr data-ng-hide="displayedTriggers.length">\n <td colspan="6" class="text-center">\n <i>No available triggers</i>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td/>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_USERNAME\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="description" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_DESCRIPTION\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="channel" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_CHANNEL\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td/>\n <td/>\n </tr>\n <tr>\n <td colspan="6" class="text-center">\n <div st-pagination class="pagination" st-items-by-page="conf.TriggersByPage.value" st-displayed-pages="7"></div>\n </td>\n </tr>\n </tfoot>\n </div>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
a.put("app/trigger/view/view.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row" data-ng-init="initView();getProperties();">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-bulb"></i>\n <a href="/triggers/list">{{ \'APPLICATION_TRIGGERS\' | translate }}</a>\n <i class="fa fa-angle-right" data-ng-show="trigger"></i>\n </li>\n <li data-ng-show="trigger">\n <a href="#">{{ trigger.description || trigger.name }}</a>\n </li>\n </ul>\n </div>\n\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n <!-- BEGIN PROFILE SIDEBAR -->\n <div class="profile-sidebar">\n <!-- PORTLET MAIN -->\n <div class="portlet light profile-sidebar-portlet">\n <!-- SIDEBAR USERPIC -->\n <div class="profile-image">\n <img data-ng-src="assets/images/media/trigger.png" class="img-responsive">\n </div>\n <!-- END SIDEBAR USERPIC -->\n\n <!-- SIDEBAR USER TITLE -->\n <div class="profile-usertitle">\n <div class="profile-usertitle-name">\n {{ trigger.name }}\n </div>\n <div class="profile-usertitle-job">\n {{ trigger.description }}\n </div>\n </div>\n <!-- END SIDEBAR USER TITLE -->\n\n <!-- SIDEBAR MENU -->\n <div class="profile-usermenu">\n <ul class="nav">\n <li data-ng-class="{active: $state.is(\'main.triggers.view.settings\')}">\n <a href="/triggers/view/{{trigger.id}}/settings">\n <i class="icon-bulb"></i>\n {{ \'APPLICATION_SETTINGS\' | translate }} </a>\n </li>\n </ul>\n </div>\n <!-- END MENU -->\n </div>\n </div>\n <!-- END BEGIN PROFILE SIDEBAR -->\n <!-- BEGIN PROFILE CONTENT -->\n <div ui-view class="profile-content">\n </div>\n <!-- END PROFILE CONTENT -->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/trigger/view/view.settings.html",'<div class="row">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n </div>\n <ul class="nav nav-tabs">\n <li class="active">\n <a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n </li>\n <li>\n <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_CONDITIONS\' | translate}} & {{\'APPLICATION_ACTIONS\' | translate}}</a>\n </li>\n </ul>\n </div>\n <div class="portlet-body">\n <!-- <pre>\n {{conditionsData.query | json}}\n </pre>\n <pre>\n {{actionsData.query | json}}\n </pre> -->\n <div class="tab-content">\n <!-- GENERAL TAB -->\n <div class="tab-pane active" id="tab_1_1">\n <form name="forms.general" data-ng-submit="forms.general.$valid && updateTrigger()" novalidate>\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="trigger.name" required/>\n <span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="trigger.description"/>\n </div>\n <!-- END DESCRIPTION -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END GENERAL TAB -->\n <!-- <pre>\n {{conditionsFilter | json}}\n </pre> -->\n <div class="tab-pane" id="tab_1_2">\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-blue-hoki">\n <i class="icon-tag font-blue-hoki"></i>\n <span class="caption-subject">{{ \'APPLICATION_CONDITIONS\' | translate }}</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <query-builder group="conditionsFilter.group" fields="fields.conditions" operators="$triggers.operators" properties="properties[trigger.channel]"></query-builder>\n </div>\n </div>\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-blue-hoki">\n <i class="icon-tag font-blue-hoki"></i>\n <span class="caption-subject">{{ \'APPLICATION_ACTIONS\' | translate }}</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <query-builder group="actionsFilter.group" fields="fields.actions" properties="properties[trigger.channel]"></query-builder>\n </div>\n </div>\n\n <input class="btn green-haze" type="button" value="{{\'APPLICATION_UPDATE\' | translate}}" data-ng-click="updateTrigger()"/>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n'),a.put("app/trigger/wizard/wizard.html",'\n<div class="row" data-ng-init="getProperties()">\n <div class="col-md-12">\n <!-- BEGIN PAGE HEADER-->\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-bulb"></i>\n <a href="/triggers/list">{{ \'APPLICATION_TRIGGERS\' | translate }}</a>\n </li>\n </ul>\n </div>\n <!-- END PAGE HEADER-->\n\n <!-- BEGIN PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-bulb font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_TRIGGERS\' | translate }} WIZARD</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <wizard on-finish="createItem()">\n <wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(forms.general.$valid)">\n <form name="forms.general" novalidate>\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name"/ required>\n <span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n </div>\n <!-- END DESCRIPTION -->\n\n <button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n </form>\n </wz-step>\n <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}">\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-blue-hoki">\n <i class="icon-tag font-blue-hoki"></i>\n <span class="caption-subject">{{ \'APPLICATION_CHANNEL\' | translate }}</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <div class="form-group" >\n <label class="control-label">{{ \'APPLICATION_CHANNEL\' | translate }}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="item.channel" name="channel" theme="bootstrap" required>\n <ui-select-match placeholder="{{ \'APPLICATION_CHANNEL\' | translate }}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="channel in $triggers.channels | filter: $select.search">\n <div ng-bind-html="channel | highlight: $select.search | capitalize"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n </div>\n </div>\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-blue-hoki">\n <i class="icon-tag font-blue-hoki"></i>\n <span class="caption-subject">{{ \'APPLICATION_CONDITIONS\' | translate }}</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <query-builder group="conditionsFilter.group" fields="fields.conditions" operators="$triggers.operators" properties="properties[item.channel]"></query-builder>\n </div>\n </div>\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-blue-hoki">\n <i class="icon-tag font-blue-hoki"></i>\n <span class="caption-subject">{{ \'APPLICATION_ACTIONS\' | translate }}</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <query-builder group="actionsFilter.group" fields="fields.actions" properties="properties[item.channel]"></query-builder>\n </div>\n </div>\n <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n <button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n </wz-step>\n <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n </wz-step>\n </wizard>\n </div>\n </div>\n <!-- END PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/trunk/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-link"></i>\n <a href="/trunks/list">{{ \'APPLICATION_TRUNKS\' | translate }}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-link font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_TRUNKS\' | translate }}</a> </span>\n </div>\n <div class="actions">\n <div class="btn-group" data-ng-show="trunks.checked.length">\n <a class="btn red" href="#" data-ng-click="deleteItems()">\n <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </div>\n <div class="btn-group">\n <a class="btn green-jungle " href="#" data-toggle="dropdown">\n <i class="icon-plus"></i> {{ \'APPLICATION_NEW_TRUNK\' | translate }} <i class="fa fa-angle-down"></i>\n </a>\n <ul class="dropdown-menu pull-right">\n <li>\n <a href="/trunks/wizard">\n <i class="icon-user-following"></i> {{ \'APPLICATION_WIZARD\' | translate }} </a>\n </li>\n </ul>\n </div>\n <a class="btn btn-icon-only btn-default" href="#" ng-csv="getTrunks([\'name\', \'host\', \'context\', \'description\'])" csv-header="[\'Name\', \'Host\', \'Context\', \'Description\']" field-separator=";" filename="trunks.csv">\n <i class="icon-cloud-download"></i></a>\n <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n </div>\n </div>\n <div class="portlet-body">\n <!-- START TABLE -->\n <table st-table="displayedTrunks" st-pipe="initList" class="table table-striped table-bordered table-hover">\n <div class="table-responsive">\n <thead>\n <tr>\n <th colspan="6">\n <div class="row">\n <div class="col-md-6">\n <ui-select class="input-xsmall" ng-model="conf.trunksByPage" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="trunkByPage in trunksByPage | filter: $select.search">\n <div ng-bind-html="trunkByPage.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n <div class="col-md-6">\n <div class="input-group input-medium pull-right">\n <input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n <span class="input-group-addon">\n <i class="fa fa-search"></i>\n </span>\n </div>\n </div>\n </div>\n </th>\n </tr>\n <tr>\n <th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(trunk, checked)" checklist-model checklist-value="id"></th>\n <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n <th st-sort="host">{{ \'APPLICATION_HOST\' | translate }}</th>\n <th st-sort="context">{{ \'APPLICATION_CONTEXT\' | translate }}</th>\n <th st-sort="description">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n </tr>\n </thead>\n <tbody>\n <tr data-ng-repeat="trunk in displayedTrunks" class="animate-repeat">\n <td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="trunks.checked" checklist-value="trunk.id"></td>\n <td>{{trunk.name}}</td>\n <td>{{trunk.host}}</td>\n <td>{{trunk.context}}</td>\n <td>{{trunk.description}}</td>\n <td>\n <a class="btn default btn-xs blue-stripe" data-ng-href="/trunks/view/{{trunk.id}}/settings">\n {{ \'APPLICATION_SETTINGS\' | translate}}\n </a>\n <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(trunk.name,trunk.id)">\n {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </td>\n </tr>\n <tr data-ng-hide="displayedTrunks.length">\n <td colspan="6" style="text-align:center;">\n <i>{{ \'MESSAGE_NO_TRUNKS_AVAILABLE\' | translate }}</i>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td/>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="host" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_HOST\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="context" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_CONTEXT\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="description" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_DESCRIPTION\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n </td>\n </tr>\n <tr>\n <td colspan="6" class="text-center">\n <div st-pagination class="pagination" st-items-by-page="conf.trunksByPage.value" st-displayed-pages="7"></div>\n </td>\n </tr>\n </tfoot>\n </div>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/trunk/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getTrunk()">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-link"></i>\n <a href="/trunks/list">{{ \'APPLICATION_TRUNKS\' | translate }}</a>\n <i data-ng-show="trunk" class="fa fa-angle-right"></i>\n </li>\n <li data-ng-show="trunk">\n <a href="#">{{trunk.name}}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN PROFILE SIDEBAR -->\n <div class="profile-sidebar">\n <!-- PORTLET MAIN -->\n <div class="portlet light profile-sidebar-portlet">\n <!-- SIDEBAR USERPIC -->\n <div class="profile-image">\n <img data-ng-src="assets/images/media/trunk.png" class="img-responsive">\n </div>\n <!-- END SIDEBAR USERPIC -->\n <!-- SIDEBAR USER TITLE -->\n <div class="profile-usertitle">\n <div class="profile-usertitle-name">\n {{trunk.name}}\n </div>\n <!-- <div class="profile-usertitle-job">\n {{user.role}}\n </div> -->\n </div>\n <!-- END SIDEBAR USER TITLE -->\n\n <!-- SIDEBAR MENU -->\n <div class="profile-usermenu">\n <ul class="nav">\n <li data-ng-class="{active: $state.is(\'main.trunks.view.settings\')}">\n <a data-ng-href="/trunks/view/{{trunk.id}}/settings">\n <i class="icon-settings"></i>\n {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n </li>\n </ul>\n </div>\n <!-- END MENU -->\n </div>\n <!-- END PORTLET MAIN -->\n </div>\n <!-- END BEGIN PROFILE SIDEBAR -->\n <!-- BEGIN PROFILE CONTENT -->\n <div ui-view class="profile-content">\n </div>\n <!-- END PROFILE CONTENT -->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/trunk/view/view.settings.html",'<div class="row">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_TRUNK\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n </div>\n <ul class="nav nav-tabs">\n <li class="active">\n <a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n </li>\n <li>\n <a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_ADVANCED\' | translate}}</a>\n </li>\n </ul>\n </div>\n\n <div class="portlet-body" data-ng-init="getContexts();">\n <div class="tab-content">\n <!-- GENERAL TAB -->\n <div class="tab-pane active" id="tab_1_1">\n <form name="forms.general" data-ng-submit="forms.general.$valid && updateTrunk()" novalidate>\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="trunk.name" required/>\n <span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n <div class="row">\n <div class="col-md-6">\n\n <!-- START HOST -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.host.$touched || forms.general.$submitted) && forms.general.host.$invalid}">\n <label class="control-label">{{\'APPLICATION_HOST\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="trunk.host" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_HOST\' | translate }}\n </span>\n <span data-ng-show="(forms.general.host.$touched || forms.general.$submitted) && forms.general.host.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END HOST -->\n\n <!-- START SECRET -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.secret.$touched || forms.general.$submitted) && forms.general.secret.$invalid}">\n <label class="control-label">{{\'APPLICATION_NEW_SECRET\' | translate}}</label>\n <input type="password" name="secret" placeholder="{{\'APPLICATION_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="trunk.secret">\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_SECRET\' | translate }}\n </span>\n <span data-ng-show="(forms.general.secret.$touched || forms.general.$submitted) && forms.general.secret.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END SECRET -->\n\n <!-- START CONFIRM SECRET -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.rsecret.$invalid}">\n <label class="control-label">{{\'APPLICATION_CONFIRM_SECRET\' | translate}}</label>\n <input type="password" name="rsecret" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="trunk.rsecret" nx-equal="trunk.secret"/>\n <span data-ng-show="forms.general.$submitted && (forms.general.rsecret.$invalid || forms.general.rsecret.$invalid)" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n </span>\n </div>\n <!-- END CONFIRM SECRET -->\n\n <!-- START CONTEXT -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n <label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="trunk.context" name="context" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n <div ng-bind-html="context.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_VOICE_CONTEXT\' | translate }}\n </span>\n <span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END CONTEXT -->\n\n <!-- START CALLERID -->\n <!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.general.callerid.$touched || forms.general.$submitted) && forms.general.callerid.$invalid}">\n <label class="control-label">{{\'APPLICATION_CALLERID\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="callerid" placeholder="{{\'APPLICATION_CALLERID\' | translate}}" class="form-control" data-ng-model="trunk.callerid" required/>\n <span data-ng-show="(forms.general.callerid.$touched || forms.general.$submitted) && forms.general.callerid.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div> -->\n <!-- END CALLERID -->\n\n <!-- START TYPE -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.type.$touched || forms.general.$submitted) && forms.general.type.$invalid}">\n <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="trunk.type" name="type" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'user\',\'peer\',\'friend\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_TYPE\' | translate }}\n </span>\n <span data-ng-show="(forms.general.type.$touched || forms.general.$submitted) && forms.general.type.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END TYPE -->\n\n <!-- START DTMFMODE -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.dtmfmode.$touched || forms.general.$submitted) && forms.general.dtmfmode.$invalid}">\n <label class="control-label">{{\'APPLICATION_DTMFMODE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="trunk.dtmfmode" name="dtmfmode" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected}}</ui-select-match>\n <ui-select-choices repeat="item in [\'rfc2833\', \'info\', \'shortinfo\', \'inband\',\'auto\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_DTMFMODE\' | translate }}\n </span>\n <span data-ng-show="(forms.general.dtmfmode.$touched || forms.general.$submitted) && forms.general.dtmfmode.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END DTMFMODE -->\n\n </div>\n <div class="col-md-6">\n\n <!-- START DEFAULT USER -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.defaultuser.$invalid}">\n <label class="control-label">{{\'APPLICATION_DEFAULT_USER\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="defaultuser" placeholder="{{\'APPLICATION_DEFAULT_USER\' | translate}}" class="form-control" data-ng-model="trunk.defaultuser" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_DEFAULT_USER\' | translate }}\n </span>\n <span data-ng-show="forms.general.$submitted && (forms.general.defaultuser.$invalid)" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END DEFAULT USER -->\n\n <!-- START NAT -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.nat.$touched || forms.general.$submitted) && forms.general.nat.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAT\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select multiple data-ng-model="trunk.nat" name="nat" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\', \'no\', \'never\', \'route\', \'force_rport\', \'comedia\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_NAT\' | translate }}\n </span>\n <span data-ng-show="(forms.general.nat.$touched || forms.general.$submitted) && forms.general.nat.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAT -->\n\n <!-- START QUALIFY -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.qualify.$touched || forms.general.$submitted) && forms.general.qualify.$invalid}">\n <label class="control-label">{{\'APPLICATION_QUALIFY\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="trunk.qualify" name="qualify" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_QUALIFY\' | translate }}\n </span>\n <span data-ng-show="(forms.general.qualify.$touched || forms.general.$submitted) && forms.general.qualify.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END QUALIFY -->\n\n <!-- START ALLOW -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.allow.$touched || forms.general.$submitted) && forms.general.allow.$invalid}">\n <label class="control-label">{{\'APPLICATION_ALLOW_CODEC\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select multiple data-ng-model="trunk.allow" name="allow" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n <ui-select-choices repeat="item in [\'g723\',\'gsm\',\'ulaw\',\'alaw\',\'g726\',\'g722\',\'g729\',\'ilbc\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_ALLOW_CODEC\' | translate }}\n </span>\n <span data-ng-show="(forms.general.allow.$touched || forms.general.$submitted) && forms.general.allow.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END ALLOW -->\n\n <!-- START INSECURE -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.insecure.$touched || forms.general.$submitted) && forms.general.insecure.$invalid}">\n <label class="control-label">{{\'APPLICATION_INSECURE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select multiple data-ng-model="trunk.insecure" name="insecure" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n <ui-select-choices repeat="item in [\'port\',\'invite\',\'very\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_INSECURE\' | translate }}\n </span>\n <span data-ng-show="(forms.general.insecure.$touched || forms.general.$submitted) && forms.general.insecure.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END INSECURE -->\n\n <!-- START CALLLIMIT -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.call-limit.$touched || forms.general.$submitted) && forms.general.call-limit.$invalid}">\n <label class="control-label">{{\'APPLICATION_CALLLIMIT\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="number" min="0" name="call-limit" placeholder="{{\'APPLICATION_CALLLIMIT\' | translate}}" class="form-control" data-ng-model="trunk[\'call-limit\']"/>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_CALLLIMIT\' | translate }}\n </span>\n <span data-ng-show="(forms.general.call-limit.$touched || forms.general.$submitted) && forms.general.call-limit.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END CALLLIMIT -->\n\n </div>\n </div>\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="trunk.description"></textarea>\n </div>\n <!-- END DESCRIPTION -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END GENERAL TAB -->\n <!-- ADVANCED TAB -->\n <div class="tab-pane" id="tab_1_2">\n <form name="forms.advanced" data-ng-submit="forms.advanced.$valid && updateTrunk()" novalidate>\n <div class="row">\n <div class="col-md-6">\n <!-- START LIMITONPEERS -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.limitonpeers.$touched || forms.advanced.$submitted) && forms.advanced.limitonpeers.$invalid}">\n <label class="control-label">{{\'APPLICATION_LIMITONPEERS\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="trunk.limitonpeers" name="limitonpeers" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_LIMITONPEERS\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.limitonpeers.$touched || forms.advanced.$submitted) && forms.advanced.limitonpeers.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END LIMITONPEERS -->\n\n <!-- START REGISTRY -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_REGISTRY\' | translate}}</label>\n <input type="text" name="registry" placeholder="{{\'APPLICATION_REGISTRY\' | translate}}" class="form-control" data-ng-model="trunk.registry"/>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_REGISTRY\' | translate }}\n </span>\n </div>\n <!-- END REGISTRY -->\n\n <!-- START DIRECTMEDIA -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.directmedia.$touched || forms.advanced.$submitted) && forms.advanced.directmedia.$invalid}">\n <label class="control-label">{{\'APPLICATION_DIRECTMEDIA\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="trunk.directmedia" name="directmedia" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\', \'no\', \'nonat\', \'update\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_DIRECTMEDIA\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.directmedia.$touched || forms.advanced.$submitted) && forms.advanced.directmedia.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END DIRECTMEDIA -->\n\n <!-- START CALLCOUNTER -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.callcounter.$touched || forms.advanced.$submitted) && forms.advanced.callcounter.$invalid}">\n <label class="control-label">{{\'APPLICATION_CALLCOUNTER\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="trunk.callcounter" name="callcounter" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_CALLCOUNTER\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.callcounter.$touched || forms.advanced.$submitted) && forms.advanced.callcounter.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END CALLCOUNTER -->\n\n <!-- START FROMDOMAIN -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.advanced.$submitted && forms.advanced.fromdomain.$invalid}">\n <label class="control-label">{{\'APPLICATION_FROMDOMAIN\' | translate}}</label>\n <input type="text" name="fromdomain" placeholder="{{\'APPLICATION_FROMDOMAIN\' | translate}}" class="form-control" data-ng-model="trunk.fromdomain" />\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_FROMDOMAIN\' | translate }}\n </span>\n <span data-ng-show="forms.advanced.$submitted && (forms.advanced.fromdomain.$invalid)" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END FROMDOMAIN -->\n\n <!-- START FROMUSER -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.advanced.$submitted && forms.advanced.fromuser.$invalid}">\n <label class="control-label">{{\'APPLICATION_FROMUSER\' | translate}}</label>\n <input type="text" name="fromuser" placeholder="{{\'APPLICATION_FROMUSER\' | translate}}" class="form-control" data-ng-model="trunk.fromuser" />\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_FROMUSER\' | translate }}\n </span>\n <span data-ng-show="forms.advanced.$submitted && (forms.advanced.fromuser.$invalid)" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END FROMUSER -->\n\n </div>\n <div class="col-md-6">\n\n <!-- START OUTBOUNDPROXY -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.advanced.$submitted && forms.advanced.outboundproxy.$invalid}">\n <label class="control-label">{{\'APPLICATION_OUTBOUNDPROXY\' | translate}}</label>\n <input type="text" name="outboundproxy" placeholder="{{\'APPLICATION_OUTBOUNDPROXY\' | translate}}" class="form-control" data-ng-model="trunk.outboundproxy" />\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_OUTBOUNDPROXY\' | translate }}\n </span>\n <span data-ng-show="forms.advanced.$submitted && (forms.advanced.outboundproxy.$invalid)" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END OUTBOUNDPROXY -->\n\n <!-- START USEREQPHONE -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.usereqphone.$touched || forms.advanced.$submitted) && forms.advanced.usereqphone.$invalid}">\n <label class="control-label">{{\'APPLICATION_USEREQPHONE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="trunk.usereqphone" name="usereqphone" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_USEREQPHONE\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.usereqphone.$touched || forms.advanced.$submitted) && forms.advanced.usereqphone.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END USEREQPHONE -->\n\n <!-- START TRUSTRPID -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.trustrpid.$touched || forms.advanced.$submitted) && forms.advanced.trustrpid.$invalid}">\n <label class="control-label">{{\'APPLICATION_TRUSTRPID\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="trunk.trustrpid" name="trustrpid" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_TRUSTRPID\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.trustrpid.$touched || forms.advanced.$submitted) && forms.advanced.trustrpid.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END TRUSTRPID -->\n\n <!-- START SENDRPID -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.sendrpid.$touched || forms.advanced.$submitted) && forms.advanced.sendrpid.$invalid}">\n <label class="control-label">{{\'APPLICATION_SENDRPID\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="trunk.sendrpid" name="sendrpid" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_SENDRPID\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.sendrpid.$touched || forms.advanced.$submitted) && forms.advanced.sendrpid.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END SENDRPID -->\n\n <!-- START ENCRYPTION -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.encryption.$touched || forms.advanced.$submitted) && forms.advanced.encryption.$invalid}">\n <label class="control-label">{{\'APPLICATION_ENCRYPTION\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="trunk.encryption" name="encryption" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_ENCRYPTION\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.encryption.$touched || forms.advanced.$submitted) && forms.advanced.encryption.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END ENCRYPTION -->\n\n <!-- START PORT -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.port.$touched || forms.advanced.$submitted) && forms.advanced.port.$invalid}">\n <label class="control-label">{{\'APPLICATION_PORT\' | translate}}</label>\n <input type="number" min="0" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="trunk.port"/>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_PORT\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.port.$touched || forms.advanced.$submitted) && forms.advanced.port.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END PORT -->\n\n <!-- START TRANSPORT -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.transport.$touched || forms.advanced.$submitted) && forms.advanced.transport.$invalid}">\n <label class="control-label">{{\'APPLICATION_TRANSPORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select multiple data-ng-model="trunk.transport" name="transport" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n <ui-select-choices repeat="item in [\'udp\',\'wss\',\'ws\',\'tcp\',\'tls\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_TRANSPORT\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.transport.$touched || forms.advanced.$submitted) && forms.advanced.transport.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END TRANSPORT -->\n\n </div>\n </div>\n <!-- START OTHER FIELDS-->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_OTHER_FIELDS\' | translate}}</label>\n <textarea type="text" name="otherFields" placeholder="{{\'APPLICATION_OTHER_FIELDS\' | translate}}" class="form-control" data-ng-model="trunk.otherFields"></textarea>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_OTHER_FIELDS\' | translate }}\n </span>\n </div>\n <!-- END OTHER FIELDS -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END ADVANCED TAB -->\n\n </div>\n </div>\n </div>\n </div>\n</div>\n'),
-a.put("app/trunk/wizard/wizard.html",'<div class="col-md-12" data-ng-init="initWizard()">\n <!-- BEGIN PAGE HEADER-->\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-link"></i>\n <a href="/trunks/list">{{ \'APPLICATION_TRUNKS\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-options"></i>\n <a href="#">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n </li>\n </ul>\n </div>\n <!-- END PAGE HEADER-->\n\n <!-- BEGIN PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-link font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_TRUNK\' | translate }} WIZARD</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <wizard on-finish="createItem()">\n <wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(forms.general.$valid)">\n <form name="forms.general" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n <span data-ng-show="forms.general.$submitted && forms.general.name.$invalid" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START ROLE -->\n <!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.general.role.$touched || forms.general.$submitted) && forms.general.role.$invalid}">\n <label class="control-label">{{\'APPLICATION_USAGE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="item.role" name="role" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.value}}</ui-select-match>\n <ui-select-choices repeat="type.key as type in types | filter: $select.search">\n <div ng-bind-html="type.value | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_ROLE\' | translate }}\n </span>\n <span data-ng-show="(forms.general.role.$touched || forms.general.$submitted) && forms.general.role.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div> -->\n <!-- END ROLE -->\n\n <!-- START HOST -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.host.$invalid}">\n <label class="control-label">{{\'APPLICATION_HOST\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.host" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_HOST\' | translate }}\n </span>\n <span data-ng-show="forms.general.$submitted && forms.general.host.$invalid" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END HOST -->\n\n <!-- START PASSWORD -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.password.$invalid}">\n <label class="control-label">{{\'APPLICATION_SECRET\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.secret" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_SECRET\' | translate }}\n </span>\n <span data-ng-show="forms.general.$submitted && forms.general.password.$invalid" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END PASSWORD -->\n\n <!-- START CONFIRM PASSWORD -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.rpassword.$invalid}">\n <label class="control-label">{{\'APPLICATION_CONFIRM_SECRET\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.rpassword" nx-equal="item.secret" required/>\n <span data-ng-show="forms.general.$submitted && (forms.general.rpassword.$invalid)" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n </span>\n </div>\n <!-- END CONFIRM PASSWORD -->\n\n <!-- START DEFAULT USER -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.defaultuser.$invalid}">\n <label class="control-label">{{\'APPLICATION_DEFAULT_USER\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="defaultuser" placeholder="{{\'APPLICATION_DEFAULT\' | translate}} {{\'APPLICATION_USER\' | translate}}" class="form-control" data-ng-model="item.defaultuser" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_DEFAULT_USER\' | translate }}\n </span>\n <span data-ng-show="forms.general.$submitted && (forms.general.defaultuser.$invalid)" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n </span>\n </div>\n <!-- END DEFAULT USER -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n </div>\n <!-- END DESCRIPTION -->\n\n <button class="btn green-haze" type="submit" ng-click="next(true)">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_ADVANCED\' | translate}}" canexit="exitValidation(forms.advanced.$valid)">\n <form name="forms.advanced" novalidate>\n\n <!-- START REGISTRY -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_REGISTRY\' | translate}}</label>\n <input type="text" name="registry" placeholder="{{\'APPLICATION_REGISTRY\' | translate}}" class="form-control" data-ng-model="item.registry"/>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_REGISTRY\' | translate }}\n </span>\n </div>\n <!-- END REGISTRY -->\n <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n <button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n </wz-step>\n </wizard>\n </div>\n </div>\n <!-- END PORTLET-->\n</div>\n'),a.put("app/update/list/checkout/checkout.html",'<div class="modal-header">\n <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">×</button>\n <h4 ng-if="modal.title" ng-bind="modal.title" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n <p ng-if="modal.text" ng-bind="modal.text"></p>\n <div ng-if="modal.html" ng-bind-html="modal.html"></div>\n</div>\n<div class="modal-footer">\n <button ng-repeat="button in modal.buttons" ng-class="button.classes" ng-click="button.click($event)" ng-bind="button.text" class="btn"></button>\n</div>\n'),a.put("app/update/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-cloud-download"></i>\n <a href="/updates/list">{{ \'APPLICATION_UPDATES\' | translate }}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-cloud-download font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_UPDATES\' | translate }}</a> </span>\n </div>\n <div class="actions">\n <a class="btn btn-default" href="#" data-ng-click="pull()">\n <i class="icon-cloud-download"></i> {{ \'APPLICATION_UPDATE\' | translate }}\n </a>\n </div>\n </div>\n <div class="portlet-body" data-ng-init="initList()">\n <!-- BEGIN TABLE -->\n <table st-table="displayedUpdates" st-safe-src="updates" class="table table-striped table-bordered table-hover">\n <div class="table-responsive">\n <thead>\n <tr>\n <th colspan="3">\n <div class="row">\n <div class="col-md-12">\n <ui-select class="input-xsmall" ng-model="conf.updatesByPage" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="updateByPage in updatesByPage | filter: $select.search">\n <div ng-bind-html="updateByPage.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n </div>\n </th>\n </tr>\n <tr>\n <th st-sort="message">{{ \'APPLICATION_MESSAGE\' | translate }}</th>\n <th>{{ \'APPLICATION_DATE\' | translate }}</th>\n <!-- <th class="small-cells"></th> -->\n </tr>\n </thead>\n <tbody>\n <tr data-ng-repeat="update in displayedUpdates">\n <td>\n {{update.message | truncate: 30 : \'...\': true}}\n </td>\n <td>\n <time is="relative-time" datetime="{{update.date}}">\n April 1, 2014\n </time>\n </td>\n <!-- <td>\n <a class="btn default btn-xs green-stripe" href="#" data-ng-click="checkout(update.hash)">\n <i class="icon-cloud-download"></i> {{ \'APPLICATION_CHECKOUT\' | translate }}\n </a>\n </td> -->\n </tr>\n <tr data-ng-hide="displayedUpdates.length">\n <td colspan="9" style="text-align:center;">\n <i>{{\'MESSAGE_NO_AVAILABLE_UPDATES\' | translate}}</i>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td colspan="1">\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="message" placeholder="{{ \'APPLICATION_MESSAGE\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n <td colspan="9"></td>\n </tr>\n <tr>\n <td colspan="10" class="text-center">\n <div class="pagination" st-pagination st-items-by-page="conf.updatesByPage.value" st-displayed-pages="7"></div>\n </td>\n </tr>\n </tfoot>\n </div>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/update/view/view.account.html",'<div class="row">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_ACCOUNT\' | translate}}</span>\n </div>\n <ul class="nav nav-tabs">\n <li data-ng-class="{\'active\': Auth.isAdmin()}" data-ng-show="Auth.isAdmin()">\n <a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_PERSONAL_INFO\' | translate}}</a>\n </li>\n <li data-ng-show="Auth.isAdmin()">\n <a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_CHANGE_AVATAR\' | translate}}</a>\n </li>\n <li data-ng-show="Auth.isAdmin() || update.id === Auth.getCurrentUser().id" data-ng-class="{\'active\': !Auth.isAdmin() && update.id === Auth.getCurrentUser().id}">\n <a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_CHANGE_PASSWORD\' | translate}}</a>\n </li>\n </ul>\n </div>\n\n <div class="portlet-body">\n <div class="tab-content">\n <!-- PERSONAL INFO TAB -->\n <div class="tab-pane" data-ng-class="{\'active\': Auth.isAdmin()}" data-ng-show="Auth.isAdmin()" id="tab_1_1">\n <form name="forms.info" data-ng-submit="updateItem()" novalidate>\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="update.fullname" required/>\n <span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START USERNAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="update.name" required/>\n <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END USERNAME -->\n\n <!-- START EMAIL -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="update.email" required/>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n </span>\n </div>\n <!-- END EMAIL -->\n\n <!-- START INTERNAL -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$invalid}">\n <label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="update.internal" required disabled/>\n <span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END INTERNAL -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END PERSONAL INFO TAB -->\n <!-- CHANGE AVATAR TAB -->\n <div class="tab-pane" data-ng-show="Auth.isAdmin()" id="tab_1_2">\n <form action="#" role="form">\n <div class="form-group">\n <div class="fileinput fileinput-new" data-provides="fileinput">\n <div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">\n <img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&text=no+image" alt=""/>\n </div>\n <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;">\n </div>\n <div>\n <span class="btn default btn-file" data-ng-show="!uploader.queue[0]">\n <span> {{ \'APPLICATION_SELECT_IMAGE\' | translate }} </span>\n <input type="file" nv-file-select="" uploader="uploader" /><br/>\n </span>\n <button type="button" class="btn default" data-ng-show="uploader.queue[0]" data-dismiss="fileinput" ng-click="uploader.queue[0].remove()">\n {{ \'APPLICATION_REMOVE\' | translate }}\n </button>\n <button type="button" class="btn green-haze" data-ng-show="uploader.queue[0]" data-ng-click="uploader.queue[0].upload()" ng-disabled="uploader.queue[0].isReady || uploader.queue[0].isUploading || uploader.queue[0].isSuccess">\n {{ \'APPLICATION_CONFIRM\' | translate }}\n </button>\n </div>\n <p>\n </br> {{ \'MESSAGE_SUPPORTED_FORMATS\' | translate }} <b>jpg, png, jpeg</b>.\n </p>\n </div>\n </div>\n </form>\n <div class="row">\n <div class="col-md-2">\n <table class="table" border="0">\n <tbody>\n <tr data-ng-repeat="item in uploader.queue">\n <td style="border-top-style:none">\n <strong>\n {{ item.file.name }}\n </strong>\n </td>\n <td data-ng-show="uploader.isHTML5" nowrap style="border-top-style:none">\n {{ item.file.size/1024/1024|number:2 }} MB\n </td>\n <td nowrap style="border-top-style:none">\n <button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n <span class="glyphicon glyphicon-trash"></span> Remove\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <!-- END CHANGE AVATAR TAB -->\n <!-- CHANGE PASSWORD TAB -->\n <div class="tab-pane" data-ng-show="Auth.isAdmin() || update.id === Auth.getCurrentUser().id" data-ng-class="{\'active\': !Auth.isAdmin() && update.id === Auth.getCurrentUser().id}" id="tab_1_3">\n <form name="forms.changePwd" data-ng-submit="forms.changePwd.$valid && updatePassword()" novalidate>\n <!-- START CURRENT PWD -->\n <div class="form-group" data-ng-if="!Auth.isAdmin()" data-ng-class="{\'has-error\': (forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$invalid}">\n <label class="control-label">{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="current_pwd" placeholder="{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}" class="form-control" data-ng-model="update.currentPwd" required/>\n <span data-ng-show="(forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END CURRENT PWD -->\n <!-- START NEW PWD -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid}">\n <label class="control-label">{{\'APPLICATION_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="new_pwd" placeholder="{{\'APPLICATION_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="update.newPwd" required/>\n <span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NEW PWD -->\n <!-- START RE-NEW PWD -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.re_new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.re_new_pwd.$invalid}">\n <label class="control-label">{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="re_new_pwd" placeholder="{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="update.reNewPwd" nx-equal="update.newPwd" required/>\n <span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END RE-NEW PWD -->\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END CHANGE PASSWORD TAB -->\n </div>\n </div>\n </div>\n </div>\n</div>\n'),a.put("app/update/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-people"></i>\n <a href="/updates/list">{{ \'APPLICATION_UPDATES\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <a href="#">{{update.fullname}}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN PROFILE SIDEBAR -->\n <div class="profile-sidebar">\n <!-- PORTLET MAIN -->\n <div class="portlet light profile-sidebar-portlet">\n <!-- SIDEBAR USERPIC -->\n <div class="profile-userpic">\n <img ng-src="api/users/avatar/{{update.userpic ? update.userpic : \'unknown_avatar\'}}" class="img-responsive">\n </div>\n <!-- END SIDEBAR USERPIC -->\n\n <!-- START SIDEBAR USER TITLE -->\n <div class="profile-usertitle">\n <div class="profile-usertitle-name">\n {{update.fullname}}\n </div>\n <div class="profile-usertitle-job">\n {{update.role}}\n </div>\n </div>\n <!-- END SIDEBAR USER TITLE -->\n\n <!-- SIDEBAR MENU -->\n <div class="profile-usermenu">\n <ul class="nav">\n <li data-ng-class="{active: $state.is(\'main.updates.view.account\')}">\n <a data-ng-href="/updates/view/{{update.id}}/account">\n <i class="icon-user"></i>\n {{ \'APPLICATION_ACCOUNT\' | translate}} </a>\n </li>\n </ul>\n </div>\n <!-- END MENU -->\n </div>\n <!-- END PORTLET MAIN -->\n </div>\n <!-- END BEGIN PROFILE SIDEBAR -->\n\n <!-- BEGIN PROFILE CONTENT -->\n <div ui-view class="profile-content">\n </div>\n <!-- END PROFILE CONTENT -->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/update/wizard/wizard.html",'<div class="col-md-12">\n <!-- BEGIN PAGE HEADER-->\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-people"></i>\n <a href="/updates/list">{{ \'APPLICATION_UPDATES\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-options"></i>\n <a href="/updates/wizard">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n </li>\n </ul>\n </div>\n <!-- END PAGE HEADER-->\n\n <!-- BEGIN PORTLET-->\n <div class="portlet light bordered" ng-init="getFirstFreeInternal();">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-user font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_UPDATE\' | translate }} WIZARD</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <wizard on-finish="createItem()">\n <wz-step title="{{\'APPLICATION_ACCOUNT\' | translate}}" canexit="exitValidation(forms.info.$valid)">\n <form name="forms.info" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n <span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START USERNAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.name" required ng-remote-validate="/api/updates/validate/name"/>\n <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.ngRemoteValidate" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n </span>\n </div>\n <!-- END USERNAME -->\n\n <!-- START EMAIL -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="item.email" required ng-remote-validate="/api/updates/validate/email"/>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.ngRemoteValidate" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_EMAIL\' | translate}}.\n </span>\n </div>\n <!-- END EMAIL -->\n\n <!-- START PASSWORD -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid}">\n <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n <span data-ng-show="(forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END PASSWORD -->\n\n <!-- START RE PASSWORD -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$invalid}">\n <label class="control-label">{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.rpassword" nx-equal="item.password" required/>\n <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.nxEqual" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n </span>\n </div>\n <!-- END RE PASSWORD -->\n\n <!-- START INTERNAL -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$invalid}">\n <label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n <div class="input-group">\n <input type="number" min="1" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="item.internal" data-ng-disabled="!item.internalEnabled" data-ng-required="item.internalEnabled" ng-remote-validate="/api/updates/validate/internal"/>\n <span class="input-group-addon">\n <input type="checkbox" data-ng-model="item.internalEnabled">\n </span>\n </div>\n <span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.ngRemoteValidate" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_INTERNAL\' | translate}}.\n </span>\n </div>\n <!-- END INTERNAL -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_VOICE\' | translate}}" canexit="exitValidation(forms.voice.$valid)">\n <form name="forms.voice" novalidate>\n\n <!-- START ACCOUNTCODE -->\n <!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.voice.accountcode.$touched || forms.voice.$submitted) && forms.voice.accountcode.$invalid}">\n <label class="control-label">{{\'APPLICATION_ACCOUNTCODE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="number" name="accountcode" placeholder="{{\'APPLICATION_ACCOUNTCODE\' | translate}}" class="form-control" data-ng-model="item.accountcode" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_VOICE_HOST\' | translate }}\n </span>\n <span data-ng-show="(forms.voice.accountcode.$touched || forms.voice.$submitted) && forms.voice.accountcode.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div> -->\n <!-- END ACCOUNTCODE -->\n\n <!-- START TRANSPORT -->\n <div class="form-group">\n <label class="control-label">{{ \'APPLICATION_TRANSPORT\' | translate}}</label>\n <ui-select multiple name="transport" ng-model="item.transport" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="Select transport...">{{$item}}</ui-select-match>\n <ui-select-choices repeat="transport in [\'udp\', \'tcp\', \'ws\', \'wss\'] | filter: $select.search">\n {{transport}}\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_VOICE_TRANSPORT\' | translate }}\n </span>\n </div>\n <!-- END TRANSPORT -->\n\n <!-- START HOST -->\n <!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.voice.host.$touched || forms.voice.$submitted) && forms.voice.host.$invalid}">\n <label class="control-label">{{\'APPLICATION_HOST\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.host" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_VOICE_HOST\' | translate }}\n </span>\n <span data-ng-show="(forms.voice.host.$touched || forms.voice.$submitted) && forms.voice.host.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div> -->\n <!-- END HOST -->\n\n <!-- START NAT -->\n <!-- <div class="form-group">\n <label class="control-label">{{ \'APPLICATION_NAT\' | translate}}</label>\n <ui-select multiple ng-model="item.nat" name="nat" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{ \'APPLICATION_SEARCH_FILTER\' | translate }}">{{$item}}</ui-select-match>\n <ui-select-choices repeat="nat in [\'yes\', \'no\', \'never\', \'route\', \'force_rport\', \'comedia\'] | filter: $select.search">\n {{nat}}\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_VOICE_NAT\' | translate }}\n </span>\n </div> -->\n\n <!-- END NAT -->\n\n <!-- START TYPE -->\n <!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.voice.type.$touched || forms.voice.$submitted) && forms.voice.type.$invalid}">\n <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="item.type" name="type" theme="bootstrap" required>\n <ui-select-match placeholder="{{ \'APPLICATION_SEARCH_FILTER\' | translate }}">{{$select.selected}}</ui-select-match>\n <ui-select-choices repeat="type in [\'friend\', \'user\', \'peer\'] | filter: $select.search">\n <div ng-bind-html="type | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_VOICE_TYPE\' | translate }}\n </span>\n <span data-ng-show="(forms.voice.type.$touched || forms.voice.$submitted) && forms.voice.type.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div> -->\n <!-- END TYPE -->\n\n <!-- START CODEC -->\n <div class="form-group">\n <label class="control-label">{{ \'APPLICATION_ALLOWED_CODECS\' | translate}}</label>\n <ui-select multiple ng-model="item.allow" name="allow" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="Select codec...">{{$item}}</ui-select-match>\n <ui-select-choices repeat="allow in [\'g729\', \'ilbc\', \'gsm\', \'ulaw\', \'alaw\'] | filter: $select.search">\n {{allow}}\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_VOICE_CODEC\' | translate }}\n </span>\n </div>\n <!-- END CODEC -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n </wz-step>\n </wizard>\n </div>\n </div>\n <!-- END PORTLET-->\n</div>\n'),
+a.put("app/trunk/wizard/wizard.html",'<div class="col-md-12" data-ng-init="initWizard()">\n <!-- BEGIN PAGE HEADER-->\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-link"></i>\n <a href="/trunks/list">{{ \'APPLICATION_TRUNKS\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-options"></i>\n <a href="#">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n </li>\n </ul>\n </div>\n <!-- END PAGE HEADER-->\n\n <!-- BEGIN PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-link font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_TRUNK\' | translate }} WIZARD</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <wizard on-finish="createItem()">\n <wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(forms.general.$valid)">\n <form name="forms.general" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n <span data-ng-show="forms.general.$submitted && forms.general.name.$invalid" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START ROLE -->\n <!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.general.role.$touched || forms.general.$submitted) && forms.general.role.$invalid}">\n <label class="control-label">{{\'APPLICATION_USAGE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="item.role" name="role" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.value}}</ui-select-match>\n <ui-select-choices repeat="type.key as type in types | filter: $select.search">\n <div ng-bind-html="type.value | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_ROLE\' | translate }}\n </span>\n <span data-ng-show="(forms.general.role.$touched || forms.general.$submitted) && forms.general.role.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div> -->\n <!-- END ROLE -->\n\n <!-- START HOST -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.host.$invalid}">\n <label class="control-label">{{\'APPLICATION_HOST\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.host" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_HOST\' | translate }}\n </span>\n <span data-ng-show="forms.general.$submitted && forms.general.host.$invalid" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END HOST -->\n\n <!-- START PASSWORD -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.password.$invalid}">\n <label class="control-label">{{\'APPLICATION_SECRET\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.secret" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_SECRET\' | translate }}\n </span>\n <span data-ng-show="forms.general.$submitted && forms.general.password.$invalid" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END PASSWORD -->\n\n <!-- START CONFIRM PASSWORD -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.rpassword.$invalid}">\n <label class="control-label">{{\'APPLICATION_CONFIRM_SECRET\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.rpassword" nx-equal="item.secret" required/>\n <span data-ng-show="forms.general.$submitted && (forms.general.rpassword.$invalid)" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n </span>\n </div>\n <!-- END CONFIRM PASSWORD -->\n\n <!-- START DEFAULT USER -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.defaultuser.$invalid}">\n <label class="control-label">{{\'APPLICATION_DEFAULT_USER\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="defaultuser" placeholder="{{\'APPLICATION_DEFAULT\' | translate}} {{\'APPLICATION_USER\' | translate}}" class="form-control" data-ng-model="item.defaultuser" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_DEFAULT_USER\' | translate }}\n </span>\n <span data-ng-show="forms.general.$submitted && (forms.general.defaultuser.$invalid)" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n </span>\n </div>\n <!-- END DEFAULT USER -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n </div>\n <!-- END DESCRIPTION -->\n\n <button class="btn green-haze" type="submit" ng-click="next(true)">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_ADVANCED\' | translate}}" canexit="exitValidation(forms.advanced.$valid)">\n <form name="forms.advanced" novalidate>\n\n <!-- START REGISTRY -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_REGISTRY\' | translate}}</label>\n <input type="text" name="registry" placeholder="{{\'APPLICATION_REGISTRY\' | translate}}" class="form-control" data-ng-model="item.registry"/>\n <span class="help-block">\n {{ \'DESCRIPTION_TRUNK_REGISTRY\' | translate }}\n </span>\n </div>\n <!-- END REGISTRY -->\n <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n <button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n </wz-step>\n </wizard>\n </div>\n </div>\n <!-- END PORTLET-->\n</div>\n'),a.put("app/update/list/checkout/checkout.html",'<div class="modal-header">\n <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">×</button>\n <h4 ng-if="modal.title" ng-bind="modal.title" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n <p ng-if="modal.text" ng-bind="modal.text"></p>\n <div ng-if="modal.html" ng-bind-html="modal.html"></div>\n</div>\n<div class="modal-footer">\n <button ng-repeat="button in modal.buttons" ng-class="button.classes" ng-click="button.click($event)" ng-bind="button.text" class="btn"></button>\n</div>\n'),a.put("app/update/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-cloud-download"></i>\n <a href="/updates/list">{{ \'APPLICATION_UPDATES\' | translate }}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-cloud-download font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_UPDATES\' | translate }}</a> </span>\n </div>\n <div class="actions">\n <a class="btn btn-default" href="#" data-ng-click="pull()">\n <i class="icon-cloud-download"></i> {{ \'APPLICATION_UPDATE\' | translate }}\n </a>\n </div>\n </div>\n <div class="portlet-body" data-ng-init="initList()">\n <!-- BEGIN TABLE -->\n <table st-table="displayedUpdates" st-safe-src="updates" class="table table-striped table-bordered table-hover">\n <div class="table-responsive">\n <thead>\n <tr>\n <th colspan="3">\n <div class="row">\n <div class="col-md-12">\n <ui-select class="input-xsmall" ng-model="conf.updatesByPage" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="updateByPage in updatesByPage | filter: $select.search">\n <div ng-bind-html="updateByPage.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n </div>\n </th>\n </tr>\n <tr>\n <th st-sort="message">{{ \'APPLICATION_MESSAGE\' | translate }}</th>\n <th st-sort="version">{{ \'APPLICATION_VERSION\' | translate }}</th>\n <th>{{ \'APPLICATION_DATE\' | translate }}</th>\n <!-- <th class="small-cells"></th> -->\n </tr>\n </thead>\n <tbody>\n <tr data-ng-repeat="update in displayedUpdates">\n <td>\n {{update.message}}\n </td>\n <td>\n {{update.version}}\n </td>\n <td>\n {{update.date}}\n </td>\n <!-- <td>\n <a class="btn default btn-xs green-stripe" href="#" data-ng-click="checkout(update.hash)">\n <i class="icon-cloud-download"></i> {{ \'APPLICATION_CHECKOUT\' | translate }}\n </a>\n </td> -->\n </tr>\n <tr data-ng-hide="displayedUpdates.length">\n <td colspan="9" style="text-align:center;">\n <i>{{\'MESSAGE_NO_AVAILABLE_UPDATES\' | translate}}</i>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td colspan="1">\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="message" placeholder="{{ \'APPLICATION_MESSAGE\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n <td colspan="9"></td>\n </tr>\n <tr>\n <td colspan="10" class="text-center">\n <div class="pagination" st-pagination st-items-by-page="conf.updatesByPage.value" st-displayed-pages="7"></div>\n </td>\n </tr>\n </tfoot>\n </div>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/update/view/view.account.html",'<div class="row">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_ACCOUNT\' | translate}}</span>\n </div>\n <ul class="nav nav-tabs">\n <li data-ng-class="{\'active\': Auth.isAdmin()}" data-ng-show="Auth.isAdmin()">\n <a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_PERSONAL_INFO\' | translate}}</a>\n </li>\n <li data-ng-show="Auth.isAdmin()">\n <a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_CHANGE_AVATAR\' | translate}}</a>\n </li>\n <li data-ng-show="Auth.isAdmin() || update.id === Auth.getCurrentUser().id" data-ng-class="{\'active\': !Auth.isAdmin() && update.id === Auth.getCurrentUser().id}">\n <a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_CHANGE_PASSWORD\' | translate}}</a>\n </li>\n </ul>\n </div>\n\n <div class="portlet-body">\n <div class="tab-content">\n <!-- PERSONAL INFO TAB -->\n <div class="tab-pane" data-ng-class="{\'active\': Auth.isAdmin()}" data-ng-show="Auth.isAdmin()" id="tab_1_1">\n <form name="forms.info" data-ng-submit="updateItem()" novalidate>\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="update.fullname" required/>\n <span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START USERNAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="update.name" required/>\n <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END USERNAME -->\n\n <!-- START EMAIL -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="update.email" required/>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n </span>\n </div>\n <!-- END EMAIL -->\n\n <!-- START INTERNAL -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$invalid}">\n <label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="update.internal" required disabled/>\n <span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END INTERNAL -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END PERSONAL INFO TAB -->\n <!-- CHANGE AVATAR TAB -->\n <div class="tab-pane" data-ng-show="Auth.isAdmin()" id="tab_1_2">\n <form action="#" role="form">\n <div class="form-group">\n <div class="fileinput fileinput-new" data-provides="fileinput">\n <div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">\n <img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&text=no+image" alt=""/>\n </div>\n <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;">\n </div>\n <div>\n <span class="btn default btn-file" data-ng-show="!uploader.queue[0]">\n <span> {{ \'APPLICATION_SELECT_IMAGE\' | translate }} </span>\n <input type="file" nv-file-select="" uploader="uploader" /><br/>\n </span>\n <button type="button" class="btn default" data-ng-show="uploader.queue[0]" data-dismiss="fileinput" ng-click="uploader.queue[0].remove()">\n {{ \'APPLICATION_REMOVE\' | translate }}\n </button>\n <button type="button" class="btn green-haze" data-ng-show="uploader.queue[0]" data-ng-click="uploader.queue[0].upload()" ng-disabled="uploader.queue[0].isReady || uploader.queue[0].isUploading || uploader.queue[0].isSuccess">\n {{ \'APPLICATION_CONFIRM\' | translate }}\n </button>\n </div>\n <p>\n </br> {{ \'MESSAGE_SUPPORTED_FORMATS\' | translate }} <b>jpg, png, jpeg</b>.\n </p>\n </div>\n </div>\n </form>\n <div class="row">\n <div class="col-md-2">\n <table class="table" border="0">\n <tbody>\n <tr data-ng-repeat="item in uploader.queue">\n <td style="border-top-style:none">\n <strong>\n {{ item.file.name }}\n </strong>\n </td>\n <td data-ng-show="uploader.isHTML5" nowrap style="border-top-style:none">\n {{ item.file.size/1024/1024|number:2 }} MB\n </td>\n <td nowrap style="border-top-style:none">\n <button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n <span class="glyphicon glyphicon-trash"></span> Remove\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <!-- END CHANGE AVATAR TAB -->\n <!-- CHANGE PASSWORD TAB -->\n <div class="tab-pane" data-ng-show="Auth.isAdmin() || update.id === Auth.getCurrentUser().id" data-ng-class="{\'active\': !Auth.isAdmin() && update.id === Auth.getCurrentUser().id}" id="tab_1_3">\n <form name="forms.changePwd" data-ng-submit="forms.changePwd.$valid && updatePassword()" novalidate>\n <!-- START CURRENT PWD -->\n <div class="form-group" data-ng-if="!Auth.isAdmin()" data-ng-class="{\'has-error\': (forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$invalid}">\n <label class="control-label">{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="current_pwd" placeholder="{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}" class="form-control" data-ng-model="update.currentPwd" required/>\n <span data-ng-show="(forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END CURRENT PWD -->\n <!-- START NEW PWD -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid}">\n <label class="control-label">{{\'APPLICATION_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="new_pwd" placeholder="{{\'APPLICATION_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="update.newPwd" required/>\n <span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NEW PWD -->\n <!-- START RE-NEW PWD -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.re_new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.re_new_pwd.$invalid}">\n <label class="control-label">{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="re_new_pwd" placeholder="{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="update.reNewPwd" nx-equal="update.newPwd" required/>\n <span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END RE-NEW PWD -->\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END CHANGE PASSWORD TAB -->\n </div>\n </div>\n </div>\n </div>\n</div>\n'),a.put("app/update/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-people"></i>\n <a href="/updates/list">{{ \'APPLICATION_UPDATES\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <a href="#">{{update.fullname}}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN PROFILE SIDEBAR -->\n <div class="profile-sidebar">\n <!-- PORTLET MAIN -->\n <div class="portlet light profile-sidebar-portlet">\n <!-- SIDEBAR USERPIC -->\n <div class="profile-userpic">\n <img ng-src="api/users/avatar/{{update.userpic ? update.userpic : \'unknown_avatar\'}}" class="img-responsive">\n </div>\n <!-- END SIDEBAR USERPIC -->\n\n <!-- START SIDEBAR USER TITLE -->\n <div class="profile-usertitle">\n <div class="profile-usertitle-name">\n {{update.fullname}}\n </div>\n <div class="profile-usertitle-job">\n {{update.role}}\n </div>\n </div>\n <!-- END SIDEBAR USER TITLE -->\n\n <!-- SIDEBAR MENU -->\n <div class="profile-usermenu">\n <ul class="nav">\n <li data-ng-class="{active: $state.is(\'main.updates.view.account\')}">\n <a data-ng-href="/updates/view/{{update.id}}/account">\n <i class="icon-user"></i>\n {{ \'APPLICATION_ACCOUNT\' | translate}} </a>\n </li>\n </ul>\n </div>\n <!-- END MENU -->\n </div>\n <!-- END PORTLET MAIN -->\n </div>\n <!-- END BEGIN PROFILE SIDEBAR -->\n\n <!-- BEGIN PROFILE CONTENT -->\n <div ui-view class="profile-content">\n </div>\n <!-- END PROFILE CONTENT -->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/update/wizard/wizard.html",'<div class="col-md-12">\n <!-- BEGIN PAGE HEADER-->\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-people"></i>\n <a href="/updates/list">{{ \'APPLICATION_UPDATES\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-options"></i>\n <a href="/updates/wizard">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n </li>\n </ul>\n </div>\n <!-- END PAGE HEADER-->\n\n <!-- BEGIN PORTLET-->\n <div class="portlet light bordered" ng-init="getFirstFreeInternal();">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-user font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_UPDATE\' | translate }} WIZARD</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <wizard on-finish="createItem()">\n <wz-step title="{{\'APPLICATION_ACCOUNT\' | translate}}" canexit="exitValidation(forms.info.$valid)">\n <form name="forms.info" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n <span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START USERNAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.name" required ng-remote-validate="/api/updates/validate/name"/>\n <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.ngRemoteValidate" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n </span>\n </div>\n <!-- END USERNAME -->\n\n <!-- START EMAIL -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="item.email" required ng-remote-validate="/api/updates/validate/email"/>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.ngRemoteValidate" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_EMAIL\' | translate}}.\n </span>\n </div>\n <!-- END EMAIL -->\n\n <!-- START PASSWORD -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid}">\n <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n <span data-ng-show="(forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END PASSWORD -->\n\n <!-- START RE PASSWORD -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$invalid}">\n <label class="control-label">{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.rpassword" nx-equal="item.password" required/>\n <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.nxEqual" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n </span>\n </div>\n <!-- END RE PASSWORD -->\n\n <!-- START INTERNAL -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$invalid}">\n <label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n <div class="input-group">\n <input type="number" min="1" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="item.internal" data-ng-disabled="!item.internalEnabled" data-ng-required="item.internalEnabled" ng-remote-validate="/api/updates/validate/internal"/>\n <span class="input-group-addon">\n <input type="checkbox" data-ng-model="item.internalEnabled">\n </span>\n </div>\n <span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.ngRemoteValidate" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_INTERNAL\' | translate}}.\n </span>\n </div>\n <!-- END INTERNAL -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_VOICE\' | translate}}" canexit="exitValidation(forms.voice.$valid)">\n <form name="forms.voice" novalidate>\n\n <!-- START ACCOUNTCODE -->\n <!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.voice.accountcode.$touched || forms.voice.$submitted) && forms.voice.accountcode.$invalid}">\n <label class="control-label">{{\'APPLICATION_ACCOUNTCODE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="number" name="accountcode" placeholder="{{\'APPLICATION_ACCOUNTCODE\' | translate}}" class="form-control" data-ng-model="item.accountcode" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_VOICE_HOST\' | translate }}\n </span>\n <span data-ng-show="(forms.voice.accountcode.$touched || forms.voice.$submitted) && forms.voice.accountcode.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div> -->\n <!-- END ACCOUNTCODE -->\n\n <!-- START TRANSPORT -->\n <div class="form-group">\n <label class="control-label">{{ \'APPLICATION_TRANSPORT\' | translate}}</label>\n <ui-select multiple name="transport" ng-model="item.transport" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="Select transport...">{{$item}}</ui-select-match>\n <ui-select-choices repeat="transport in [\'udp\', \'tcp\', \'ws\', \'wss\'] | filter: $select.search">\n {{transport}}\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_VOICE_TRANSPORT\' | translate }}\n </span>\n </div>\n <!-- END TRANSPORT -->\n\n <!-- START HOST -->\n <!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.voice.host.$touched || forms.voice.$submitted) && forms.voice.host.$invalid}">\n <label class="control-label">{{\'APPLICATION_HOST\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.host" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_VOICE_HOST\' | translate }}\n </span>\n <span data-ng-show="(forms.voice.host.$touched || forms.voice.$submitted) && forms.voice.host.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div> -->\n <!-- END HOST -->\n\n <!-- START NAT -->\n <!-- <div class="form-group">\n <label class="control-label">{{ \'APPLICATION_NAT\' | translate}}</label>\n <ui-select multiple ng-model="item.nat" name="nat" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{ \'APPLICATION_SEARCH_FILTER\' | translate }}">{{$item}}</ui-select-match>\n <ui-select-choices repeat="nat in [\'yes\', \'no\', \'never\', \'route\', \'force_rport\', \'comedia\'] | filter: $select.search">\n {{nat}}\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_VOICE_NAT\' | translate }}\n </span>\n </div> -->\n\n <!-- END NAT -->\n\n <!-- START TYPE -->\n <!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.voice.type.$touched || forms.voice.$submitted) && forms.voice.type.$invalid}">\n <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="item.type" name="type" theme="bootstrap" required>\n <ui-select-match placeholder="{{ \'APPLICATION_SEARCH_FILTER\' | translate }}">{{$select.selected}}</ui-select-match>\n <ui-select-choices repeat="type in [\'friend\', \'user\', \'peer\'] | filter: $select.search">\n <div ng-bind-html="type | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_VOICE_TYPE\' | translate }}\n </span>\n <span data-ng-show="(forms.voice.type.$touched || forms.voice.$submitted) && forms.voice.type.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div> -->\n <!-- END TYPE -->\n\n <!-- START CODEC -->\n <div class="form-group">\n <label class="control-label">{{ \'APPLICATION_ALLOWED_CODECS\' | translate}}</label>\n <ui-select multiple ng-model="item.allow" name="allow" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="Select codec...">{{$item}}</ui-select-match>\n <ui-select-choices repeat="allow in [\'g729\', \'ilbc\', \'gsm\', \'ulaw\', \'alaw\'] | filter: $select.search">\n {{allow}}\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_VOICE_CODEC\' | translate }}\n </span>\n </div>\n <!-- END CODEC -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n </wz-step>\n </wizard>\n </div>\n </div>\n <!-- END PORTLET-->\n</div>\n'),
a.put("app/user/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-eye"></i>\n <a href="/users/list">{{ \'APPLICATION_USERS\' | translate }}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-eye font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_USERS\' | translate }}</a> </span>\n </div>\n <div class="actions">\n <div class="btn-group" data-ng-show="users.checked.length">\n <a class="btn red" href="#" data-ng-click="deleteItems()">\n <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </div>\n <div class="btn-group">\n <a class="btn green-jungle " href="#" data-toggle="dropdown">\n <i class="icon-plus"></i> {{ \'APPLICATION_NEW_USER\' | translate }} <i class="fa fa-angle-down"></i>\n </a>\n <ul class="dropdown-menu pull-right">\n <li>\n <a href="/users/wizard">\n <i class="icon-user-following"></i> {{ \'APPLICATION_WIZARD\' | translate }} </a>\n </li>\n </ul>\n </div>\n <a class="btn btn-icon-only btn-default" href="#" ng-csv="getUsers([\'name\', \'fullname\', \'email\'])" csv-header="[\'Username\', \'Fullname\', \'Email\']" field-separator=";" filename="users.csv">\n <i class="icon-cloud-download"></i></a>\n <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n </div>\n </div>\n <div class="portlet-body">\n <!-- START TABLE -->\n <table id="table" st-table="displayedUsers" st-pipe="initList" class="table table-striped table-bordered table-hover">\n <div class="table-responsive">\n <thead>\n <tr>\n <th colspan="6">\n <div class="row">\n <div class="col-md-6">\n <ui-select class="input-xsmall" ng-model="conf.usersByPage" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="userByPage in usersByPage | filter: $select.search">\n <div ng-bind-html="userByPage.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n <div class="col-md-6">\n <div class="input-group input-medium pull-right">\n <input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n <span class="input-group-addon">\n <i class="fa fa-search"></i>\n </span>\n </div>\n </div>\n </div>\n </th>\n </tr>\n <tr>\n <th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(user, checked)" checklist-model checklist-value="id"></th>\n <th st-sort="fullname">{{ \'APPLICATION_FULLNAME\' | translate }}</th>\n <th st-sort="name">{{ \'APPLICATION_USERNAME\' | translate }}</th>\n <th st-sort="email">{{ \'APPLICATION_EMAIL\' | translate }}</th>\n <th st-sort="role">{{ \'APPLICATION_ROLE\' | translate }}</th>\n <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n </tr>\n </thead>\n <tbody>\n <tr data-ng-repeat="user in displayedUsers" class="animate-repeat">\n <td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="users.checked" checklist-value="user.id"></td>\n <td>{{user.fullname}}</td>\n <td>{{user.name}}</td>\n <td><a ng-href="mailto:{{user.email}}">{{user.email}}</a></td>\n <td>{{user.role}}</td>\n <td>\n <a class="btn default btn-xs blue-stripe" data-ng-href="/users/view/{{user.id}}/account">\n {{ \'APPLICATION_PROFILE\' | translate }}\n </a>\n <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(user.fullname, user.id)">\n {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </td>\n </tr>\n <tr data-ng-hide="displayedUsers.length">\n <td colspan="6" style="text-align:center;">\n <i>No users available</i>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td/>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="fullname" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_USERNAME\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="email" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_EMAIL\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="role" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_ROLE\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td/>\n </tr>\n <tr>\n <td colspan="6" class="text-center">\n <div st-pagination class="pagination" st-items-by-page="conf.usersByPage.value" st-displayed-pages="7"></div>\n </td>\n </tr>\n </tfoot>\n </div>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/user/view/view.account.html",'<div class="row">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_ACCOUNT\' | translate}}</span>\n </div>\n <ul class="nav nav-tabs">\n <li class="active">\n <a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_PERSONAL_INFO\' | translate}}</a>\n </li>\n <li>\n <a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_CHANGE_AVATAR\' | translate}}</a>\n </li>\n <li>\n <a href="#" data-ng-show="Auth.isAdmin() || user.id === getCurrentUser().id" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_CHANGE_PASSWORD\' | translate}}</a>\n </li>\n </ul>\n </div>\n\n <div class="portlet-body">\n <div class="tab-content">\n <!-- PERSONAL INFO TAB -->\n <div class="tab-pane active" id="tab_1_1">\n <form name="forms.info" data-ng-submit="updateItem()" novalidate>\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="user.fullname" required/>\n <span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START USERNAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="user.name" required/>\n <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END USERNAME -->\n\n <!-- START EMAIL -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="user.email" required/>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n </span>\n </div>\n <!-- END EMAIL -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END PERSONAL INFO TAB -->\n <!-- CHANGE AVATAR TAB -->\n <div class="tab-pane" id="tab_1_2">\n <form action="#" role="form">\n <div class="form-group">\n <div class="fileinput fileinput-new" data-provides="fileinput">\n <div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">\n <img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&text=no+image" alt=""/>\n </div>\n <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;">\n </div>\n <div>\n <span class="btn default btn-file" data-ng-show="!uploader.queue[0]">\n <span> {{ \'APPLICATION_SELECT_IMAGE\' | translate }} </span>\n <input type="file" nv-file-select="" uploader="uploader" /><br/>\n </span>\n <button type="button" class="btn default" data-ng-show="uploader.queue[0]" data-dismiss="fileinput" ng-click="uploader.queue[0].remove()">\n <span> {{ \'APPLICATION_REMOVE\' | translate }} </span>\n </button>\n <button type="button" class="btn green-haze" data-ng-show="uploader.queue[0]" data-ng-click="uploader.queue[0].upload()" ng-disabled="uploader.queue[0].isReady || uploader.queue[0].isUploading || uploader.queue[0].isSuccess">\n <span> {{ \'APPLICATION_CONFIRM\' | translate }} </span>\n </button>\n </div>\n <p>\n </br> {{ \'MESSAGE_SUPPORTED_FORMATS\' | translate }} <b>jpg, png, jpeg</b>.\n </p>\n </div>\n </div>\n </form>\n <div class="row">\n <div class="col-md-2">\n <table class="table" border="0">\n <tbody>\n <tr data-ng-repeat="item in uploader.queue">\n <td style="border-top-style:none">\n <strong>\n {{ item.file.name }}\n </strong>\n </td>\n <td data-ng-show="uploader.isHTML5" nowrap style="border-top-style:none">\n {{ item.file.size/1024/1024|number:2 }} MB\n </td>\n <td nowrap style="border-top-style:none">\n <button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n <span class="glyphicon glyphicon-trash"></span> Remove\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <!-- END CHANGE AVATAR TAB -->\n <!-- CHANGE PASSWORD TAB -->\n <div class="tab-pane" id="tab_1_3" data-ng-show="Auth.isAdmin() || user.id === getCurrentUser().id">\n <form name="forms.changePwd" data-ng-submit="forms.changePwd.$valid && updatePassword()" novalidate>\n <!-- START CURRENT PWD -->\n <div class="form-group" data-ng-if="!Auth.isAdmin()" data-ng-class="{\'has-error\': (forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$invalid}">\n <label class="control-label">{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="current_pwd" placeholder="{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}" class="form-control" data-ng-model="user.currentPwd" required/>\n <span data-ng-show="(forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END CURRENT PWD -->\n <!-- START NEW PWD -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid}">\n <label class="control-label">{{\'APPLICATION_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="new_pwd" placeholder="{{\'APPLICATION_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="user.newPwd" required/>\n <span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NEW PWD -->\n <!-- START RE-NEW PWD -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.re_new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.re_new_pwd.$invalid}">\n <label class="control-label">{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="re_new_pwd" placeholder="{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="user.reNewPwd" nx-equal="user.newPwd" required/>\n <span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END RE-NEW PWD -->\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n <!-- <form action="#">\n <div class="form-group">\n <label class="control-label">Current Password</label>\n <input type="password" class="form-control"/>\n </div>\n <div class="form-group">\n <label class="control-label">New Password</label>\n <input type="password" class="form-control"/>\n </div>\n <div class="form-group">\n <label class="control-label">Re-type New Password</label>\n <input type="password" class="form-control"/>\n </div>\n <div class="margin-top-10">\n <a href="#" class="btn green-haze">Change Password </a>\n <a href="#" class="btn default">Cancel </a>\n </div>\n </form> -->\n </div>\n <!-- END CHANGE PASSWORD TAB -->\n </div>\n </div>\n </div>\n </div>\n</div>\n'),a.put("app/user/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-eye"></i>\n <a href="/users/list">{{ \'APPLICATION_USERS\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <a href="#">{{user.fullname}}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN PROFILE SIDEBAR -->\n <div class="profile-sidebar">\n <!-- PORTLET MAIN -->\n <div class="portlet light profile-sidebar-portlet">\n <!-- SIDEBAR USERPIC -->\n <div class="profile-userpic">\n <img ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" class="img-responsive">\n </div>\n <!-- END SIDEBAR USERPIC -->\n <!-- SIDEBAR USER TITLE -->\n <div class="profile-usertitle">\n <div class="profile-usertitle-name">\n {{user.fullname}}\n </div>\n <div class="profile-usertitle-job">\n {{user.role}}\n </div>\n </div>\n <!-- END SIDEBAR USER TITLE -->\n\n <!-- SIDEBAR MENU -->\n <div class="profile-usermenu">\n <ul class="nav">\n <li data-ng-class="{active: $state.is(\'main.users.view.account\')}">\n <a data-ng-href="/users/view/{{user.id}}/account">\n <i class="icon-user"></i>\n {{ \'APPLICATION_ACCOUNT\' | translate}} </a>\n </li>\n </ul>\n </div>\n <!-- END MENU -->\n </div>\n <!-- END PORTLET MAIN -->\n </div>\n <!-- END BEGIN PROFILE SIDEBAR -->\n <!-- BEGIN PROFILE CONTENT -->\n <div ui-view class="profile-content">\n </div>\n <!-- END PROFILE CONTENT -->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/user/wizard/wizard.html",'<div class="col-md-12">\n <!-- BEGIN PAGE HEADER-->\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-eye"></i>\n <a href="/users/list">{{ \'APPLICATION_USERS\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-options"></i>\n <a href="/users/wizard">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n </li>\n </ul>\n </div>\n <!-- END PAGE HEADER-->\n\n <!-- BEGIN PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-user font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_USER\' | translate }} WIZARD</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <wizard on-finish="createItem()">\n <wz-step title="{{\'APPLICATION_ACCOUNT\' | translate}}" canexit="exitValidation(forms.info.$valid)">\n <form name="forms.info" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n <span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START USERNAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.name" required ng-remote-validate="/api/users/validate/name"/>\n <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.ngRemoteValidate" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n </span>\n </div>\n <!-- END USERNAME -->\n\n <!-- START EMAIL -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="item.email" required ng-remote-validate="/api/users/validate/email"/>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.ngRemoteValidate" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_EMAIL\' | translate}}.\n </span>\n </div>\n <!-- END EMAIL -->\n\n <!-- START PASSWORD -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid}">\n <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n <span data-ng-show="(forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END PASSWORD -->\n\n <!-- START RE PASSWORD -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$invalid}">\n <label class="control-label">{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.rpassword" nx-equal="item.password" required/>\n <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.nxEqual" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n </span>\n </div>\n <!-- END RE PASSWORD -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n </wz-step>\n </wizard>\n </div>\n </div>\n <!-- END PORTLET-->\n</div>\n'),a.put("app/variable/list/create.modal.html",'<div class="modal-header">\n <h3 class="modal-title">{{ \'APPLICATION_NEW_VARIABLE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n <form name="forms.variable" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.variable.name.$touched || forms.variable.$submitted) && forms.variable.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n <span data-ng-show="(forms.variable.name.$touched || forms.variable.$submitted) && forms.variable.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n </div>\n <!-- END DESCRIPTION -->\n\n </form>\n</div>\n<div class="modal-footer">\n <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.variable.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/variable/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-eye"></i>\n <a href="/variables/list">{{ \'APPLICATION_VARIABLES\' | translate }}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-docs font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_VARIABLES\' | translate }}</a> </span>\n </div>\n <div class="actions">\n <div class="btn-group" data-ng-show="Variables.checked.length">\n <a class="btn red" href="#" data-ng-click="deleteItems()">\n <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </div>\n <div class="btn-group">\n <button class="btn green-jungle " ng-click="create()">\n <i class="icon-plus"></i> {{ \'APPLICATION_NEW_VARIABLE\' | translate }}\n </button>\n </div>\n <a class="btn btn-icon-only btn-default" href="#" ng-csv="getVariables([\'name\', \'description\'])" csv-header="[\'Name\', \'Description\']" field-separator=";" filename="variables.csv">\n <i class="icon-cloud-download"></i></a>\n <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n </div>\n </div>\n <div class="portlet-body">\n <!-- START TABLE -->\n <table st-table="displayedVariables" st-pipe="initList" class="table table-striped table-bordered table-hover">\n <div class="table-responsive">\n <thead>\n <tr>\n <th colspan="4">\n <div class="row">\n <div class="col-md-6">\n <ui-select class="input-xsmall" ng-model="conf.variablesByPage" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="variableByPage in variablesByPage | filter: $select.search">\n <div ng-bind-html="variableByPage.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n <div class="col-md-6">\n <div class="input-group input-medium pull-right">\n <input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n <span class="input-group-addon">\n <i class="fa fa-search"></i>\n </span>\n </div>\n </div>\n </div>\n </th>\n </tr>\n <tr>\n <th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(variable, checked)" checklist-model checklist-value="id"></th>\n <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n <th st-sort="description">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n </tr>\n </thead>\n <tbody>\n <tr data-ng-repeat="variable in displayedVariables" class="animate-repeat">\n <td style="text-align: center; vertical-align: middle"><input data-ng-hide="variable.defaultEntry" type="checkbox" checklist-model="Variables.checked" checklist-value="variable.id"></td>\n <td>{{variable.name}}</td>\n <td>{{variable.description}}</td>\n <td>\n <a class="btn default btn-xs blue-stripe" data-ng-href="/variables/view/{{variable.id}}/settings" data-ng-class="{\'disabled\': variable.defaultEntry}">\n {{ \'APPLICATION_SETTINGS\' | translate}}\n </a>\n <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(variable.name,variable.id)" data-ng-class="{\'disabled\': variable.defaultEntry}">\n {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </td>\n </tr>\n <tr data-ng-hide="displayedVariables.length">\n <td colspan="4" style="text-align:center;">\n <i>{{ \'MESSAGE_NO_VARIABLES_AVAILABLE\' | translate }}</i>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td/>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="description" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_DESCRIPTION\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td/>\n </tr>\n <tr>\n <td colspan="4" class="text-center">\n <div st-pagination class="pagination" st-items-by-page="conf.variablesByPage.value" st-displayed-pages="7"></div>\n </td>\n </tr>\n </tfoot>\n </div>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
a.put("app/variable/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getVariable()">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-eye"></i>\n <a href="/variables/list">{{ \'APPLICATION_VARIABLES\' | translate }}</a>\n <i data-ng-show="variable" class="fa fa-angle-right"></i>\n </li>\n <li data-ng-show="variable">\n <a href="#">{{variable.name}}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN PROFILE SIDEBAR -->\n <div class="profile-sidebar">\n <!-- PORTLET MAIN -->\n <div class="portlet light profile-sidebar-portlet">\n <!-- SIDEBAR USERPIC -->\n <div class="profile-image">\n <img data-ng-src="assets/images/media/variable.png" class="img-responsive">\n </div>\n <!-- END SIDEBAR USERPIC -->\n <!-- SIDEBAR USER TITLE -->\n <div class="profile-usertitle">\n <div class="profile-usertitle-name">\n {{variable.name}}\n </div>\n <!-- <div class="profile-usertitle-job">\n {{user.role}}\n </div> -->\n </div>\n <!-- END SIDEBAR USER TITLE -->\n\n <!-- SIDEBAR MENU -->\n <div class="profile-usermenu">\n <ul class="nav">\n <li data-ng-class="{active: $state.is(\'main.variables.view.settings\')}">\n <a data-ng-href="/variables/view/{{variable.id}}/settings">\n <i class="icon-settings"></i>\n {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n </li>\n </ul>\n </div>\n <!-- END MENU -->\n </div>\n <!-- END PORTLET MAIN -->\n </div>\n <!-- END BEGIN PROFILE SIDEBAR -->\n <!-- BEGIN PROFILE CONTENT -->\n <div ui-view class="profile-content">\n </div>\n <!-- END PROFILE CONTENT -->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/variable/view/view.settings.html",'<div class="row">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_VARIABLE\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n </div>\n <ul class="nav nav-tabs">\n <li class="active">\n <a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n </li>\n </ul>\n </div>\n\n <div class="portlet-body">\n <div class="tab-content">\n <!-- GENERAL TAB -->\n <div class="tab-pane active" id="tab_1_1">\n <form name="forms.general" data-ng-submit="forms.general.$valid && updateVariable()" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="variable.name" required/>\n <span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="variable.description"></textarea>\n </div>\n <!-- END DESCRIPTION -->\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END ADVANCED TAB -->\n\n </div>\n </div>\n </div>\n </div>\n</div>\n'),a.put("app/voice/context/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-docs"></i>\n <a href="/voice/contexts/list">{{ \'APPLICATION_CONTEXTS\' | translate }}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-docs font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_CONTEXTS\' | translate }}</a> </span>\n </div>\n <div class="actions">\n <div class="btn-group" data-ng-show="voiceContexts.checked.length">\n <a class="btn red" href="#" data-ng-click="deleteItems()">\n <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </div>\n <div class="btn-group">\n <a class="btn green-jungle " href="#" data-toggle="dropdown">\n <i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONTEXT\' | translate }} <i class="fa fa-angle-down"></i>\n </a>\n <ul class="dropdown-menu pull-right">\n <li>\n <a href="/voice/contexts/wizard">\n <i class="icon-user-following"></i> {{ \'APPLICATION_WIZARD\' | translate }} </a>\n </li>\n </ul>\n </div>\n <a class="btn btn-icon-only btn-default" href="#" ng-csv="getVoiceContexts([\'name\', \'description\'])" csv-header="[\'Name\', \'Description\']" field-separator=";" filename="voice_contexts.csv">\n <i class="icon-cloud-download"></i></a>\n <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n </div>\n </div>\n <div class="portlet-body">\n <!-- START TABLE -->\n <table st-table="displayedContexts" st-pipe="initList" class="table table-striped table-bordered table-hover">\n <div class="table-responsive">\n <thead>\n <tr>\n <th colspan="4">\n <div class="row">\n <div class="col-md-6">\n <ui-select class="input-xsmall" ng-model="conf.contextsByPage" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="contextByPage in contextsByPage | filter: $select.search">\n <div ng-bind-html="contextByPage.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n <div class="col-md-6">\n <div class="input-group input-medium pull-right">\n <input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n <span class="input-group-addon">\n <i class="fa fa-search"></i>\n </span>\n </div>\n </div>\n </div>\n </th>\n </tr>\n <tr>\n <th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(context, checked)" checklist-model checklist-value="id"></th>\n <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n <th st-sort="description">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n </tr>\n </thead>\n <tbody>\n <tr data-ng-repeat="context in displayedVoiceContexts" class="animate-repeat">\n <td style="text-align: center; vertical-align: middle"><input data-ng-hide="context.defaultEntry" type="checkbox" checklist-model="voiceContexts.checked" checklist-value="context.id"></td>\n <td>{{context.name}}</td>\n <td>{{context.description}}</td>\n <td>\n <a class="btn default btn-xs blue-stripe" data-ng-href="/voice/contexts/view/{{context.id}}/settings" data-ng-class="{\'disabled\': context.defaultEntry}">\n {{ \'APPLICATION_SETTINGS\' | translate}}\n </a>\n <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(context.name,context.id)" data-ng-class="{\'disabled\': context.defaultEntry}">\n {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </td>\n </tr>\n <tr data-ng-hide="displayedVoiceContexts.length">\n <td colspan="4" style="text-align:center;">\n <i>{{ \'MESSAGE_NO_CONTEXTS_AVAILABLE\' | translate }}</i>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td/>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="description" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_DESCRIPTION\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td/>\n </tr>\n <tr>\n <td colspan="4" class="text-center">\n <div st-pagination class="pagination" st-items-by-page="conf.contextsByPage.value" st-displayed-pages="7"></div>\n </td>\n </tr>\n </tfoot>\n </div>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/voice/context/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getContext()">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-docs"></i>\n <a href="/voice/contexts/list">{{ \'APPLICATION_CONTEXTS\' | translate }}</a>\n <i data-ng-show="context" class="fa fa-angle-right"></i>\n </li>\n <li data-ng-show="context">\n <a href="#">{{context.name}}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN PROFILE SIDEBAR -->\n <div class="profile-sidebar">\n <!-- PORTLET MAIN -->\n <div class="portlet light profile-sidebar-portlet">\n <!-- SIDEBAR USERPIC -->\n <div class="profile-image">\n <img data-ng-src="assets/images/media/context.png" class="img-responsive">\n </div>\n <!-- END SIDEBAR USERPIC -->\n <!-- SIDEBAR USER TITLE -->\n <div class="profile-usertitle">\n <div class="profile-usertitle-name">\n {{context.name}}\n </div>\n <!-- <div class="profile-usertitle-job">\n {{user.role}}\n </div> -->\n </div>\n <!-- END SIDEBAR USER TITLE -->\n\n <!-- SIDEBAR MENU -->\n <div class="profile-usermenu">\n <ul class="nav">\n <li data-ng-class="{active: $state.is(\'main.voice.contexts.view.settings\')}">\n <a data-ng-href="/voice/contexts/view/{{context.id}}/settings">\n <i class="icon-settings"></i>\n {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n </li>\n </ul>\n </div>\n <!-- END MENU -->\n </div>\n <!-- END PORTLET MAIN -->\n </div>\n <!-- END BEGIN PROFILE SIDEBAR -->\n <!-- BEGIN PROFILE CONTENT -->\n <div ui-view class="profile-content">\n </div>\n <!-- END PROFILE CONTENT -->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/voice/context/view/view.settings.html",'<div class="row">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_CONTEXT\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n </div>\n <ul class="nav nav-tabs">\n <li class="active">\n <a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n </li>\n </ul>\n </div>\n\n <div class="portlet-body">\n <div class="tab-content">\n <!-- GENERAL TAB -->\n <div class="tab-pane active" id="tab_1_1">\n <form name="forms.general" data-ng-submit="forms.general.$valid && updateVoiceContext()" novalidate>\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="context.description"></textarea>\n </div>\n <!-- END DESCRIPTION -->\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END ADVANCED TAB -->\n\n </div>\n </div>\n </div>\n </div>\n</div>\n'),a.put("app/voice/context/wizard/wizard.html",'<div class="col-md-12">\n <!-- BEGIN PAGE HEADER-->\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-docs"></i>\n <a href="/voice/contexts/list">{{ \'APPLICATION_CONTEXTS\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-options"></i>\n <a href="/voice/contexts/wizard">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n </li>\n </ul>\n </div>\n <!-- END PAGE HEADER-->\n\n <!-- BEGIN PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-docs font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_CONTEXT\' | translate }} WIZARD</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <wizard on-finish="createItem()">\n <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="exitValidation(forms.context.$valid)">\n <form name="forms.context" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.context.name.$touched || forms.context.$submitted) && forms.context.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n <span data-ng-show="(forms.context.name.$touched || forms.context.$submitted) && forms.context.name.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n </div>\n <!-- END DESCRIPTION -->\n <button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n </wz-step>\n </wizard>\n </div>\n </div>\n <!-- END PORTLET-->\n</div>\n'),a.put("app/voice/moh/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-music-tone"></i>\n <a href="/voice/mohs/list">{{ \'APPLICATION_MOHS\' | translate }}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-music-tone font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_MOHS\' | translate }}</a> </span>\n </div>\n <div class="actions">\n <div class="btn-group" data-ng-show="mohs.checked.length">\n <a class="btn red" href="#" data-ng-click="deleteItems()">\n <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </div>\n <div class="btn-group">\n <a class="btn green-jungle " href="#" data-toggle="dropdown">\n <i class="icon-plus"></i> {{ \'APPLICATION_NEW_MOH_CLASS\' | translate }} <i class="fa fa-angle-down"></i>\n </a>\n <ul class="dropdown-menu pull-right">\n <li>\n <a href="/voice/mohs/wizard">\n <i class="icon-user-following"></i> {{ \'APPLICATION_WIZARD\' | translate }} </a>\n </li>\n </ul>\n </div>\n <a class="btn btn-icon-only btn-default" href="#" ng-csv="getMohs([\'name\', \'directory\', \'sort\', \'description\'])" csv-header="[\'Name\', \'Directory\', \'Sort\', \'Description\']" field-separator=";" filename="musiconholds_classes.csv">\n <i class="icon-cloud-download"></i></a>\n <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n </div>\n </div>\n <div class="portlet-body">\n <!-- START TABLE -->\n <table st-table="displayedMohs" st-pipe="initList" class="table table-striped table-bordered table-hover">\n <div class="table-responsive">\n <thead>\n <tr>\n <th colspan="6">\n <div class="row">\n <div class="col-md-6">\n <ui-select class="input-xsmall" ng-model="conf.mohsByPage" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="mohByPage in mohsByPage | filter: $select.search">\n <div ng-bind-html="mohByPage.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n <div class="col-md-6">\n <div class="input-group input-medium pull-right">\n <input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n <span class="input-group-addon">\n <i class="fa fa-search"></i>\n </span>\n </div>\n </div>\n </div>\n </th>\n </tr>\n <tr>\n <th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(moh, checked)" checklist-model checklist-value="id"></th>\n <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n <th st-sort="directory">{{ \'APPLICATION_PATH\' | translate }}</th>\n <th st-sort="sort">{{ \'APPLICATION_SORT\' | translate }}</th>\n <th st-sort="description">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n </tr>\n </thead>\n <tbody>\n <tr data-ng-repeat="moh in displayedMohs" class="animate-repeat">\n <td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="mohs.checked" checklist-value="moh.id" data-ng-hide="moh.defaultEntry"></td>\n <td>{{moh.name}}</td>\n <td>{{moh.directory}}</td>\n <td>{{moh.sort | capitalize}}</td>\n <td>{{moh.description}}</td>\n <td>\n <a class="btn default btn-xs blue-stripe" data-ng-class="{\'disabled\': moh.defaultEntry}" data-ng-href="/voice/mohs/view/{{moh.id}}/settings">\n {{ \'APPLICATION_SETTINGS\' | translate}}\n </a>\n <a class="btn default btn-xs red-stripe" data-ng-class="{\'disabled\': moh.defaultEntry}" data-ng-click="deleteItem(moh.name,moh.id)">\n {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </td>\n </tr>\n <tr data-ng-hide="displayedMohs.length">\n <td colspan="6" style="text-align:center;">\n <i>{{ \'MESSAGE_NO_MOHS_AVAILABLE\' | translate }}</i>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td/>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="directory" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_PATH\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="sort" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_SORT\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="description" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_DESCRIPTION\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n </td>\n </tr>\n <tr>\n <td colspan="6" class="text-center">\n <div st-pagination class="pagination" st-items-by-page="conf.mohsByPage.value" st-displayed-pages="7"></div>\n </td>\n </tr>\n </tfoot>\n </div>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/voice/moh/view/view.addFiles.html",'\n<div class="row" data-ng-init="getSounds()">\n <div class="col-md-12">\n <!-- BEGIN PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-notebook font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_MOH\' | translate }} {{ \'APPLICATION_ADD_FILES\' | translate }}</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <div class="note note-warning" data-ng-hide="soundList.length">\n <h4 class="block">Warning!</h4>\n <p>\n {{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n </p>\n </div>\n <form name="forms.general" data-ng-submit="(item.sounds.length > 0) && addMohs()" data-ng-show="soundList.length" novalidate>\n\n <!-- START SOUNDS -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.sounds.$touched || forms.general.$submitted) && item.sounds.length == 0}">\n <label class="control-label">{{\'APPLICATION_SOUNDS\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select multiple data-ng-model="item.sounds" theme="bootstrap" name="sounds" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.display_name}}</ui-select-match>\n <ui-select-choices repeat="sound.id as sound in soundList | filter: $select.search">\n {{sound.display_name}}\n </ui-select-choices>\n </ui-select>\n <span data-ng-show="(forms.general.sounds.$touched || forms.general.$submitted) && item.sounds.length == 0" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END OPTIONS -->\n\n <input type="submit" class="btn green-haze" value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n </form>\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/voice/moh/view/view.audios.html",'<div ui-view class="profile-content">\n<div class="row" data-ng-init="getAudioFiles()">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AUDIOS\' | translate}}</span>\n </div>\n <div class="actions">\n <div class="btn-group" data-ng-show="audioFiles">\n <a class="btn green-jungle " href="/voice/mohs/view/{{moh.id}}/add" data-toggle="dropdown">\n <i class="icon-plus"></i> {{ \'APPLICATION_ADD_FILES\' | translate }}\n </a>\n </div>\n </div>\n </div>\n <div class="portlet-body">\n <div class="note note-warning" data-ng-hide="audioFiles">\n <h4 class="block">Warning!</h4>\n <p>\n {{ \'MESSAGE_FOLDER_DOES_NOT_EXIST\' | translate }}\n </p>\n </div>\n <!-- START TABLE -->\n <table class="table table-striped table-bordered table-hover" data-ng-show="audioFiles">\n <thead>\n <tr>\n <th>{{ \'APPLICATION_NAME\' | translate }}</th>\n <th width="30%">{{ \'APPLICATION_PREVIEW\' | translate }}</th>\n <th width="10%">{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n </tr>\n </thead>\n <tbody data-ng-model="audioFiles">\n <tr data-ng-repeat="audiofile in audioFiles">\n <td>{{audiofile}}</td>\n <td>\n <audio controls ng-src="{{getSecureSrc(audioSources[audiofile])}}" preload="none">\n Your browser does not support the audio tag.\n </audio></td>\n <td>\n <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(audiofile,audiofile)">\n {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </td>\n </tr>\n <tr data-ng-hide="audioFiles.length">\n <td colspan="3" style="text-align:center;">\n <i>{{ \'MESSAGE_NO_AUDIOFILES_AVAILABLE\' | translate }}</i>\n </td>\n </tr>\n </tbody>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n </div>\n</div>\n</div>\n'),a.put("app/voice/moh/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getMoh()">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-music-tone"></i>\n <a href="/voice/mohs/list">{{ \'APPLICATION_MOH_CLASS\' | translate }}</a>\n <i data-ng-show="moh" class="fa fa-angle-right"></i>\n </li>\n <li data-ng-show="moh">\n <a href="#">{{moh.name}}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN PROFILE SIDEBAR -->\n <div class="profile-sidebar">\n <!-- PORTLET MAIN -->\n <div class="portlet light profile-sidebar-portlet">\n <!-- SIDEBAR USERPIC -->\n <div class="profile-image">\n <img data-ng-src="assets/images/media/moh.png" class="img-responsive">\n </div>\n <!-- END SIDEBAR USERPIC -->\n <!-- SIDEBAR USER TITLE -->\n <div class="profile-usertitle">\n <div class="profile-usertitle-name">\n {{moh.name}}\n </div>\n <!-- <div class="profile-usertitle-job">\n {{user.role}}\n </div> -->\n </div>\n <!-- END SIDEBAR USER TITLE -->\n\n <!-- SIDEBAR MENU -->\n <div class="profile-usermenu">\n <ul class="nav">\n <li data-ng-class="{active: $state.is(\'main.voice.mohs.view.settings\')}">\n <a data-ng-href="/voice/mohs/view/{{moh.id}}/settings">\n <i class="icon-settings"></i>\n {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n </li>\n <li data-ng-class="{active: $state.is(\'main.voice.mohs.view.audios\') || $state.is(\'main.voice.mohs.view.add\')}">\n <a data-ng-href="/voice/mohs/view/{{moh.id}}/audios">\n <i class="icon-list"></i>\n {{ \'APPLICATION_AUDIOS\' | translate}} </a>\n </li>\n </ul>\n </div>\n <!-- END MENU -->\n </div>\n <!-- END PORTLET MAIN -->\n </div>\n <!-- END BEGIN PROFILE SIDEBAR -->\n <!-- BEGIN PROFILE CONTENT -->\n <div ui-view class="profile-content">\n </div>\n <!-- END PROFILE CONTENT -->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/voice/moh/view/view.settings.html",'<div class="row">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_MOH_CLASS\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n </div>\n <ul class="nav nav-tabs">\n <li class="active">\n <a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n </li>\n </ul>\n </div>\n\n <div class="portlet-body" data-ng-init="getContexts();">\n <div class="tab-content">\n <!-- GENERAL TAB -->\n <div class="tab-pane active" id="tab_1_1">\n <form name="forms.general" data-ng-submit="forms.general.$valid && updateVoiceMoh()" novalidate>\n\n <!-- START PATH -->\n <div class="form-group" >\n <label class="control-label">{{\'APPLICATION_PATH\' | translate}}</label>\n <input type="text" name="path" class="form-control" data-ng-model="moh.directory" disabled/>\n </div>\n <!-- END PATH -->\n\n <!-- START SORT -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.sort.$touched || forms.general.$submitted) && forms.general.sort.$invalid}">\n <label class="control-label">{{\'APPLICATION_SORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="moh.sort" theme="bootstrap" name="sort" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n <ui-select-choices repeat="sort.value as sort in sortOptions | filter: $select.search">\n {{$translate.instant(sort.name)}}\n </ui-select-choices>\n </ui-select>\n <span data-ng-show="(forms.general.sort.$touched || forms.general.$submitted) && forms.general.sort.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END SORT -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.description.$invalid}">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" class="form-control" data-ng-model="moh.description"/></textarea>\n <span data-ng-show="forms.general.$submitted && forms.general.description.$invalid" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END DESCRIPTION -->\n\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END GENERAL TAB -->\n </div>\n </div>\n </div>\n </div>\n</div>\n'),
a.put("app/voice/moh/wizard/wizard.html",'<div class="col-md-12" data-ng-init="initWizard();getContexts();">\n <!-- BEGIN PAGE HEADER-->\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-music-tone"></i>\n <a href="/voice/mohs/list">{{ \'APPLICATION_MOHS\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-options"></i>\n <a href="#">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n </li>\n </ul>\n </div>\n <!-- END PAGE HEADER-->\n\n <!-- BEGIN PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-music-tone font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_MOH_CLASS\' | translate }} WIZARD</a> </span>\n </div>\n </div>\n <div class="portlet-body">\n <wizard on-finish="createItem()">\n <wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(forms.general.$valid)">\n <form name="forms.general" novalidate>\n\n <!-- START NAME -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.name.$invalid}">\n <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n <span data-ng-show="forms.general.$submitted && forms.general.name.$invalid" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END NAME -->\n\n <!-- START SORT -->\n <!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.general.sort.$touched || forms.general.$submitted) && forms.general.sort.$invalid}">\n <label class="control-label">{{\'APPLICATION_SORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="item.sort" theme="bootstrap" name="sort" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n <ui-select-choices repeat="sort.value as sort in sortOptions | filter: $select.search">\n {{$translate.instant(sort.name)}}\n </ui-select-choices>\n </ui-select>\n <span data-ng-show="(forms.general.sort.$touched || forms.general.$submitted) && forms.general.sort.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div> -->\n <!-- END SORT -->\n\n <!-- START DESCRIPTION -->\n <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.description.$invalid}">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" class="form-control" data-ng-model="item.description"/></textarea>\n <span data-ng-show="forms.general.$submitted && forms.general.description.$invalid" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END DESCRIPTION -->\n\n\n <button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n </form>\n </wz-step>\n\n <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n </wz-step>\n </wizard>\n </div>\n </div>\n <!-- END PORTLET-->\n</div>\n'),a.put("app/voice/queue/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-layers"></i>\n <a href="/voice/queues/list">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN Portlet PORTLET-->\n <div class="portlet light bordered">\n <div class="portlet-title">\n <div class="caption font-green-sharp">\n <i class="icon-layers font-green-sharp"></i>\n <span class="caption-subject">{{ \'APPLICATION_QUEUES\' | translate }}</a> </span>\n </div>\n <div class="actions">\n <div class="btn-group" data-ng-show="queues.checked.length">\n <a class="btn red" href="#" data-ng-click="deleteItems()">\n <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </div>\n <div class="btn-group">\n <a class="btn green-jungle " href="#" data-toggle="dropdown">\n <i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | translate }} <i class="fa fa-angle-down"></i>\n </a>\n <ul class="dropdown-menu pull-right">\n <li>\n <a href="/voice/queues/wizard">\n <i class="icon-user-following"></i> {{ \'APPLICATION_WIZARD\' | translate }} </a>\n </li>\n </ul>\n </div>\n <a class="btn btn-icon-only btn-default" href="#" ng-csv="getQueues([\'name\', \'description\', \'strategy\', \'context\'])" csv-header="[\'Name\', \'Description\', \'Strategy\', \'Context\']" field-separator=";" filename="queues.csv">\n <i class="icon-cloud-download"></i></a>\n </div>\n </div>\n <div class="portlet-body">\n <!-- START TABLE -->\n <table st-table="displayedQueues" st-pipe="initList" class="table table-striped table-bordered table-hover">\n <div class="table-responsive">\n <thead>\n <tr>\n <th colspan="6">\n <div class="row">\n <div class="col-md-6">\n <ui-select class="input-xsmall" ng-model="conf.voiceQueuesByPage" theme="bootstrap" ng-disabled="disabled">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="voiceQueueByPage in voiceQueuesByPage | filter: $select.search">\n <div ng-bind-html="voiceQueueByPage.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n </div>\n <div class="col-md-6">\n <div class="input-group input-medium pull-right">\n <input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n <span class="input-group-addon">\n <i class="fa fa-search"></i>\n </span>\n </div>\n </div>\n </div>\n </th>\n </tr>\n <tr>\n <th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(queue, checked)" checklist-model checklist-value="name"></th>\n <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n <th st-sort="description">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n <th st-sort="strategy">{{ \'APPLICATION_STRATEGY\' | translate }}</th>\n <th st-sort="context">{{ \'APPLICATION_CONTEXT\' | translate }}</th>\n <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n </tr>\n </thead>\n <tbody>\n <tr data-ng-repeat="queue in displayedQueues" class="animate-repeat">\n <td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="queues.checked" checklist-value="queue.name"></td>\n <td>{{queue.name}}</td>\n <td>{{queue.description}}</td>\n <td>{{queue.strategy}}</td>\n <td>{{queue.context}}</td>\n <td>\n <a class="btn default btn-xs blue-stripe" data-ng-href="/voice/queues/view/{{queue.name}}/settings">\n {{ \'APPLICATION_SETTINGS\' | translate}}\n </a>\n <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(queue.name,queue.name)">\n {{ \'APPLICATION_DELETE\' | translate }}\n </a>\n </td>\n </tr>\n <tr data-ng-hide="displayedQueues.length">\n <td colspan="6" style="text-align:center;">\n <i>{{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}</i>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td/>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="description" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_DESCRIPTION\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="strategy" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_STRATEGY\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n <div class="input-icon right">\n <i class="fa fa-search"></i>\n <input st-search="context" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_CONTEXT\' | translate | lowercase}}" class="form-control" type="search"/>\n </div>\n </td>\n <td>\n </td>\n </tr>\n <tr>\n <td colspan="6" class="text-center">\n <div class="pagination" st-pagination st-items-by-page="conf.voiceQueuesByPage.value" st-displayed-pages="7"></div>\n </td>\n </tr>\n </tfoot>\n </div>\n </table>\n <!-- END TABLE -->\n </div>\n </div>\n <!-- END Portlet PORTLET-->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/voice/queue/view/view.agents.html",'<div class="row" data-ng-init="getTeams()">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n </div>\n </div>\n <div class="note note-warning" data-ng-hide="teams.length">\n <h4 class="block">Warning!</h4>\n <p>\n {{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}\n </p>\n </div>\n <div class="portlet-body">\n <!-- BEGIN FORM-->\n <form action="index.html" class="form-horizontal form-row-seperated">\n <div class="form-body text-center">\n <div class="form-group last">\n <div class="col-md-9" id="multi-select-team">\n </div>\n </div>\n </div>\n </form>\n <!-- END FORM-->\n </div>\n </div>\n </div>\n</div>\n'),a.put("app/voice/queue/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getQueue()">\n <div class="col-md-12">\n <div class="page-bar">\n <ul class="page-breadcrumb">\n <li>\n <i class="icon-rocket"></i>\n <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n <i class="fa fa-angle-right"></i>\n </li>\n <li>\n <i class="icon-layers"></i>\n <a href="/voice/queues/list">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n <i data-ng-show="queue" class="fa fa-angle-right"></i>\n </li>\n <li data-ng-show="queue">\n <a href="#">{{queue.name}}</a>\n </li>\n </ul>\n </div>\n\n <!-- BEGIN PROFILE SIDEBAR -->\n <div class="profile-sidebar">\n <!-- PORTLET MAIN -->\n <div class="portlet light profile-sidebar-portlet">\n <!-- SIDEBAR USERPIC -->\n <div class="profile-image">\n <img data-ng-src="assets/images/media/queue.png" class="img-responsive">\n </div>\n <!-- END SIDEBAR USERPIC -->\n <!-- SIDEBAR USER TITLE -->\n <div class="profile-usertitle">\n <div class="profile-usertitle-name">\n {{queue.name}}\n </div>\n <!-- <div class="profile-usertitle-job">\n {{user.role}}\n </div> -->\n </div>\n <!-- END SIDEBAR USER TITLE -->\n\n <!-- SIDEBAR MENU -->\n <div class="profile-usermenu">\n <ul class="nav">\n <li data-ng-class="{active: $state.is(\'main.voice.queues.view.settings\')}">\n <a data-ng-href="/voice/queues/view/{{queue.name}}/settings">\n <i class="icon-settings"></i>\n {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n </li>\n <li data-ng-class="{active: $state.is(\'main.voice.queues.view.agents\')}">\n <a data-ng-href="/voice/queues/view/{{queue.name}}/agents">\n <i class="icon-people"></i>\n {{ \'APPLICATION_AGENTS\' | translate}} </a>\n </li>\n </ul>\n </div>\n <!-- END MENU -->\n </div>\n <!-- END PORTLET MAIN -->\n </div>\n <!-- END BEGIN PROFILE SIDEBAR -->\n <!-- BEGIN PROFILE CONTENT -->\n <div ui-view class="profile-content">\n </div>\n <!-- END PROFILE CONTENT -->\n </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/voice/queue/view/view.settings.html",'<div class="row">\n <div class="col-md-12">\n <div class="portlet light">\n <div class="portlet-title tabbable-line">\n <div class="caption caption-md">\n <i class="icon-globe theme-font hide"></i>\n <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_QUEUE_SETTINGS\' | translate}}</span>\n </div>\n <ul class="nav nav-tabs">\n <li class="active">\n <a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n </li>\n <li>\n <a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_PERIODIC_ANNOUNCE\' | translate}}</a>\n </li>\n <li>\n <a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_ADVANCED\' | translate}}</a>\n </li>\n </ul>\n </div>\n\n <div class="portlet-body" data-ng-init="getContexts();getMohs();getSounds();">\n <div class="tab-content">\n <!-- GENERAL TAB -->\n <div class="tab-pane active" id="tab_1_1">\n <form name="forms.general" data-ng-submit="forms.general.$valid && updateVoiceQueue()" novalidate>\n <div class="row">\n <div class="col-md-6">\n <!-- START STRATEGY -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.strategy.$touched || forms.general.$submitted) && forms.general.strategy.$invalid}">\n <label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="queue.strategy" name="strategy" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n <ui-select-choices repeat="strategy in [\'ringall\', \'leastrecent\', \'fewestcalls\', \'random\', \'rrmemory\', \'linear\', \'wrandom\', \'rrordered\'] | filter: $select.search">\n <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_STRATEGY\' | translate }}\n </span>\n <span data-ng-show="(forms.general.strategy.$touched || forms.general.$submitted) && forms.general.strategy.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END STRATEGY -->\n\n <!-- START MOH -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.musiconhold.$touched || forms.general.$submitted) && forms.general.musiconhold.$invalid}">\n <label class="control-label">{{\'APPLICATION_MOH\' | translate}}</label>\n <ui-select data-ng-model="queue.musiconhold" name="musiconhold" theme="bootstrap">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="musiconhold.name as musiconhold in voiceMohs | filter: $select.search">\n <div ng-bind-html="musiconhold.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_VOICE_MOH\' | translate }}\n </span>\n <span data-ng-show="(forms.general.musiconhold.$touched || forms.general.$submitted) && forms.general.musiconhold.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END MOH -->\n\n <!-- START TIMEOUT -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.timeout.$touched || forms.general.$submitted) && forms.general.timeout.$invalid}">\n <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n <input type="number" min="0" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="queue.timeout" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_TIMEOUT\' | translate }}\n </span>\n <span data-ng-show="(forms.general.timeout.$touched || forms.general.$submitted) && forms.general.timeout.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END TIMEOUT -->\n\n <!-- START MAXLEN -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.maxlen.$touched || forms.general.$submitted) && forms.general.maxlen.$invalid}">\n <label class="control-label">{{\'APPLICATION_MAXLEN\' | translate}}</label>\n <input type="number" min="0" name="maxlen" placeholder="{{\'APPLICATION_MAXLEN\' | translate}}" class="form-control" data-ng-model="queue.maxlen" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_MAXLEN\' | translate }}\n </span>\n <span data-ng-show="(forms.general.maxlen.$touched || forms.general.$submitted) && forms.general.maxlen.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END MAXLEN -->\n\n <!-- START RETRY -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.retry.$touched || forms.general.$submitted) && forms.general.retry.$invalid}">\n <label class="control-label">{{\'APPLICATION_RETRY\' | translate}}</label>\n <input type="number" min="0" name="retry" placeholder="{{\'APPLICATION_RETRY\' | translate}}" class="form-control" data-ng-model="queue.retry" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_RETRY\' | translate }}\n </span>\n <span data-ng-show="(forms.general.retry.$touched || forms.general.$submitted) && forms.general.retry.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END RETRY -->\n\n </div>\n <div class="col-md-6">\n <!-- START WRAPUPTIME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.wrapuptime.$touched || forms.general.$submitted) && forms.general.wrapuptime.$invalid}">\n <label class="control-label">{{\'APPLICATION_WRAPUPTIME\' | translate}}</label>\n <input type="number" min="0" name="wrapuptime" placeholder="{{\'APPLICATION_WRAPUPTIME\' | translate}}" class="form-control" data-ng-model="queue.wrapuptime" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_WRAPUPTIME\' | translate }}\n </span>\n <span data-ng-show="(forms.general.wrapuptime.$touched || forms.general.$submitted) && forms.general.wrapuptime.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END WRAPUPTIME -->\n\n <!-- START WEIGHT -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.weight.$touched || forms.general.$submitted) && forms.general.weight.$invalid}">\n <label class="control-label">{{\'APPLICATION_WEIGHT\' | translate}}</label>\n <input type="number" min="0" name="weight" placeholder="{{\'APPLICATION_WEIGHT\' | translate}}" class="form-control" data-ng-model="queue.weight" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_WEIGHT\' | translate }}\n </span>\n <span data-ng-show="(forms.general.weight.$touched || forms.general.$submitted) && forms.general.weight.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END WEIGHT -->\n\n <!-- START JOINEMPTY -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.joinempty.$touched || forms.general.$submitted) && forms.general.joinempty.$invalid}">\n <label class="control-label">{{\'APPLICATION_JOINEMPTY\' | translate}}</label>\n <ui-select multiple data-ng-model="queue.joinempty" name="joinempty" theme="bootstrap">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\',\'strict\',\'loose\',\'paused\',\'penalty\',\'inuse\',\'ringing\',\'unavailable\',\'invalid\',\'unknown\',\'wrapup\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_JOINEMPTY\' | translate }}\n </span>\n <span data-ng-show="(forms.general.joinempty.$touched || forms.general.$submitted) && forms.general.joinempty.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END JOINEMPTY -->\n\n <!-- START LEAVEWHENEMPTY -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.leavewhenempty.$touched || forms.general.$submitted) && forms.general.leavewhenempty.$invalid}">\n <label class="control-label">{{\'APPLICATION_LEAVEWHENEMPTY\' | translate}}</label>\n <ui-select multiple data-ng-model="queue.leavewhenempty" name="leavewhenempty" theme="bootstrap">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\',\'strict\',\'loose\',\'paused\',\'penalty\',\'inuse\',\'ringing\',\'unavailable\',\'invalid\',\'unknown\',\'wrapup\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_LEAVEWHENEMPTY\' | translate }}\n </span>\n <span data-ng-show="(forms.general.leavewhenempty.$touched || forms.general.$submitted) && forms.general.leavewhenempty.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END LEAVEWHENEMPTY -->\n\n <!-- START ANNOUNCE -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.general.announce.$touched || forms.general.$submitted) && forms.general.announce.$invalid}">\n <label class="control-label">{{\'APPLICATION_ANNOUNCE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="queue.announce" name="announce" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n <ui-select-choices repeat="returnAnnouncePath(announce) as announce in sounds | filter: $select.search">\n <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_ANNOUNCE\' | translate }}\n </span>\n <span data-ng-show="(forms.general.announce.$touched || forms.general.$submitted) && forms.general.announce.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END ANNOUNCE -->\n </div>\n </div>\n <!-- START DESCRIPTION -->\n <div class="form-group">\n <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="queue.description"></textarea>\n </div>\n <!-- END DESCRIPTION -->\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n\n <div class="tab-pane" id="tab_1_2">\n <form name="forms.announce" data-ng-submit="forms.announce.$valid && updateVoiceQueue()" novalidate>\n <div class="row">\n <div class="col-md-12">\n <!-- START PERIODIC_ANNOUNCE -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.periodic_announce.$touched || forms.announce.$submitted) && forms.announce.periodic_announce.$invalid}">\n <label class="control-label">{{\'APPLICATION_PERIODIC_ANNOUNCE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select multiple data-ng-model="queue.periodic_announce" name="periodic_announce" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.display_name}}</ui-select-match>\n <ui-select-choices repeat="returnAnnouncePath(announce) as announce in periodicAnnounces | filter: $select.search">\n <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_PERIODIC_ANNOUNCE\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.periodic_announce.$touched || forms.announce.$submitted) && forms.announce.periodic_announce.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END PERIODIC_ANNOUNCE -->\n </div>\n </div>\n <div class="row">\n <div class="col-md-6">\n <p><h3>{{\'APPLICATION_SETTINGS\' | translate}}</h3></p>\n <!-- START ANNOUNCE_FREQUENCY -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_frequency.$touched || forms.announce.$submitted) && forms.announce.announce_frequency.$invalid}">\n <label class="control-label">{{\'APPLICATION_ANNOUNCE_FREQUENCY\' | translate}}</label>\n <input type="number" min="0" name="announce_frequency" placeholder="{{\'APPLICATION_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.announce_frequency" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_ANNOUNCE_FREQUENCY\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.announce_frequency.$touched || forms.announce.$submitted) && forms.announce.announce_frequency.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END ANNOUNCE_FREQUENCY -->\n\n <!-- START MIN_ANNOUNCE_FREQUENCY -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.min_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.min_announce_frequency.$invalid}">\n <label class="control-label">{{\'APPLICATION_MIN_ANNOUNCE_FREQUENCY\' | translate}}</label>\n <input type="number" min="0" name="min_announce_frequency" placeholder="{{\'APPLICATION_MIN_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.min_announce_frequency" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_MIN_ANNOUNCE_FREQUENCY\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.min_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.min_announce_frequency.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END MIN_ANNOUNCE_FREQUENCY -->\n\n <!-- START PERIODIC_ANNOUNCE_FREQUENCY -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.periodic_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.periodic_announce_frequency.$invalid}">\n <label class="control-label">{{\'APPLICATION_PERIODIC_ANNOUNCE_FREQUENCY\' | translate}}</label>\n <input type="number" min="0" name="periodic_announce_frequency" placeholder="{{\'APPLICATION_PERIODIC_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.periodic_announce_frequency"/>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_PERIODIC_ANNOUNCE_FREQUENCY\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.periodic_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.periodic_announce_frequency.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END PERIODIC_ANNOUNCE_FREQUENCY -->\n\n <!-- START RANDOM_PERIODIC_ANNOUNCE -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.random_periodic_announce.$touched || forms.announce.$submitted) && forms.announce.random_periodic_announce.$invalid}">\n <label class="control-label">{{\'APPLICATION_RANDOM_PERIODIC_ANNOUNCE\' | translate}}</label>\n <ui-select data-ng-model="queue.random_periodic_announce" name="random_periodic_announce" theme="bootstrap">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_RANDOM_PERIODIC_ANNOUNCE\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.random_periodic_announce.$touched || forms.announce.$submitted) && forms.announce.random_periodic_announce.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END RANDOM_PERIODIC_ANNOUNCE -->\n\n <!-- START ANNOUNCE_HOLDTIME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_holdtime.$touched || forms.announce.$submitted) && forms.announce.announce_holdtime.$invalid}">\n <label class="control-label">{{\'APPLICATION_ANNOUNCE_HOLDTIME\' | translate}}</label>\n <ui-select data-ng-model="queue.announce_holdtime" name="announce_holdtime" theme="bootstrap">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\',\'once\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_ANNOUNCE_HOLDTIME\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.announce_holdtime.$touched || forms.announce.$submitted) && forms.announce.announce_holdtime.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END ANNOUNCE_HOLDTIME -->\n\n <!-- START ANNOUNCE_POSITION -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_position.$touched || forms.announce.$submitted) && forms.announce.announce_position.$invalid}">\n <label class="control-label">{{\'APPLICATION_ANNOUNCE_POSITION\' | translate}}</label>\n <ui-select data-ng-model="queue.announce_position" name="announce_position" theme="bootstrap">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\',\'limit\',\'more\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_ANNOUNCE_POSITION\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.announce_position.$touched || forms.announce.$submitted) && forms.announce.announce_position.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END ANNOUNCE_POSITION -->\n\n <!-- START ANNOUNCE_POSITION_LIMIT -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_position_limit.$touched || forms.announce.$submitted) && forms.announce.announce_position_limit.$invalid}">\n <label class="control-label">{{\'APPLICATION_ANNOUNCE_POSITION_LIMIT\' | translate}}</label>\n <input type="number" min="0" name="announce_position_limit" placeholder="{{\'APPLICATION_ANNOUNCE_POSITION_LIMIT\' | translate}}" class="form-control" data-ng-model="queue.announce_position_limit"/>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_ANNOUNCE_POSITION_LIMIT\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.announce_position_limit.$touched || forms.announce.$submitted) && forms.announce.announce_position_limit.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END ANNOUNCE_POSITION_LIMIT -->\n\n <!-- START REPORTHOLDTIME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.reportholdtime.$touched || forms.announce.$submitted) && forms.announce.reportholdtime.$invalid}">\n <label class="control-label">{{\'APPLICATION_REPORTHOLDTIME\' | translate}}</label>\n <ui-select data-ng-model="queue.reportholdtime" name="reportholdtime" theme="bootstrap">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_REPORTHOLDTIME\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.reportholdtime.$touched || forms.announce.$submitted) && forms.announce.reportholdtime.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END REPORTHOLDTIME -->\n\n </div>\n <div class="col-md-6">\n <p><h3>{{\'APPLICATION_SOUNDS\' | translate}}</h3></p>\n <!-- START QUEUE_REPORTHOLD -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_reporthold.$touched || forms.announce.$submitted) && forms.announce.queue_reporthold.$invalid}">\n <label class="control-label">{{\'APPLICATION_QUEUE_REPORTHOLD\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="queue.queue_reporthold" name="queue_reporthold" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n <ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_REPORTHOLD\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.queue_reporthold.$touched || forms.announce.$submitted) && forms.announce.queue_reporthold.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END QUEUE_REPORTHOLD -->\n\n <!-- START QUEUE_YOUARENEXT -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_youarenext.$touched || forms.announce.$submitted) && forms.announce.queue_youarenext.$invalid}">\n <label class="control-label">{{\'APPLICATION_QUEUE_YOUARENEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="queue.queue_youarenext" name="queue_youarenext" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n <ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_YOUARENEXT\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.queue_youarenext.$touched || forms.announce.$submitted) && forms.announce.queue_youarenext.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END QUEUE_YOUARENEXT -->\n\n <!-- START QUEUE_THEREARE -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_thereare.$touched || forms.announce.$submitted) && forms.announce.queue_thereare.$invalid}">\n <label class="control-label">{{\'APPLICATION_QUEUE_THEREARE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="queue.queue_thereare" name="queue_thereare" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n <ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_THEREARE\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.queue_thereare.$touched || forms.announce.$submitted) && forms.announce.queue_thereare.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END QUEUE_THEREARE -->\n\n <!-- START QUEUE_CALLSWAITING -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_callswaiting.$touched || forms.announce.$submitted) && forms.announce.queue_callswaiting.$invalid}">\n <label class="control-label">{{\'APPLICATION_QUEUE_CALLSWAITING\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="queue.queue_callswaiting" name="queue_callswaiting" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n <ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_CALLSWAITING\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.queue_callswaiting.$touched || forms.announce.$submitted) && forms.announce.queue_callswaiting.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END QUEUE_CALLSWAITING -->\n\n <!-- START QUEUE_HOLDTIME -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_holdtime.$touched || forms.announce.$submitted) && forms.announce.queue_holdtime.$invalid}">\n <label class="control-label">{{\'APPLICATION_QUEUE_HOLDTIME\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="queue.queue_holdtime" name="queue_holdtime" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n <ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_HOLDTIME\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.queue_holdtime.$touched || forms.announce.$submitted) && forms.announce.queue_holdtime.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END QUEUE_HOLDTIME -->\n\n <!-- START QUEUE_MINUTES -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_minutes.$touched || forms.announce.$submitted) && forms.announce.queue_minutes.$invalid}">\n <label class="control-label">{{\'APPLICATION_QUEUE_MINUTES\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="queue.queue_minutes" name="queue_minutes" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n <ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_MINUTES\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.queue_minutes.$touched || forms.announce.$submitted) && forms.announce.queue_minutes.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END QUEUE_MINUTES -->\n\n <!-- START QUEUE_MINUTE -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_minute.$touched || forms.announce.$submitted) && forms.announce.queue_minute.$invalid}">\n <label class="control-label">{{\'APPLICATION_QUEUE_MINUTE\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="queue.queue_minute" name="queue_minute" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n <ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_MINUTE\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.queue_minute.$touched || forms.announce.$submitted) && forms.announce.queue_minute.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END QUEUE_MINUTE -->\n\n <!-- START QUEUE_SECONDS -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_seconds.$touched || forms.announce.$submitted) && forms.announce.queue_seconds.$invalid}">\n <label class="control-label">{{\'APPLICATION_QUEUE_SECONDS\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="queue.queue_seconds" name="queue_seconds" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n <ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_SECONDS\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.queue_seconds.$touched || forms.announce.$submitted) && forms.announce.queue_seconds.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END QUEUE_SECONDS -->\n\n <!-- START QUEUE_THANKYOU -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_thankyou.$touched || forms.announce.$submitted) && forms.announce.queue_thankyou.$invalid}">\n <label class="control-label">{{\'APPLICATION_QUEUE_THANKYOU\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="queue.queue_thankyou" name="QUEUE_THANKYOU" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n <ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_THANKYOU\' | translate }}\n </span>\n <span data-ng-show="(forms.announce.queue_thankyou.$touched || forms.announce.$submitted) && forms.announce.queue_thankyou.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END QUEUE_THANKYOU -->\n\n </div>\n </div>\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END GENERAL TAB -->\n <!-- ADVANCED TAB -->\n <div class="tab-pane" id="tab_1_3">\n <form name="forms.advanced" data-ng-submit="forms.advanced.$valid && updateVoiceQueue()" novalidate>\n\n <div class="row">\n <div class="col-md-6">\n\n <!-- START AUTOPAUSE -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.autopause.$touched || forms.advanced.$submitted) && forms.advanced.autopause.$invalid}">\n <label class="control-label">{{\'APPLICATION_AUTOPAUSE\' | translate}}</label>\n <ui-select data-ng-model="queue.autopause" name="autopause" theme="bootstrap">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\',\'all\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_AUTOPAUSE\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.autopause.$touched || forms.advanced.$submitted) && forms.advanced.autopause.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END AUTOPAUSE -->\n\n <!-- START RINGINUSE -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.ringinuse.$touched || forms.advanced.$submitted) && forms.advanced.ringinuse.$invalid}">\n <label class="control-label">{{\'APPLICATION_RINGINUSE\' | translate}}</label>\n <ui-select data-ng-model="queue.ringinuse" name="ringinuse" theme="bootstrap">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_RINGINUSE\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.ringinuse.$touched || forms.advanced.$submitted) && forms.advanced.ringinuse.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END RINGINUSE -->\n\n <!-- START MEMBER_DELAY -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.memberdelay.$touched || forms.advanced.$submitted) && forms.advanced.memberdelay.$invalid}">\n <label class="control-label">{{\'APPLICATION_MEMBER_DELAY\' | translate}}</label>\n <input type="number" min="0" name="memberdelay" placeholder="{{\'APPLICATION_MEMBER_DELAY\' | translate}}" class="form-control" data-ng-model="queue.memberdelay" required/>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_MEMBER_DELAY\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.memberdelay.$touched || forms.advanced.$submitted) && forms.advanced.memberdelay.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END MEMBER_DELAY -->\n </div>\n <div class="col-md-6">\n\n <!-- START TIMEOUTRESTART -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.timeoutrestart.$touched || forms.advanced.$submitted) && forms.advanced.timeoutrestart.$invalid}">\n <label class="control-label">{{\'APPLICATION_TIMEOUTRESTART\' | translate}}</label>\n <ui-select data-ng-model="queue.timeoutrestart" name="timeoutrestart" theme="bootstrap">\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n <div ng-bind-html="item | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_TIMEOUTRESTART\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.timeoutrestart.$touched || forms.advanced.$submitted) && forms.advanced.timeoutrestart.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END TIMEOUTRESTART -->\n\n <!-- START MONITOR_FORMAT -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.monitor_format.$touched || forms.advanced.$submitted) && forms.advanced.monitor_format.$invalid}">\n <label class="control-label">{{\'APPLICATION_MONITOR_FORMAT\' | translate}}<span class="required" aria-required="true">*</span></label>\n <ui-select data-ng-model="queue.monitor_format" name="monitor_format" theme="bootstrap" required>\n <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="monFormat.value as monFormat in monitorFormats | filter: $select.search">\n <div ng-bind-html="monFormat.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_MONITOR_FORMAT\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.monitor_format.$touched || forms.advanced.$submitted) && forms.advanced.monitor_format.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END MONITOR_FORMAT -->\n\n <!-- START CONTEXT -->\n <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.context.$touched || forms.advanced.$submitted) && forms.advanced.context.$invalid}">\n <label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}</label>\n <ui-select data-ng-model="queue.context" name="context" theme="bootstrap">\n <ui-select-match allow-clear placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n <ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n <div ng-bind-html="context.name | highlight: $select.search"></div>\n </ui-select-choices>\n </ui-select>\n <span class="help-block">\n {{ \'DESCRIPTION_QUEUE_VOICE_CONTEXT\' | translate }}\n </span>\n <span data-ng-show="(forms.advanced.context.$touched || forms.advanced.$submitted) && forms.advanced.context.$error.required" class="help-block help-block-error">\n <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n </span>\n </div>\n <!-- END CONTEXT -->\n\n </div>\n </div>\n\n <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n </form>\n </div>\n <!-- END ADVANCED TAB -->\n\n </div>\n </div>\n </div>\n </div>\n</div>\n'),