Subject: 0.0.4 | Built motion from commit 75d34a4.
From: Motion Team <[email-masked]>
Date: Mon, 7 Dec 2015 16:21:14 +0000 (+0100)

0.0.4 | Built motion from commit 75d34a4.
---

diff --git a/package.json b/package.json
index 265c1bc..a3757ac 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "motion",
-  "version": "0.0.4",
+  "version": "0.0.5",
   "main": "server/app.js",
   "dependencies": {
     "accept-language-parser": "^1.0.2",
diff --git a/public/app/f18fc4d6.app.js b/public/app/c7c298e3.app.js
similarity index 86%
rename from public/app/f18fc4d6.app.js
rename to public/app/c7c298e3.app.js
index f26adc8..b059bea 100644
--- a/public/app/f18fc4d6.app.js
+++ b/public/app/c7c298e3.app.js
@@ -2,11 +2,11 @@
 g.UserId=a.application.UserId;break;case"queue":g.chatQueueId=a.application.chatQueueId}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/chat/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.chat.websites.view.actions.view",{url:"/view/:actionId",templateUrl:"app/chat/website/view/action/view/view.html",controller:"chatWebsiteViewActionViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("chatWebsiteViewActionWizardCtrl",["$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/chat/queues",{params:{page:0,per_page:1e3}}).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:1e3}}).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,ChatWebsiteId:c.websiteId};switch(a.application.app){case"agent":f.UserId=a.application.UserId;break;case"queue":f.ChatQueueId=a.application.ChatQueueId}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/chat/applications",f).success(function(){e.path("/chat/websites/view/"+c.websiteId+"/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.chat.websites.view.actions.wizard",{url:"/wizard",templateUrl:"app/chat/website/view/action/wizard/wizard.html",controller:"chatWebsiteViewActionWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.chat.websites.view.snippet",{url:"/snippet",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("chatWebsiteViewSnippetViewCtrl",["$scope","$http","$stateParams","$translate",function(a,b,c,d){a.$translate=d,a.statePreview={state:"online"},a.lang={HeaderCurrentlyChatting:"Live Chat",HeaderOffline:"Contact us",OperatorOfflineMessage:"It appears as if all operators are currently offline.",OfflineMessage:"<strong>We're not online.</strong><br/>It doesn't mean we're not there to help - leave your message below and we'll be in touch as soon as possible.",EnquiryMessagePlaceholder:"Your message...",EnquiryButtonText:"Leave message",EnquirySubmitSuccess:"Your message was sucessfully submitted - we will contact you as soon as possible.",OperatorComposing:"{fullname} is typing...",FirstMessageText:"",ExitChatButtonText:"Exit Chat",ExitChatQuestionText:"Are you sure?",ExitChatButtonConfirmText:"Yes",ExitChatButtonCancelText:"No",MessagePlaceholderText:"Your message...",MessageSendButtonText:"Send",ValidationEmailRequired:"Please enter your email address",ValidationEmailInvalid:"Please enter a valid email address",ValidationEmailMaxLength:"The email address may not exceed 85 characters",ValidationUsernameRequired:"Please enter your name",ValidationUsernameMaxLength:"The name may not exceed 45 characters",ValidationEnquiryRequired:"Please enter your enquiry",ValidationEnquiryMaxLength:"The enquiry may not exceed 1500 characters",ValidationMessageRequired:"Please enter your message",ValidationMessageMaxLength:"The message may not exceed 750 characters"},a.getSnippetCode=function(){b.get("api/chat/websites/"+c.websiteId+"/snippet").success(function(b){a.snippetCode=b})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.chat.websites.view.snippet.view",{url:"/view",templateUrl:"app/chat/website/view/snippet/view/view.html",controller:"chatWebsiteViewSnippetViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewCtrl",["$scope","xAlert","$http","$location","$stateParams","$translate","WizardHandler",function(a,b,c,d,e,f,g){a.initApplication=function(){a.forms={},a.application={}},a.goNext=function(){g.wizard().next()},a.formValidation=function(a){return a},a.deleteItem=function(a){c["delete"]("api/chat/applications/"+a).error(function(){b.show(f.instant("Something went wrong!"),"danger")})},a.initView=function(){c.get("/api/chat/websites/"+e.websiteId).success(function(b){a.chatWebsite=b}).error(function(a){b.show(a.message,"danger")})},a.updateItem=function(){c.put("/api/chat/websites/"+a.chatWebsite.id,a.chatWebsite).success(function(){b.show(f.instant("MESSAGE_CHAT_WEBSITE_UPDATE_SUCCESS")+"!","success")}).error(function(){b.show(f.instant("MESSAGE_CHAT_WEBSITE_UPDATE_FAILURE"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.chat.websites.view",{url:"/view/:websiteId",templateUrl:"app/chat/website/view/view.html",controller:"ChatWebsiteViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.chat.websites",{url:"/websites",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteWizardCtrl",["$scope","$http","$location","$translate","WizardHandler","xAlert",function(a,b,c,d,e,f){a.$translate=d,a.forms={formSetting:void 0,formAppearance:void 0,formLabel:void 0,formFunctionality:void 0},a.next=function(){e.wizard().next()},a.exitValidation=function(a){return a},a.item={},a.createItem=function(){b.post("api/chat/websites",a.item).success(function(){f.show(d.instant("MESSAGE_CHAT_WEBSITE_CREATE_SUCCESS"),"success"),c.path("/chat/websites/list")}).error(function(){f.show(d.instant("MESSAGE_CHAT_WEBSITE_CREATE_FAILURE"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.chat.websites.wizard",{url:"/wizard",templateUrl:"app/chat/website/wizard/wizard.html",controller:"ChatWebsiteWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("ContactManagerCtrl",["$scope",function(a){a.message="Hello"}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager",{url:"/contactmanager",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ContactManagerListCtrl",["$scope","$http","$translate","$rootScope","xAlert","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={contactsByPage:{name:"10",value:10},labels:["mailbox","fullname","email"]},a.contactsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.contacts={checked:[]},a.check=function(b,c){c?a.contacts.checked=angular.copy(_.pluck(a.displayedContacts,"id")):a.contacts.checked=[]},a.getContacts=function(b){return _.map(a.displayedContacts,function(a){return b.forEach(function(b){contact[b]=a[b]}),contact})},a.initList=function(b){f.unsyncUpdates("contact_manager"),b.url="/api/contactmanager",h.getPage(b).then(function(c){a.displayedContacts=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.contactsByPage,a.displayedContacts.length),d.updateTableConfig(a.conf.contactsByPage,a.displayedContacts.length)}),f.socket.on("contact_manager:save",function(){a.initList(b)}),f.socket.on("contact_manager:remove",function(c){a.contacts.checked=_.without(a.contacts.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/contactmanager/"+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/contactmanager",{params:{id:a.contacts.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.contactmanager.list",{url:"/list",templateUrl:"app/contactmanager/list/list.html",controller:"ContactManagerListCtrl",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("ContactManagerViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$sce","Modal","$location",function(a,b,c,d,e,f,g,h,i){a.getContact=function(){b.get("/api/contactmanager/"+e.id).success(function(b){delete b.password,delete b.stamp,a.contact=b}).error(function(a){console.error(a),i.path("/contactmanager/list")})},a.updateContact=function(){var f=angular.copy(a.contact);b.put("/api/contactmanager/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.contact=f})},a.getHistory=function(){b.get("/api/contactmanager/"+e.id+"/history/").success(function(b){a.contactHistory=b,f.syncUpdates("contact_history",a.contactHistory)}).error(function(a){c.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.view",{url:"/view/:id",templateUrl:"app/contactmanager/view/view.html",controller:"ContactManagerViewCtrl",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.contactmanager.view.settings",{url:"/settings",templateUrl:"app/contactmanager/view/view.settings.html"}).state("main.contactmanager.view.history",{url:"/messages",templateUrl:"app/contactmanager/view/view.history.html"})}]),angular.module("xCallyShuttleApp").controller("ContactManagerWizardCtrl",["$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/contactmanager/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/contactmanager/",a.item).success(function(){d.path("/contactmanager/list")}).error(function(a){e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.wizard",{url:"/wizard",templateUrl:"app/contactmanager/wizard/wizard.html",controller:"ContactManagerWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("DashboardCtrl",["$scope","$translate",function(a,b){a.voice=[{name:b.instant("APPLICATION_QUEUE"),link:"main.dashboard.voice"}],a.mail=[{name:b.instant("APPLICATION_QUEUE"),link:"main.dashboard.mail"}]}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.dashboard",{"abstract":!0,url:"/dashboard",templateUrl:"app/dashboard/dashboard.html",controller:"DashboardCtrl"}).state("main.dashboard.voice",{url:"/voice",controller:"DashboardVoiceCtrl",templateUrl:"app/dashboard/voice/voice.html"}).state("main.dashboard.mail",{url:"/mail",controller:"DashboardMailCtrl",templateUrl:"app/dashboard/mail/mail.html"})}]),angular.module("xCallyShuttleApp").controller("DashboardMailCtrl",["$scope",function(a){a.message="Hello"}]),angular.module("xCallyShuttleApp").controller("DashboardVoiceCtrl",["$scope","$http","xAlert","socket",function(a,b,c,d){function e(b,c){console.log("element in check Function is",b);var d;return!b.queuecallerjoinAt||b.queuecallerleaveAt||b.queuecallercompleteAt||b.queuecallerabandonAt?b.queuecallerjoinAt&&b.queuecallerleaveAt&&!b.queuecallercompleteAt&&!b.queuecallerabandonAt?d="activeCalls":b.queuecallerjoinAt&&b.queuecallerleaveAt&&b.queuecallercompleteAt&&!b.queuecallerabandonAt?d="completedCalls":b.queuecallerjoinAt&&b.queuecallerleaveAt&&!b.queuecallercompleteAt&&b.queuecallerabandonAt&&(d="abandonedCalls"):d="waitCalls",console.log("result type is",d),c?d:void(d&&a.queueStats[d]++)}a.queueStats={abandonedCalls:0,completedCalls:0,waitCalls:0,activeCalls:0},a.getQueueStats=function(){b.get("/api/report/queues").then(function(b){a.queueReports=b.data,a.queueReports.forEach(function(a){e(a,!1)}),d.socket.on("report_queue:save",function(b){console.log("report save or update");var c=_.find(a.queueReports,{id:b.id}),d=a.queueReports.indexOf(c);if(c){console.log("found item, is an update");var f=e(c,!0);console.log("old item value is "+f+", decrementing..."),f&&a.queueStats[f]--,_.merge(a.queueReports[d],b)}else console.log("item not found in collection, is a create"),a.queueReports.unshift(b);console.log("checking new item type and increasing..."),e(b,!1)})})["catch"](function(a){c.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.accounts",{url:"/accounts",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("FaxAccountListCtrl",["$scope","$http","xAlert","$translate","socket","Modal","$rootScope","$log","stResource",function(a,b,c,d,e,f,g,h,i){a.conf={faxAccountsByPage:{name:"10",value:10}},a.faxAccountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.fax_accounts={checked:[]},a.check=function(b,c){c?a.fax_accounts.checked=angular.copy(_.pluck(a.displayedFaxAccounts,"id")):a.fax_accounts.checked=[]},a.initList=function(b){e.unsyncUpdates("fax_account"),b.url="/api/fax/accounts",i.getPage(b).then(function(c){a.displayedFaxAccounts=c.rows,b.pagination.numberOfPages=c.total_pages,g.updateTableConfig(a.faxAccountsByPage,a.displayedFaxAccounts.length),g.updateTableConfig(a.conf.faxAccountsByPage,a.displayedFaxAccounts.length)}),e.socket.on("fax_account:save",function(){a.initList(b)}),e.socket.on("fax_account:remove",function(c){a.fax_accounts.checked=_.without(a.fax_accounts.checked,c.id),a.initList(b)})},a.deleteItem=f.confirm["delete"](function(a){b["delete"]("api/fax/accounts/"+a).success(function(){c.show(d.instant("MESSAGE_FAX_ACCOUNT_DELETE_SUCCESS"),"success")}).error(function(){c.show(d.instant("MESSAGE_FAX_ACCOUNT_DELETE_FAILURE"),"danger")})}),a.deleteItems=f.confirm["delete"](function(){b["delete"]("/api/fax/accounts",{params:{id:a.fax_accounts.checked}}).success(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){c.show(d.instant(a.message),"danger")})}),a.getFaxAccounts=function(b){return _.map(a.faxAccountsByPage,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.$on("$destroy",function(){e.unsyncUpdates("fax_account")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.accounts.list",{url:"/list",templateUrl:"app/fax/account/list/list.html",controller:"FaxAccountListCtrl",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("FaxAccountViewCtrl",["$scope","$http","$stateParams","$translate","$location","WizardHandler","socket","xAlert","Modal",function(a,b,c,d,e,f,g,h,i){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.forms={},a.sortableOptions={stop:function(){b.post("api/fax/accounts/"+c.id+"/applications",{applications:_.pluck(a.faxApplications,"id")}).success(function(b){a.faxApplications=b}).error(function(a){console.error(a)})},"ui-floating":!0},a.goNext=function(){f.wizard().next()},a.formValidation=function(a){return a},a.initApplication=function(){a.forms={},a.application={}},a.deleteItem=i.confirm["delete"](function(a){b["delete"]("api/fax/applications/"+a).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.getAppdata=function(b,c){switch(b){case"agent":return a.agents?_.find(a.agents,{id:c}).name:c;case"queue":return a.faxQueues?_.find(a.faxQueues,{id:c}).name:c}return"UNKNOWN"},a.createItem=function(){switch(a.application.appdata=a.application.appdata.id,a.application.app){case"agent":a.application.UserId=parseInt(a.application.appdata,10);break;case"queue":a.application.FaxQueueId=parseInt(a.application.appdata,10)}a.application.FaxAccountId=c.id,b.post("api/fax/applications",a.application).success(function(){e.path("fax/accounts/view/"+c.id+"/routes")}).error(function(){h.show("Something went wrong!","danger")})},a.$watch("application.app",function(c){if(c){var d;switch(c){case"agent":d="api/agents";break;case"queue":d="api/fax/queues"}b.get(d).success(function(b){a.items=b.rows})}},!0),a.initView=function(){b.get("/api/trunks").success(function(b){a.trunks=b.rows}).error(function(a){console.log(a)}),b.get("/api/fax/accounts/"+c.id).success(function(b){a.account=b}).error(function(){})},a.getAgents=function(){b.get("api/fax/agents").success(function(b){a.agents=b})},a.getFaxApplications=function(){b.get("/api/fax/applications",{params:{FaxAccountId:c.id}}).success(function(b){a.faxApplications=b,g.socket.on("fax_application:remove",function(b){_.remove(a.faxApplications,{id:b.id})})}),b.get("/api/agents").success(function(b){a.agents=b.rows}),b.get("/api/fax/queues").success(function(b){a.faxQueues=b.rows})},a.updateItemFaxAccount=function(){b.put("/api/fax/accounts/"+c.id,a.account).success(function(){h.show(d.instant("MESSAGE_FAX_ACCOUNT_UPDATE_SUCCESS")+".","success")}).error(function(){h.show(d.instant("MESSAGE_FAX_ACCOUNT_UPDATE_FAILURE")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.accounts.view",{url:"/view/:id",templateUrl:"app/fax/account/view/view.html",controller:"FaxAccountViewCtrl",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.fax.accounts.view.settings",{url:"/settings",templateUrl:"app/fax/account/view/view.settings.html",authenticate:!0}).state("main.fax.accounts.view.routes",{url:"/routes",templateUrl:"app/fax/account/view/view.routes.html",authenticate:!0}).state("main.fax.accounts.view.applications",{url:"/applications",templateUrl:"app/fax/account/view/view.applications.html",authenticate:!0})}]),angular.module("xCallyShuttleApp").controller("FaxAccountWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,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.$translate=d,a.forms={},a.item={},a.item.ecm=!1,a.item.minrate="9600",a.item.maxrate="33600",b.get("/api/trunks").success(function(b){a.trunks=b.rows}).error(function(a){console.error(a)})},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("api/fax/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_FAX_ACCOUNT_CREATE_SUCCESS")+".","success"),c.path("/fax/accounts/list")}).error(function(){e.show(d.instant("MESSAGE_FAX_ACCOUNT_CREATE_FAILURE")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.accounts.wizard",{url:"/wizard",templateUrl:"app/fax/account/wizard/wizard.html",controller:"FaxAccountWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.automations",{url:"/automations",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("FaxAutomationListCtrl",["$scope","$http","$translate","$rootScope","stResource","Modal","socket","xAlert",function(a,b,c,d,e,f,g,h){a.conf={faxAutomationsByPage:{name:"10",value:10}},a.faxAutomationsByPage=[{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.faxAutomations={checked:[]},a.check=function(b,c){c?a.faxAutomations.checked=angular.copy(_.pluck(a.displayedFaxAutomations,"id")):a.faxAutomations.checked=[]},a.getFaxAutomations=function(b){return _.map(a.displayedFaxAutomations,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){g.unsyncUpdates("fax_business_automation"),b.url="/api/fax/business/automations",e.getPage(b).then(function(c){a.displayedFaxAutomations=c.rows,b.pagination.numberOfPages=c.total_pages,d.updateTableConfig(a.faxAutomationsByPage,a.displayedFaxAutomations.length),d.updateTableConfig(a.conf.faxAutomationsByPage,a.displayedFaxAutomations.length)}),g.socket.on("fax_business_automation:save",function(){a.initList(b)}),g.socket.on("fax_business_automation:remove",function(c){a.faxAutomations.checked=_.without(a.faxAutomations.checked,c.id),a.initList(b)})},a.deleteItem=f.confirm["delete"](function(a){b["delete"]("/api/fax/business/automations/"+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/fax/business/automations",{params:{id:a.faxAutomations.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/fax/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")})},a.$on("$destroy",function(){g.unsyncUpdates("fax_business_automation")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.automations.list",{url:"/list",templateUrl:"app/fax/automation/list/list.html",controller:"FaxAutomationListCtrl",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("FaxAutomationViewCtrl",["$scope","$stateParams","$http","automation","socket","xAlert","$translate","$log",function(a,b,c,d,e,f,g,h){a.initView=function(){a.forms={info:{}},a.automations=d.automations,c.get("/api/fax/business/automations/"+b.id).success(function(c){h.debug(c),a.test=c,a.automation=c,e.syncUpdatesByAttributes("business_condition",{FaxBusinessAutomationId:b.id},c.BusinessConditions)}).error(function(){f.show(g.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.updateAutomation=function(){c.put("/api/fax/business/automations/"+a.automation.id,{name:a.automation.name,description:a.automation.description}).success(function(a){h.debug(a),f.show(g.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(g.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger"),h.error(a)})},a.getOperatorsByCondition=function(a){var b=[],c=_.find(d.automations.conditions,{key:a});return c.operators&&c.operators.length&&(b=c.operators),b},a.getAttributesByCondition=function(a){var b=[],c=_.find(d.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",FaxBusinessAutomationId:a.automation.id}).success(function(b){a.automation.BusinessConditions.push(b)}).error(function(a){console.error(a),f.show(g.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.addNewAction=function(){c.post("/api/business/actions",{condition:"status",FaxBusinessAutomationId:a.automation.id}).success(function(b){a.automation.BusinessActions.push(b)}).error(function(a){console.error(a)})},a.removeCondition=function(a){c["delete"]("/api/business/conditions/"+a).success(function(a){console.log(a),f.show(g.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){console.error(a),f.show(g.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.removeAction=function(b){c["delete"]("/api/business/actions/"+b).success(function(b){console.log(b),a.automation.BusinessActions=_.reject(a.automation.BusinessActions,{id:b.id})}).error(function(a){console.error(a),f.show(g.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.updateCondition=function(a,b,d){var e={};e[b]=d,c.put("/api/business/conditions/"+a,e).success(function(a){console.log(a),f.show(g.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){console.error(a),f.show(g.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.updateAction=function(a,b,d){var e={};e[b]=d,c.put("/api/business/actions/"+a,e).success(function(a){console.log(a),f.show(g.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){console.error(a),f.show(g.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.automations.view",{url:"/view/:id",templateUrl:"app/fax/automation/view/view.html",controller:"FaxAutomationViewCtrl",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.fax.automations.view.settings",{url:"/settings",templateUrl:"app/fax/automation/view/view.settings.html",authenticate:!0}).state("main.fax.automations.view.routes",{url:"/routes",templateUrl:"app/fax/automation/view/view.routes.html",authenticate:!0}).state("main.fax.automations.view.application",{url:"/application",templateUrl:"app/fax/automation/view/view.application.html",authenticate:!0})}]),angular.module("xCallyShuttleApp").controller("FaxAutomationWizardCtrl",["$scope","$http","$location","automation","WizardHandler","xAlert","$translate",function(a,b,c,d,e,f,g){a.forms={},a.automations={or:[],and:[],actions:[]},a.addNewChoice=function(b){var c=angular.copy(d.automations);a.automations[b].push(c)},a.removeChoice=function(b,c){a.automations[b].splice(c)},a.goNext=function(){e.wizard().next()},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/fax/business/automations",a.automations).success(function(){f.show(g.instant("MESSAGE_WELL_DONE"),"success"),c.path("/fax/automations/list")}).error(function(a){console.error(a),f.show(g.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.formValidation=function(a){return a}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.automations.wizard",{url:"/wizard",templateUrl:"app/fax/automation/wizard/wizard.html",controller:"FaxAutomationWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax",{url:"/fax",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("FaxInboxComposeCtrl",["$scope","$http","FileUploader","$location","Auth","xAlert","$cookieStore","$translate",function(a,b,c,d,e,f,g,h){a.forms={},a.form={to:[],sto:[]},b.get("api/fax/accounts").success(function(b){a.faxAccounts=b.rows}),a.isNewMessageFromEmpty=!0;var i=a.uploader=new c({url:"api/fax/messages",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+g.get("token")}});i.filters.push({name:"pdfFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|pdf|".indexOf(b)}}),i.onBeforeUploadItem=function(b){b.formData.push({accountId:a.form.from.id,toNum:a.form.sto[0],isNewRoom:a.isNewMessageFromEmpty,userId:e.getCurrentUser().id,html:a.form.html?a.form.html:""})},i.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d)},i.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d)},i.onCompleteAll=function(){i.clearQueue(),f.show(h.instant("MESSAGE_WELL_DONE"),"success"),d.path("/fax/inbox/incoming")},i.onWhenAddingFileFailed=function(){f.show(h.instant("MESSAGE_WRONG_FORMAT"),"danger")},a.sendFax=function(){return a.form.sto.length?void(i.queue.length?i.uploadAll():b.post("api/fax/messages",{accountId:a.form.from.id,toNum:a.form.sto[0],isNewRoom:a.isNewMessageFromEmpty,userId:e.getCurrentUser().id,html:a.form.html,onlyText:!0}).success(function(){f.show(h.instant("MESSAGE_WELL_DONE"),"success"),d.path("/fax/inbox/incoming")}).error(function(a){f.show(h.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger"),console.error(a)})):(a.forms.compose.to.$valid=!1,void(a.forms.compose.to.$invalid=!0))},a.cancel=function(){a.form.sto=[],delete a.form.from}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.inbox.compose",{url:"/compose",templateUrl:"app/fax/inbox/room/room.html",controller:"FaxInboxComposeCtrl"})}]),angular.module("xCallyShuttleApp").controller("FaxInboxCtrl",["$scope","$http","$location","$translate","$timeout","$notification","Auth","socket","$interval",function(a,b,c,d,e,f,g,h,i){a.go=function(a,d,e){e?b.put("/api/fax/rooms/"+d,{status:e}).success(function(){c.path(a)}).error(function(a){console.error(a)}):c.path(a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.inbox",{url:"/inbox",templateUrl:"app/fax/inbox/inbox.html",controller:"FaxInboxCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",
 files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/inbox.css","assets/css/todo.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("FaxInboxIncomingCtrl",["$scope","$http","$location","socket","Auth","xAlert",function(a,b,c,d,e,f){a.$location=c,a.getRooms=function(){e.isAdmin()?b.get("api/fax/rooms").success(function(b){a.faxRooms=b,d.syncUpdates("fax_room",a.faxRooms)}).error(function(a){console.error(a),f.show($translate.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")}):b.get("api/fax/rooms/agent/"+e.getCurrentUser().id).success(function(b){a.faxRooms=b,d.socket.on("fax_room:update",function(b){b.UserId===e.getCurrentUser().id&&a.faxRooms.push(b)})}).error(function(a){f.show($translate.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger"),console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.inbox.incoming",{url:"/incoming",templateUrl:"app/fax/inbox/incoming/incoming.html",controller:"FaxInboxIncomingCtrl"})}]),angular.module("xCallyShuttleApp").controller("FaxInboxRoomCtrl",["$scope","$http","$stateParams","$location","FileUploader","socket","Auth","xAlert","$translate","$cookieStore",function(a,b,c,d,e,f,g,h,i,j){function k(){a.lastMessage=_.reject(a.faxRoom.FaxMessages,function(a){return"RECEIVED"!==a.status}),a.lastMessage=_.sortByOrder(a.lastMessage,["id"],["desc"])[0],a.lastMessage&&(console.log(a.faxRoom),a.form.from=a.faxRoom.FaxAccount,a.form.to=[a.lastMessage.From.phone],a.form.sto=[a.lastMessage.From.phone])}var l=a.uploader=new e({url:"api/fax/messages",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+j.get("token")}});l.filters.push({name:"pdfFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|pdf|".indexOf(b)}}),l.onBeforeUploadItem=function(b){console.log(a.form.from.id,a.form.sto[0],a.isNewMessageFromEmpty,c.id,g.getCurrentUser().id),b.formData.push({accountId:a.form.from.id,toNum:a.form.sto[0],isNewRoom:a.isNewMessageFromEmpty,roomId:c.id,userId:g.getCurrentUser().id,html:a.form.html}),console.log(b)},l.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d)},l.onErrorItem=function(a,b,c,d){console.info("onErrorItem",b,c,d)},l.onCompleteAll=function(){l.clearQueue(),h.show(i.instant("MESSAGE_WELL_DONE"),"success")},l.onWhenAddingFileFailed=function(){h.show(i.instant("MESSAGE_WRONG_FORMAT"),"danger")},a.initRoomView=function(){a.isNewMessageFromEmpty=!0,a.Auth=g,a.forms={},a.form={to:[],sto:[]},b.get("api/agents").success(function(b){a.agents=b}),b.get("api/fax/accounts").success(function(b){a.faxAccounts=b.rows}),c.id&&b.get("/api/fax/rooms/"+c.id).success(function(b){a.faxRoom=b,a.isNewMessageFromEmpty=!1,f.syncUpdates("fax_message",[],function(b,c){"created"===b&&c.FaxRoomId===a.faxRoom.id&&(a.faxRoom.FaxMessages.push(c),k())}),k()}).error(function(a){console.error(a),h.show(i.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.sendFax=function(){return a.form.sto.length?void(l.queue.length?l.uploadAll():b.post("api/fax/messages",{accountId:a.form.from.id,toNum:a.form.sto[0],isNewRoom:a.isNewMessageFromEmpty,userId:g.getCurrentUser().id,html:a.form.html,onlyText:!0}).success(function(){h.show(i.instant("MESSAGE_WELL_DONE"),"success"),console.log("Fax Message sent")}).error(function(a){h.show(i.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger"),console.error(a)})):(a.forms.compose.to.$valid=!1,void(a.forms.compose.to.$invalid=!0))},a.assignAgent=function(a){b.put("/api/fax/rooms/"+c.id,{UserId:a}).success(function(){h.show(i.instant("MESSAGE_WELL_DONE"),"danger")}).error(function(){h.show(i.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.updateStatus=function(d){b.put("/api/fax/rooms/"+c.id,{status:d}).success(function(b){a.faxRoom.status=b.status,h.show(i.instant("MESSAGE_WELL_DONE"),"danger")}).error(function(a){console.error(a),h.show(i.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.cancel=function(){a.form.sto=[],delete a.form.from,l.clearQueue()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.inbox.room",{url:"/room/:id",templateUrl:"app/fax/inbox/room/room.html",controller:"FaxInboxRoomCtrl"})}]),angular.module("xCallyShuttleApp").controller("FaxQueueListCtrl",["$scope","$rootScope","$http","$translate","socket","Modal","xAlert","stResource",function(a,b,c,d,e,f,g,h){a.$on("$destroy",function(){e.unsyncUpdates("fax_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.faxQueues={checked:[]},a.check=function(b,c){c?a.faxQueues.checked=angular.copy(_.pluck(a.displayedFaxQueues,"id")):a.faxQueues.checked=[]},a.getFaxQueues=function(b){return _.map(a.displayedFaxQueues,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(c){e.unsyncUpdates("fax_queue"),c.url="/api/fax/queues",h.getPage(c).then(function(d){a.displayedFaxQueues=d.rows,c.pagination.numberOfPages=d.total_pages,b.updateTableConfig(d.queuesByPage,a.displayedFaxQueues.length),b.updateTableConfig(a.conf.queuesByPage,a.displayedFaxQueues.length)}),e.socket.on("fax_queue:save",function(){a.initList(c)}),e.socket.on("fax_queue:remove",function(b){a.faxQueues.checked=_.without(a.faxQueues.checked,b.id),a.initList(c)})},a.deleteItem=f.confirm["delete"](function(a){c["delete"]("/api/fax/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(){c["delete"]("/api/fax/queues/",{params:{id:a.faxQueues.checked}}).success(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){g.show(d.instant(a.message),"danger")})}),a.deleteItems=f.confirm["delete"](function(){c["delete"]("/api/fax/queues/",{params:{id:a.faxQueues.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.fax.queues.list",{url:"/list",templateUrl:"app/fax/queue/list/list.html",controller:"FaxQueueListCtrl",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.fax.queues",{url:"/queues",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("FaxQueueViewCtrl",["$scope","$http","$translate","$stateParams","xAlert",function(a,b,c,d,e){var f=function(){return{select:function(c){b.post("/api/fax/queues/"+a.queue.id+"/agents",{agents:c}).success(function(){a.getTeams()}).error(function(a){console.error(a)})},deselect:function(c){b.put("/api/fax/queues/"+a.queue.id+"/agents",{agents:c}).success(function(){a.getTeams()}).error(function(a){console.error(a)})}}};a.getQueue=function(){b.get("/api/fax/queues/"+d.id).success(function(b){a.queue=b}).error(function(){e.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.updateFaxQueue=function(){var f=angular.copy(a.queue);b.put("/api/fax/queues/"+d.id,f).success(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"danger")}).error(function(){e.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger"),a.queue=f})},a.getTeams=function(){b.get("/api/teams").success(function(c){a.teams=c.rows,b({url:"/api/fax/user_has_queues",method:"GET",params:{FaxQueueId:a.queue.id}}).success(function(b){ComponentsDropdowns.bindFaxQueue(a.teams,_.pluck(b,"UserId"),f)})}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.queues.view",{url:"/view/:id",templateUrl:"app/fax/queue/view/view.html",controller:"FaxQueueViewCtrl",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.fax.queues.view.settings",{url:"/settings",templateUrl:"app/fax/queue/view/view.settings.html"}).state("main.fax.queues.view.agents",{url:"/agents",templateUrl:"app/fax/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("FaxQueueWizardCtrl",["$scope","$http","WizardHandler","xAlert","$translate","$location",function(a,b,c,d,e,f){a.forms={},a.item={},a.next=function(){c.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/fax/queues",a.item).success(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success"),f.path("/fax/queues/list")}).error(function(a){d.show(e.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.queues.wizard",{url:"/wizard",templateUrl:"app/fax/queue/wizard/wizard.html",controller:"FaxQueueWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("FaxTimelineListCtrl",["$scope","$http","socket","xAlert","$translate",function(a,b,c,d,e){function f(b){a.events>50&&a.events.pop(),a.events.unshift(b)}a.initList=function(){a.events=[],b.get("/api/events/channel/fax").success(function(a){a.forEach(f),c.socket.on("event:fax:save",f)}).error(function(a){console.error(a),d.show(e.instant("MESSAGE_FAX_ACCOUNT_GET_FAILURE"),"danger")})},a.$on("$destroy",function(){c.socket.removeAllListeners("event:fax:save")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.fax.timeline.list",{url:"/list",templateUrl:"app/fax/timeline/list/list.html",controller:"FaxTimelineListCtrl",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.fax.timeline",{url:"/timeline",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.integrations",{url:"/integrations",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("Integration",["$resource",function(a){return a("/api/integrations/:id/:controller",{id:"@id"})}]),angular.module("xCallyShuttleApp").controller("IntegrationListCtrl",["$scope","Modal","socket","FileUploader","Integration","xAlert",function(a,b,c,d,e,f){a.integrationsByPage=10;var g=a.uploader=new d({url:"api/integrations",autoUpload:!0,removeAfterUpload:!0});g.filters.push({name:"zipFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|zip|".indexOf(b)}}),g.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d),f.show(b.name,"success")},g.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d),b.errors.forEach(function(a){f.show(a.message,"danger")})},a.deleteItem=b.confirm["delete"](function(a){e["delete"]({id:a},function(){f.show("Integration Removed","success")},function(a){f.show(a.data.errors,"danger")})}),a.initList=function(){a.integrations=e.query({},function(a){c.syncUpdates("integration",a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.integrations.list",{url:"/list",templateUrl:"app/integration/list/list.html",controller:"IntegrationListCtrl",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.intervals",{url:"/intervals",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("IntervalListCtrl",["$scope","$http","socket","$translate","$rootScope","xAlert","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={intervalsByPage:{name:"10",value:10},labels:["name"]},a.intervalsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.intervals={checked:[]},a.check=function(b,c){c?a.intervals.checked=angular.copy(_.pluck(a.displayedIntervals,"id")):a.intervals.checked=[]},a.getIntervals=function(b){return _.map(a.displayedIntervals,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){c.unsyncUpdates("interval"),b.url="/api/intervals",h.getPage(b).then(function(c){a.displayedIntervals=c.rows,b.pagination.numberOfPages=c.total_pages,e.updateTableConfig(a.intervalsByPage,a.displayedIntervals.length),e.updateTableConfig(a.conf.intervalsByPage,a.displayedIntervals.length)}),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",function(a,b,c,d,e,f,g){var h=a.uploader=new g({url:"api/mail/messages",withCredentials:!0,headers:{Authorization:"Bearer "+d.get("token")},queueLimit:1});h.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})},h.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d),f.show(e.instant("MESSAGE_MAIL_MESSAGE_SEND_SUCCESS"),"success")},h.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d),f.show(e.instant("MESSAGE_MAIL_MESSAGE_SEND_FAILURE"),"danger")},h.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(h.queue.length)console.log("file"),h.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};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){function m(){a.lastMessage=_.reject(a.mailRoom.MailMessages,function(a){return"RECEIVED"!==a.status}),a.lastMessage=_.sortByOrder(a.lastMessage,["id"],["desc"])[0],a.lastMessage&&(a.form.subject=a.mailRoom.subject,a.form.from=a.mailRoom.MailAccount,a.form.to=[a.lastMessage.From.email],a.form.cc=a.lastMessage.To.concat(a.lastMessage.Cc),a.form.cc=_.pluck(a.form.cc,"email"),a.form.cc=_.remove(a.form.cc,function(b){return a.mailRoom.MailAccount?b!==a.mailRoom.MailAccount.address:void 0}),a.form.cc=a.form.cc,a.form.inReplyTo=a.lastMessage.messageId,a.form.MailRoomId=a.lastMessage.MailRoomId)}var n=a.uploader=new l({url:"api/mail/messages",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+e.get("token")}});n.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||null,html:a.form.html||null,text:a.form.text||null,MailRoomId:a.mailRoom.id};a.mailRoom.roomId&&(c.inReplyTo=a.mailRoom.roomId),b.formData.push(c)},n.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d)},n.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d)},n.onCompleteAll=function(){console.log("onCompleteAll"),f.path("/mail/inbox/incoming")},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"}),m()}).error(function(){f.path("/mail/inbox/incoming")})},a.getMailString=function(a){return a.fullname?a.fullname+" <"+a.email+">":"<"+a.email+">"},a.sendMail=function(){if(n.queue.length)n.uploadAll();else{if(!a.form.to.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 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||null,html:a.form.html||null,text:a.form.text||null,MailRoomId:a.mailRoom.id};a.mailRoom.roomId&&(c.inReplyTo=a.mailRoom.roomId),h.debug(c),b.post("/api/mail/messages",c).success(function(){i.show(g.instant("MESSAGE_MAIL_MESSAGE_SEND_SUCCESS"),"success"),Metronic.scrollTop()}).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")}).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").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").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",function(a,b,c){console.log("MailRealtimeViewAgentCtrl"),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").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:"View1",link:"main.mail.realtime.view.agents"}],a.sessions=[{name:"View1",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.agents",{url:"/agents",controller:"MailRealtimeViewAgentCtrl",templateUrl:"app/mail/realtime/view/agent/agent.html"}).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("MainCtrl",["$scope","$http","$rootScope","$cookies","$translate","$interval","socket","Auth",function(a,b,c,d,e,f,g,h){a.awesomeThings=[],a.isLoggedIn=h.isLoggedIn,a.isAdmin=h.isAdmin,a.getCurrentUser=h.getCurrentUser,
-c.workspaces=[],c.mainTab={active:!0},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}))}}}}]),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())}]}})}]),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"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("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()};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")})};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()};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")})};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","hash",function(a,b,c,d){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(d)}},{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","Update","xAlert",function(a,b,c,d,e){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.checkout=function(a){var f=b.open({animation:!0,templateUrl:"app/update/list/checkout/checkout.html",controller:"UpdateListCheckoutCtrl",resolve:{hash:function(){return a}}});f.result.then(function(a){d.get({id:a},function(){e.show("ok","success")},function(a){e.show(a,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.initList=function(){d.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"})}]),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").controller("VoicemailCtrl",["$scope",function(a){a.message="Hello"}]),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").controller("FooterController",["$scope",function(a){a.$on("$includeContentLoaded",function(){Layout.initFooter()})}]),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){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","Auth","Agent","User","ChatRoom","ChatMessage","socket","settings","localStorageService","xAlert","$translate",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){a.emojiMessage={},a.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"}};var r=a.currentUser=h.getCurrentUser();a.message={body:"",user:""},a.$on("$includeContentLoaded",function(){o.get("chatRoomId")&&k.get({id:o.get("chatRoomId")},t,u),o.get("currentTab")&&(a.currentTab=o.get("currentTab"))});var s=angular.element(c);a.getWindowDimensions=function(){return{h:s.height(),w:s.width()}},a.$watch(a.getWindowDimensions,function(b){a.style={height:b.h-46-46-46+"px"},a.style2={height:b.h-46-46-46-180+"px"}},!0),s.bind("resize",function(){a.$apply()}),a.agents=i.get({page:0,per_page:1e3},function(){m.syncUpdates("agent",a.agents.rows)}),a.users=j.get({page:0,per_page:1e3},function(){m.syncUpdates("user",a.users.rows)}),a.chatRooms=k.me(function(b){a.chatRooms=b,m.syncUpdates("chat_room",a.chatRooms)},function(a){console.error(a)}),a.currentTab=0,a.messagesTab=!1,b.$on("chatMessageEvent",function(b,c){switch(c.type){case"internal":a.currentTab=0;break;case"external":a.currentTab=2}k.get({id:c.chatRoomId},t,u)}),a.goToTab=function(b){a.currentTab=b,a.messagesTab=!1,a.chatRoom=null,o.set("currentTab",a.currentTab),o.set("messagesTab",a.messagesTab),o.remove("chatRoomId"),m.unsyncUpdates("chat_message"),m.unsyncUpdates("chat_room")},a.goToMessage=function(a,b){a?k.users({users:[r.id,a]},t,u):k.get({id:b},t,u)},a.sendMessage=function(){a.message.body.trim().length&&l.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,o.set("messagesTab",a.messagesTab),o.remove("chatRoomId"),m.unsyncUpdates("chat_message"),m.unsyncUpdates("user_has_chat_room")},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(){d.put("/api/chat/rooms/"+a,{status:"close"}).then(function(){p.show(q.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){p.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){m.unsyncUpdates("chat_message"),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),m.socket.on("chat_message:save",function(c){c.ChatRoomId===b.data.id&&(a.chatRoom.ChatMessages.push(c),angular.element("page-quick-sidebar-chat-user-messages").mCustomScrollbar("scrollTo","last"))}),p.show(q.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){p.show(a.data.message,"danger")})},function(){f.info("Modal dismissed at: "+new Date)})};var t=function(b){a.messagesTab=!0,n.layout.pageQuickSidebarOpened=!0,o.set("chatRoomId",b.id),o.set("messagesTab",a.messagesTab),a.chatRoom=b;var c=_.find(a.chatRooms,{id:b.id}),d=a.chatRooms.indexOf(c);c?_.merge(a.chatRooms[d],b):a.chatRooms.push(b),g(function(){angular.element("page-quick-sidebar-chat-user-messages").mCustomScrollbar("scrollTo","last")},1e3),m.socket.on("chat_message:save",function(c){c.ChatRoomId===b.id&&(a.chatRoom.ChatMessages.push(c),angular.element("page-quick-sidebar-chat-user-messages").mCustomScrollbar("scrollTo","last"))}),m.socket.on("chat_room:save",function(b){b.id===a.chatRoom.id&&(a.chatRoom.status=b.status)})},u=function(a){console.error(a)};a.$on("$destroy",function(){m.unsyncUpdates("agent"),m.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").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(e){console.log(a),console.log(e);var f=!0;if(_.forIn(b,function(a,b){return e[b]&&e[b]===a?!0:f=!1}),f){var g=_.find(c,{id:e.id}),h=c.indexOf(g),i="created";g?(_.merge(c[h],e),i="updated"):c.unshift(e),d(i,e,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:[],actions:[]},mail:{conditions:[{name:"APPLICATION_FROM",value:"from",propertyField:"input",operators:"equals"},{name:"APPLICATION_CC",value:"cc",propertyField:"input",operators:"equals"},{name:"APPLICATION_SUBJECT",value:"subject",propertyField:"input",operators:"equals"}],actions:[{name:"APPLICATION_TEMPLATE",value:"template",propertyField:"select"}]},chat:{conditions:[],actions:[]},fax:{conditions:[],actions:[]}},b={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"}]},c={voice:{},mail:{},chat:{},fax:{}},d=["voice","mail","chat","fax"];return{triggers:a,properties:c,operators:b,channels:d}}),function(a,b){angular.module("adf.widget.counter",["adf.provider"]).value("apiServiceUrlCounter","/api/widgets/counter").config(["dashboardProvider",function(a){a.widget("counter",{title:"Counter",description:"Counter for db results",templateUrl:"{widgetsPath}/counter/src/view.html",controller:"apiwidgetCounterViewCtrl",edit:{templateUrl:"{widgetsPath}/counter/src/edit.html",controller:"apiwidgetCounterEditCtrl"}})}]).service("apiServiceCounter",["$q","$http","apiServiceUrlCounter",function(a,b,c){return{get:function(d){var e=a.defer();return b.get(c,{params:{condition:encodeURIComponent(d.condition),table:d.report}}).success(function(a){a?e.resolve(a):e.reject()}).error(function(a){console.log(a),e.reject()}),e.promise}}}]).controller("apiwidgetCounterEditCtrl",["$scope",function(a){a.config.reportTables=[{name:"Agents",value:"agent"},{name:"Calls",value:"call"},{name:"Dials",value:"dial"},{name:"Members",value:"member"},{name:"Queues",value:"queue"}],a.config.colors=[{name:"Blue",value:"blue-madison"},{name:"Red",value:"red-intense"},{name:"Green",value:"green-haze"},{name:"Purple",value:"purple-plum"},{name:"Orange",value:"yellow-casablanca"},{name:"Yellow",value:"yellow-crusta"}],a.config.icons=[{name:"Talk bubbles",value:"fa-comments"},{name:"Bar Chart",value:"fa-bar-chart"},{name:"Shopping Cart",value:"fa-shopping-cart"},{name:"Globe",value:"fa-globe"}],a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.color=a.config.color?a.config.color:"blue-madison",a.config.icon=a.config.icon?a.config.icon:"fa-comments",a.config.link=a.config.link?a.config.link:"#",a.config.linkText=a.config.linkText?a.config.linkText:"VIEW MORE"}]).controller("apiwidgetCounterViewCtrl",["$scope","$interval","apiServiceCounter",function(a,b,c){a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.color=a.config.color?a.config.color:"blue-madison",a.config.icon=a.config.icon?a.config.icon:"fa-comments",a.config.link=a.config.link?a.config.link:"#",a.config.linkText=a.config.linkText?a.config.linkText:"VIEW MORE",a.counterApiCall=function(){a.config.condition&&a.config.report&&c.get(a.config).then(function(b){a.count=parseInt(b[0].count)})},a.counterApiCall();var d=b(function(){a.counterApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.counter").run(["$templateCache",function(a){a.put("{widgetsPath}/counter/src/edit.html","<form role=form><div class=form-group><label class=control-label>{{'APPLICATION_REPORT' | translate}}</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_REPORT' | translate }}\">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat=\"report.value as report in config.reportTables | filter: $select.search\"><div ng-bind-html=\"report.name | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label for=condition>{{'APPLICATION_CONDITION' | translate}}</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder=\"{{'APPLICATION_CONDITION' | translate}}\"></div><div class=form-group><label for=condition>{{'APPLICATION_REFRESH_TIMEOUT' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder=\"{{'APPLICATION_REFRESH_TIMEOUT' | translate}}\" min=1></div><div class=form-group><label class=control-label>{{'APPLICATION_WIDGET_COLOR' | translate}}</label><ui-select data-ng-model=config.color name=color theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_WIDGET_COLOR' | translate }}\">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat=\"color.value as color in config.colors | filter: $select.search\"><div ng-bind-html=\"color.name | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label class=control-label>{{'APPLICATION_WIDGET_ICON' | translate}}</label><ui-select data-ng-model=config.icon name=icon theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_WIDGET_ICON' | translate }}\">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat=\"icon.value as icon in config.icons | filter: $select.search\"><div ng-bind-html=\"icon.name | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_DETAILS' | translate}}</label> <input type=text class=form-control id=details ng-model=config.details maxlength=30 placeholder=\"{{'APPLICATION_WIDGET_DETAILS' | translate}}\"></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_LINK' | translate}}</label> <input type=text class=form-control id=link ng-model=config.link placeholder=http://yourlink></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_LINK_TEXT' | translate}}</label> <input type=text class=form-control id=linkText ng-model=config.linkText maxlength=30 placeholder=\"{{'APPLICATION_WIDGET_LINK_TEXT' | translate}}\"></div></form>"),
+c.workspaces=[],c.mainTab={active:!0},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}))}}}}]),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())}]}})}]),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("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()};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")})};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()};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")})};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){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").controller("VoicemailCtrl",["$scope",function(a){a.message="Hello"}]),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").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){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","Auth","Agent","User","ChatRoom","ChatMessage","socket","settings","localStorageService","xAlert","$translate",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){a.emojiMessage={},a.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"}};var r=a.currentUser=h.getCurrentUser();a.message={body:"",user:""},a.$on("$includeContentLoaded",function(){o.get("chatRoomId")&&k.get({id:o.get("chatRoomId")},t,u),o.get("currentTab")&&(a.currentTab=o.get("currentTab"))});var s=angular.element(c);a.getWindowDimensions=function(){return{h:s.height(),w:s.width()}},a.$watch(a.getWindowDimensions,function(b){a.style={height:b.h-46-46-46+"px"},a.style2={height:b.h-46-46-46-180+"px"}},!0),s.bind("resize",function(){a.$apply()}),a.agents=i.get({page:0,per_page:1e3},function(){m.syncUpdates("agent",a.agents.rows)}),a.users=j.get({page:0,per_page:1e3},function(){m.syncUpdates("user",a.users.rows)}),a.chatRooms=k.me(function(b){a.chatRooms=b,m.syncUpdates("chat_room",a.chatRooms)},function(a){console.error(a)}),a.currentTab=0,a.messagesTab=!1,b.$on("chatMessageEvent",function(b,c){switch(c.type){case"internal":a.currentTab=0;break;case"external":a.currentTab=2}k.get({id:c.chatRoomId},t,u)}),a.goToTab=function(b){a.currentTab=b,a.messagesTab=!1,a.chatRoom=null,o.set("currentTab",a.currentTab),o.set("messagesTab",a.messagesTab),o.remove("chatRoomId"),m.unsyncUpdates("chat_message"),m.unsyncUpdates("chat_room")},a.goToMessage=function(a,b){a?k.users({users:[r.id,a]},t,u):k.get({id:b},t,u)},a.sendMessage=function(){a.message.body.trim().length&&l.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,o.set("messagesTab",a.messagesTab),o.remove("chatRoomId"),m.unsyncUpdates("chat_message"),m.unsyncUpdates("user_has_chat_room")},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(){d.put("/api/chat/rooms/"+a,{status:"close"}).then(function(){p.show(q.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){p.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){m.unsyncUpdates("chat_message"),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),m.socket.on("chat_message:save",function(c){c.ChatRoomId===b.data.id&&(a.chatRoom.ChatMessages.push(c),angular.element("page-quick-sidebar-chat-user-messages").mCustomScrollbar("scrollTo","last"))}),p.show(q.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){p.show(a.data.message,"danger")})},function(){f.info("Modal dismissed at: "+new Date)})};var t=function(b){a.messagesTab=!0,n.layout.pageQuickSidebarOpened=!0,o.set("chatRoomId",b.id),o.set("messagesTab",a.messagesTab),a.chatRoom=b;var c=_.find(a.chatRooms,{id:b.id}),d=a.chatRooms.indexOf(c);c?_.merge(a.chatRooms[d],b):a.chatRooms.push(b),g(function(){angular.element("page-quick-sidebar-chat-user-messages").mCustomScrollbar("scrollTo","last")},1e3),m.socket.on("chat_message:save",function(c){c.ChatRoomId===b.id&&(a.chatRoom.ChatMessages.push(c),angular.element("page-quick-sidebar-chat-user-messages").mCustomScrollbar("scrollTo","last"))}),m.socket.on("chat_room:save",function(b){b.id===a.chatRoom.id&&(a.chatRoom.status=b.status)})},u=function(a){console.error(a)};a.$on("$destroy",function(){m.unsyncUpdates("agent"),m.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").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(e){console.log(a),console.log(e);var f=!0;if(_.forIn(b,function(a,b){return e[b]&&e[b]===a?!0:f=!1}),f){var g=_.find(c,{id:e.id}),h=c.indexOf(g),i="created";g?(_.merge(c[h],e),i="updated"):c.unshift(e),d(i,e,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:[],actions:[]},mail:{conditions:[{name:"APPLICATION_FROM",value:"from",propertyField:"input",operators:"equals"},{name:"APPLICATION_CC",value:"cc",propertyField:"input",operators:"equals"},{name:"APPLICATION_SUBJECT",value:"subject",propertyField:"input",operators:"equals"}],actions:[{name:"APPLICATION_TEMPLATE",value:"template",propertyField:"select"}]},chat:{conditions:[],actions:[]},fax:{conditions:[],actions:[]}},b={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"}]},c={voice:{},mail:{},chat:{},fax:{}},d=["voice","mail","chat","fax"];return{triggers:a,properties:c,operators:b,channels:d}}),function(a,b){angular.module("adf.widget.counter",["adf.provider"]).value("apiServiceUrlCounter","/api/widgets/counter").config(["dashboardProvider",function(a){a.widget("counter",{title:"Counter",description:"Counter for db results",templateUrl:"{widgetsPath}/counter/src/view.html",controller:"apiwidgetCounterViewCtrl",edit:{templateUrl:"{widgetsPath}/counter/src/edit.html",controller:"apiwidgetCounterEditCtrl"}})}]).service("apiServiceCounter",["$q","$http","apiServiceUrlCounter",function(a,b,c){return{get:function(d){var e=a.defer();return b.get(c,{params:{condition:encodeURIComponent(d.condition),table:d.report}}).success(function(a){a?e.resolve(a):e.reject()}).error(function(a){console.log(a),e.reject()}),e.promise}}}]).controller("apiwidgetCounterEditCtrl",["$scope",function(a){a.config.reportTables=[{name:"Agents",value:"agent"},{name:"Calls",value:"call"},{name:"Dials",value:"dial"},{name:"Members",value:"member"},{name:"Queues",value:"queue"}],a.config.colors=[{name:"Blue",value:"blue-madison"},{name:"Red",value:"red-intense"},{name:"Green",value:"green-haze"},{name:"Purple",value:"purple-plum"},{name:"Orange",value:"yellow-casablanca"},{name:"Yellow",value:"yellow-crusta"}],a.config.icons=[{name:"Talk bubbles",value:"fa-comments"},{name:"Bar Chart",value:"fa-bar-chart"},{name:"Shopping Cart",value:"fa-shopping-cart"},{name:"Globe",value:"fa-globe"}],a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.color=a.config.color?a.config.color:"blue-madison",a.config.icon=a.config.icon?a.config.icon:"fa-comments",a.config.link=a.config.link?a.config.link:"#",a.config.linkText=a.config.linkText?a.config.linkText:"VIEW MORE"}]).controller("apiwidgetCounterViewCtrl",["$scope","$interval","apiServiceCounter",function(a,b,c){a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.color=a.config.color?a.config.color:"blue-madison",a.config.icon=a.config.icon?a.config.icon:"fa-comments",a.config.link=a.config.link?a.config.link:"#",a.config.linkText=a.config.linkText?a.config.linkText:"VIEW MORE",a.counterApiCall=function(){a.config.condition&&a.config.report&&c.get(a.config).then(function(b){a.count=parseInt(b[0].count)})},a.counterApiCall();var d=b(function(){a.counterApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.counter").run(["$templateCache",function(a){a.put("{widgetsPath}/counter/src/edit.html","<form role=form><div class=form-group><label class=control-label>{{'APPLICATION_REPORT' | translate}}</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_REPORT' | translate }}\">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat=\"report.value as report in config.reportTables | filter: $select.search\"><div ng-bind-html=\"report.name | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label for=condition>{{'APPLICATION_CONDITION' | translate}}</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder=\"{{'APPLICATION_CONDITION' | translate}}\"></div><div class=form-group><label for=condition>{{'APPLICATION_REFRESH_TIMEOUT' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder=\"{{'APPLICATION_REFRESH_TIMEOUT' | translate}}\" min=1></div><div class=form-group><label class=control-label>{{'APPLICATION_WIDGET_COLOR' | translate}}</label><ui-select data-ng-model=config.color name=color theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_WIDGET_COLOR' | translate }}\">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat=\"color.value as color in config.colors | filter: $select.search\"><div ng-bind-html=\"color.name | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label class=control-label>{{'APPLICATION_WIDGET_ICON' | translate}}</label><ui-select data-ng-model=config.icon name=icon theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_WIDGET_ICON' | translate }}\">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat=\"icon.value as icon in config.icons | filter: $select.search\"><div ng-bind-html=\"icon.name | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_DETAILS' | translate}}</label> <input type=text class=form-control id=details ng-model=config.details maxlength=30 placeholder=\"{{'APPLICATION_WIDGET_DETAILS' | translate}}\"></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_LINK' | translate}}</label> <input type=text class=form-control id=link ng-model=config.link placeholder=http://yourlink></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_LINK_TEXT' | translate}}</label> <input type=text class=form-control id=linkText ng-model=config.linkText maxlength=30 placeholder=\"{{'APPLICATION_WIDGET_LINK_TEXT' | translate}}\"></div></form>"),
 a.put("{widgetsPath}/counter/src/view.html",'<div class=dashboard-stat ng-class=config.color ng-if="count || count === 0"><div class=visual><i class=fa ng-class=config.icon></i></div><div class=details><div class=number>{{count}}</div><div class=desc>{{config.details}}</div></div><a class=more href={{config.link}}>{{config.linkText}} <i class="m-icon-swapright m-icon-white"></i></a></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if="!count && count != 0"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_VALID_CONDITION\' | translate}}</div>')}])}(window),function(a,b){angular.module("adf.widget.pie-chart",["adf.provider"]).value("apiServiceUrlPieChart","/api/widgets/piechart").config(["dashboardProvider",function(a){a.widget("pie-chart",{title:"Pie-Chart",description:"Display a pie-chart starting from DB values",templateUrl:"{widgetsPath}/pie-chart/src/view.html",controller:"apiWidgetPieChartViewCtrl",edit:{templateUrl:"{widgetsPath}/pie-chart/src/edit.html",controller:"apiWidgetPieChartEditCtrl"}})}]).service("apiServicePieChart",["$q","$http","apiServiceUrlPieChart",function(a,b,c){return{get:function(d){var e=a.defer();return b.get(c,{params:{condition:encodeURIComponent(d.condition),table:d.report,fields:d.fields}}).success(function(a){a?e.resolve(a):e.reject()}).error(function(a){console.log(a),e.reject()}),e.promise}}}]).controller("apiWidgetPieChartEditCtrl",["$scope",function(a){function b(){return a.config.fields||(a.config.fields=[{column:"",alias:""}]),a.config.fields}a.config.reportTables=[{name:"Agents",value:"agent"},{name:"Calls",value:"call"},{name:"Dials",value:"dial"},{name:"Members",value:"member"},{name:"Queues",value:"queue"}],a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.fields=a.config.fields?a.config.fields:[{column:"",alias:""}],a.addField=function(){b().push({})},a.removeField=function(a){b().splice(a,1)}}]).controller("apiWidgetPieChartViewCtrl",["$scope","$interval","apiServicePieChart",function(a,b,c){a.config.timeout=a.config.timeout?a.config.timeout:1,a.pieChartApiCall=function(){a.config.report&&a.config.fields.length&&""!==a.config.fields[0].column&&""!==a.config.fields[0].alias&&c.get(a.config).then(function(b){if(b&&1===b.length){a.labels=[],a.data=[];for(var c in b[0])a.labels.push(c),a.data.push(b[0][c])}else a.labels=[],a.data=[]})},a.pieChartApiCall();var d=b(function(){a.pieChartApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.pie-chart").run(["$templateCache",function(a){a.put("{widgetsPath}/pie-chart/src/edit.html",'<form role=form><div class=form-group><label class=control-label>{{\'APPLICATION_REPORT\' | translate}}</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder="{{ \'APPLICATION_REPORT\' | translate }}">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat="report.value as report in config.reportTables | filter: $select.search"><div ng-bind-html="report.name | highlight: $select.search"></div></ui-select-choices></ui-select></div><div><label class=control-label>{{\'APPLICATION_FIELDS\' | translate}}</label></div><div class=padding-bottom ng-repeat="field in config.fields"><div class=form-group><div class=input-group><input type=text class=form-control ng-model=field.column> <span class=input-group-addon>as</span> <input type=text class=form-control ng-model=field.alias> <span class=input-group-btn ng-if="config.fields.length>1"><button class="btn btn-danger" type=button data-ng-click=removeField($index)><i class="fa fa-times"></i> {{\'APPLICATION_REMOVE\' | translate}}</button></span></div></div></div><button type=button class="btn btn-sm green mbottom20" ng-click=addField()><i class="fa fa-plus"></i> {{\'APPLICATION_ADD_FIELD\' | translate}}</button><div class=form-group><label for=condition>{{\'APPLICATION_CONDITION\' | translate}}</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder="{{\'APPLICATION_CONDITION\' | translate}}"></div><div class=form-group><label for=condition>{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder="{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}" min=1></div></form>'),a.put("{widgetsPath}/pie-chart/src/view.html",'<div ng-if=labels.length ng-style=config.style><canvas id=doughnut class="chart chart-doughnut" chart-data=data chart-labels=labels legend=true></canvas></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!labels.length><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_VALID_CONDITION\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!labels.length><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_ONE_VALID_METRIC_AND_CHECK_OTHER\' | translate}}</div>')}])}(window),function(a,b){angular.module("adf.widget.table",["adf.provider"]).value("apiServiceUrlTable","/api/widgets/table").config(["dashboardProvider",function(a){a.widget("table",{title:"Table",description:"Show tabbed results from db",templateUrl:"{widgetsPath}/table/src/view.html",controller:"apiWidgetTableViewCtrl",edit:{templateUrl:"{widgetsPath}/table/src/edit.html",controller:"apiWidgetTableEditCtrl"}})}]).service("apiServiceTable",["$q","$http","apiServiceUrlTable",function(a,b,c){return{get:function(d){var e=a.defer();return b.get(c,{params:{condition:encodeURIComponent(d.condition),table:d.report,fields:d.fields}}).success(function(a){a?e.resolve(a):e.reject()}).error(function(a){console.log(a),e.reject()}),e.promise}}}]).controller("apiWidgetTableEditCtrl",["$scope",function(a){function b(){return a.config.fields||(a.config.fields=[{column:"",alias:""}]),a.config.fields}a.config.reportTables=[{name:"Agents",value:"agent"},{name:"Calls",value:"call"},{name:"Dials",value:"dial"},{name:"Members",value:"member"},{name:"Queues",value:"queue"}],a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.height=a.config.height?a.config.height:350,a.config.fields=a.config.fields?a.config.fields:[{column:"",alias:""}],a.addField=function(){b().push({})},a.removeField=function(a){b().splice(a,1)}}]).controller("apiWidgetTableViewCtrl",["$scope","$interval","apiServiceTable",function(a,b,c){a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.height=a.config.height?a.config.height:350,a.config.style={"max-height":a.config.height+"px",overflow:"scroll"},a.tableApiCall=function(){a.config.condition&&a.config.report&&a.config.fields.length&&""!==a.config.fields[0].column&&""!==a.config.fields[0].alias&&c.get(a.config).then(function(b){a.results=b})},a.tableApiCall();var d=b(function(){a.tableApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.table").run(["$templateCache",function(a){a.put("{widgetsPath}/table/src/edit.html",'<form role=form><div class=form-group><label class=control-label>{{\'APPLICATION_REPORT\' | translate}}</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder="{{ \'APPLICATION_REPORT\' | translate }}">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat="report.value as report in config.reportTables | filter: $select.search"><div ng-bind-html="report.name | highlight: $select.search"></div></ui-select-choices></ui-select></div><div><label class=control-label>{{\'APPLICATION_METRICS\' | translate}}</label></div><div class=padding-bottom ng-repeat="field in config.fields"><div class=form-group><div class=input-group><input type=text class=form-control ng-model=field.column> <span class=input-group-addon>as</span> <input type=text class=form-control ng-model=field.alias> <span class=input-group-btn ng-if="config.fields.length>1"><button class="btn btn-danger" type=button data-ng-click=removeField($index)><i class="fa fa-times"></i> {{\'APPLICATION_REMOVE\' | translate}}</button></span></div></div></div><button type=button class="btn btn-sm green mbottom20" ng-click=addField()><i class="fa fa-plus"></i> {{\'APPLICATION_ADD_FIELD\' | translate}}</button><div class=form-group><label for=condition>{{\'APPLICATION_CONDITION\' | translate}}</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder="{{\'APPLICATION_CONDITION\' | translate}}"></div><div class=form-group><label for=condition>{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder="{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}" min=1></div><div class=form-group><label for=condition>{{\'APPLICATION_WIDGET_MAX_HEIGHT\' | translate}}</label> <input type=number class=form-control id=height ng-model=config.height placeholder="{{\'APPLICATION_WIDGET_MAX_HEIGHT\' | translate}}" min=350></div></form>'),a.put("{widgetsPath}/table/src/view.html",'<div ng-if=results ng-style=config.style><table st-table=results class="table table-striped table-bordered table-hover"><div class=table-responsive><thead><tr><th colspan={{config.fields.length}}><div class=row><div class=col-md-6></div><div class=col-md-6><div class="input-group input-medium pull-right"><input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class=form-control type=search> <span class=input-group-addon><i class="fa fa-search"></i></span></div></div></div></th></tr><tr><th ng-repeat="field in config.fields">{{field.alias}}</th></tr></thead><tbody><tr data-ng-repeat="result in results" class=animate-repeat><td ng-repeat="field in config.fields">{{result[field.alias]}}</td></tr><tr data-ng-hide=results.length><td colspan={{config.fields.length}} style=text-align:center;><i>{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</i></td></tr></tbody><tfoot><tr><td colspan={{config.fields.length}} class=text-center><div st-pagination class=pagination st-items-by-page=10 st-displayed-pages=3></div></td></tr></tfoot></div></table></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!results><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_VALID_CONDITION\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!results><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_ONE_VALID_FIELD_AND_CHECK_OTHER\' | translate}}</div>')}])}(window),function(){angular.module("pdf",[]).directive("ngPdf",["$window",function(a){return{restrict:"E",templateUrl:function(a,b){return b.templateUrl?b.templateUrl:"partials/viewer.html"},link:function(b,c,d){var e=d.pdfUrl,f=null,g=d.page?d.page:1,h=d.scale>0?d.scale:1,i=c.find("canvas"),j=i[0],k=j.getContext("2d"),l=angular.element(a);l.on("scroll",function(){b.$apply(function(){b.scroll=l[0].scrollY})}),PDFJS.disableWorker=!0,b.pageNum=g,b.renderPage=function(a){f.getPage(a).then(function(a){var e,f,g,i={};"page-fit"!==d.scale||h?e=a.getViewport(h):(e=a.getViewport(1),f=c[0].clientWidth/e.width,g=c[0].clientHeight/e.height,h=Math.min(f,g)),j.height=e.height,j.width=e.width,i={canvasContext:k,viewport:e},a.render(i).promise.then(function(){"function"==typeof b.onPageRender&&b.onPageRender()})})},b.goPrevious=function(){b.pageToDisplay<=1||(b.pageNum=parseInt(b.pageNum)-1)},b.goNext=function(){b.pageToDisplay>=f.numPages||(b.pageNum=parseInt(b.pageNum)+1)},b.zoomIn=function(){return h=parseFloat(h)+.2,b.renderPage(b.pageToDisplay),h},b.zoomOut=function(){return h=parseFloat(h)-.2,b.renderPage(b.pageToDisplay),h},b.changePage=function(){b.renderPage(b.pageToDisplay)},b.rotate=function(){"rotate0"===j.getAttribute("class")?j.setAttribute("class","rotate90"):"rotate90"===j.getAttribute("class")?j.setAttribute("class","rotate180"):"rotate180"===j.getAttribute("class")?j.setAttribute("class","rotate270"):j.setAttribute("class","rotate0")},PDFJS.getDocument(e,null,null,b.onProgress).then(function(a){"function"==typeof b.onLoad&&b.onLoad(),f=a,b.renderPage(b.pageToDisplay),b.$apply(function(){b.pageCount=a.numPages})},function(a){a&&"function"==typeof b.onError&&b.onError(a)}),b.$watch("pageNum",function(a){b.pageToDisplay=parseInt(a),null!==f&&b.renderPage(b.pageToDisplay)})}}}])}(),function(a){a.module("angular-elastic-builder",["RecursionHelper"])}(window.angular),function(a){a.module("angular-elastic-builder").directive("elasticBuilder",["elasticQueryService",function(a){return{scope:{data:"=elasticBuilder"},templateUrl:"angular-elastic-builder/BuilderDirective.html",link:function(b){var c=b.data;b.filters=[],b.removeChild=function(a){b.filters.splice(a,1)},b.addRule=function(){b.filters.push({})},b.addGroup=function(){b.filters.push({type:"group",subType:"and",rules:[]})},b.$watch("data.needsUpdate",function(d){d&&(b.filters=a.toFilters(c.query,b.data.fields),b.data.needsUpdate=!1)}),b.$watch("filters",function(d){d&&(c.query=a.toQuery(b.filters,b.data.fields))},!0)}}}])}(window.angular),function(a){var b=a.module("angular-elastic-builder");b.directive("elasticBuilderChooser",["RecursionHelper","groupClassHelper",function(a,b){return{scope:{elasticFields:"=",item:"=elasticBuilderChooser",onRemove:"&"},templateUrl:"angular-elastic-builder/ChooserDirective.html",compile:function(c){return a.compile(c,function(a,c,d){var e=a.depth=+d.depth,f=a.item;a.getGroupClassName=function(){var a=e;return"group"===f.type&&a++,b(a)}})}}}])}(window.angular),function(a){var b=a.module("angular-elastic-builder");b.directive("elasticBuilderGroup",["RecursionHelper","groupClassHelper",function(a,b){return{scope:{elasticFields:"=",group:"=elasticBuilderGroup",onRemove:"&"},templateUrl:"angular-elastic-builder/GroupDirective.html",compile:function(c){return a.compile(c,function(a,c,d){var e=a.depth=+d.depth,f=a.group;a.addRule=function(){f.rules.push({})},a.addGroup=function(){f.rules.push({type:"group",subType:"and",rules:[]})},a.removeChild=function(a){f.rules.splice(a,1)},a.getGroupClassName=function(){return b(e+1)}})}}}])}(window.angular),function(a){var b=a.module("angular-elastic-builder");b.directive("elasticBuilderRule",[function(){return{scope:{elasticFields:"=",rule:"=elasticBuilderRule",onRemove:"&"},templateUrl:"angular-elastic-builder/RuleDirective.html",link:function(a){a.getType=function(){var b=a.elasticFields,c=a.rule.field;return b&&c?"boolean"===b[c].subType?"boolean":b[c].type:void 0}}}}])}(window.angular),function(a){var b=a.module("angular-elastic-builder");b.directive("elasticType",[function(){return{scope:{type:"=elasticType",rule:"=",guide:"="},template:'<ng-include src="getTemplateUrl()" />',link:function(a){a.getTemplateUrl=function(){var b=a.type;if(b)return b=b.charAt(0).toUpperCase()+b.slice(1),"angular-elastic-builder/types/"+b+".html"},a.booleans=["False","True"],a.booleansOrder=["True","False"],a.inputNeeded=function(){var b=["equals","notEquals","gt","gte","lt","lte"];return~b.indexOf(a.rule.subType)}}}}])}(window.angular),function(a){a.module("angular-elastic-builder").factory("groupClassHelper",function(){return function(a){var b=[""];return b[a%b.length]}})}(window.angular),function(a){function b(a,b){var c=a.map(d.bind(a,b));return c}function c(a,b){var c=a.map(e.bind(a,b)).filter(function(a){return!!a});return c}function d(a,b,c){c!==!1&&(c=!0);var e=Object.keys(b)[0],g={or:"group",and:"group",range:"number"},h=g[e]||"item",i=f(h);switch(e){case"or":case"and":i.rules=b[e].map(d.bind(b,a)),i.subType=e;break;case"missing":case"exists":i.field=b[e].field,i.subType={exists:"exists",missing:"notExists"}[e],delete i.value;break;case"term":case"terms":i.field=Object.keys(b[e])[0];var j=a[Object.keys(b[e])[0]];if("multi"===j.type){var k=b[e][i.field];"string"==typeof k&&(k=[k]),i.value=b[e][i.field]}else i.subType=c?"equals":"notEquals",i.value=b[e][i.field],"number"==typeof i.value&&(i.subType="boolean");break;case"range":i.field=Object.keys(b[e])[0],i.subType=Object.keys(b[e][i.field])[0],i.value=b[e][i.field][i.subType];break;case"not":i=d(a,b[e].filter,!1);break;default:i.field=Object.keys(b[e])[0]}return i}function e(a,b){var c={};if("group"===b.type)return c[b.subType]=b.rules.map(e.bind(b,a)).filter(function(a){return!!a}),c;var d=b.field,f=a[d];if(d){switch(f.type){case"term":case"multiterm":if("boolean"===f.subType&&(b.subType="boolean"),!b.subType)return;switch(b.subType){case"equals":case"boolean":if(void 0===b.value)return;c.term={},c.term[d]=b.value;break;case"notEquals":if(void 0===b.value)return;c.not={filter:{term:{}}},c.not.filter.term[d]=b.value;break;case"exists":c.exists={field:d};break;case"notExists":c.missing={field:d};break;default:throw new Error("unexpected subtype "+b.subType)}break;case"number":c.range={},c.range[d]={},c.range[d][b.subType]=b.value;break;case"date":if("exists"===b.subType)c.exists={field:d};else{if("notExists"!==b.subType)throw new Error("unexpected subtype");c.missing={field:d}}break;case"multi":c.terms={},c.terms[d]=b.value;break;default:throw new Error("unexpected type")}return c}}function f(b){var c={group:{type:"group",subType:"",rules:[]},item:{field:"",subType:"",value:""},number:{field:"",subType:"",value:null}};return a.copy(c[b])}a.module("angular-elastic-builder").factory("elasticQueryService",[function(){return{toFilters:b,toQuery:c}}])}(window.angular),function(a){a.module("angular-elastic-builder").run(["$templateCache",function(a){a.put("angular-elastic-builder/BuilderDirective.html",'<!-- <div class="elastic-builder">\n  <div class="filter-panels">\n    <div class="list-group form-inline">\n      <div\n        data-ng-repeat="filter in filters"\n        data-elastic-builder-chooser="filter"\n        data-elastic-fields="data.fields"\n        data-on-remove="removeChild($index)"\n        data-depth="0"></div>\n      <div class="list-group-item actions">\n        <a class="btn btn-xs btn-primary" title="Add Rule" data-ng-click="addRule()">\n          <i class="fa fa-plus"></i>\n        </a>\n        <a class="btn btn-xs btn-primary" title="Add Group" data-ng-click="addGroup()">\n          <i class="fa fa-list"></i>\n        </a>\n      </div>\n    </div>\n  </div>\n</div> -->\n\n<!-- <div class="elastic-builder">\n  <div class="filter-panels"> -->\n    <div class="list-group form-inline list-group-item-custom" ng-switch="data.type">\n      <div\n        data-ng-repeat="filter in filters"\n        data-elastic-builder-chooser="filter"\n        data-elastic-fields="data.fields"\n        data-on-remove="removeChild($index)"\n        data-depth="0">\n      </div>\n      <div class="list-group-item actions list-group-item-custom" ng-switch-when="condition">\n        <a href="#" class="btn green btn-sm" data-ng-click="addGroup()">\n				  <i class="icon-plus"></i> {{ \'APPLICATION_ADD_GROUP\' | translate }}\n				</a>\n      </div>\n      <div class="list-group-item actions list-group-item-custom" ng-switch-when="action">\n        <a href="#" class="btn green btn-sm" data-ng-click="addRule()">\n				  <i class="icon-plus"></i> {{ \'APPLICATION_ADD_ACTION\' | translate }}\n				</a>\n      </div>\n      <div class="list-group-item actions list-group-item-custom" ng-switch-default>\n        <a href="#" class="btn green btn-sm" data-ng-click="addRule()">\n				  <i class="icon-plus"></i> {{ \'APPLICATION_ADD_CONDITION\' | translate }}\n				</a>\n        <a href="#" class="btn green btn-sm" data-ng-click="addGroup()">\n				  <i class="icon-plus"></i> {{ \'APPLICATION_ADD_GROUP\' | translate }}\n				</a>\n      </div>\n    </div>\n  <!-- </div>\n</div> -->\n'),a.put("angular-elastic-builder/ChooserDirective.html",'<!-- <div\n  class="list-group-item elastic-builder-chooser"\n  data-ng-class="getGroupClassName()">\n\n  <div data-ng-if="item.type === \'group\'"\n    data-elastic-builder-group="item"\n    data-depth="{{ depth }}"\n    data-elastic-fields="elasticFields"\n    data-on-remove="onRemove()"></div>\n\n  <div data-ng-if="item.type !== \'group\'"\n    data-elastic-builder-rule="item"\n    data-elastic-fields="elasticFields"\n    data-on-remove="onRemove()"></div>\n\n</div> -->\n\n\n<div class="list-group-item elastic-builder-chooser list-group-item-custom" data-ng-class="getGroupClassName()">\n  <div data-ng-if="item.type === \'group\'"\n    data-elastic-builder-group="item"\n    data-depth="{{ depth }}"\n    data-elastic-fields="elasticFields"\n    data-on-remove="onRemove()"></div>\n  <div data-ng-if="item.type !== \'group\'"\n    data-elastic-builder-rule="item"\n    data-elastic-fields="elasticFields"\n    data-on-remove="onRemove()"></div>\n</div>\n'),a.put("angular-elastic-builder/GroupDirective.html",'<!-- <div class="elastic-builder-group">\n  <h5>If\n    <select data-ng-model="group.subType" class="form-control">\n      <option value="and">all</option>\n      <option value="or">any</option>\n    </select>\n    of these conditions are met\n  </h5>\n  <div\n    data-ng-repeat="rule in group.rules"\n    data-elastic-builder-chooser="rule"\n    data-elastic-fields="elasticFields"\n    data-depth="{{ +depth + 1 }}"\n    data-on-remove="removeChild($index)"></div>\n\n  <div class="list-group-item actions" data-ng-class="getGroupClassName()">\n    <a class="btn btn-xs btn-primary" title="Add Sub-Rule" data-ng-click="addRule()">\n      <i class="fa fa-plus"></i>\n    </a>\n    <a class="btn btn-xs btn-primary" title="Add Sub-Group" data-ng-click="addGroup()">\n      <i class="fa fa-list"></i>\n    </a>\n  </div>\n\n  <a class="btn btn-xs btn-danger remover" data-ng-click="onRemove()">\n    <i class="fa fa-minus"></i>\n  </a>\n</div> -->\n\n\n<!-- BEGIN Portlet PORTLET-->\n<div class="portlet light">\n  <div class="portlet-title">\n    <div class="caption" data-ng-class="{\'font-blue-hoki\': data.type === \'condition\', \'font-red-flamingo\': data.type === \'action\'}">\n      <!-- <i class="icon-people font-green-sharp"></i> -->\n      <h5><span class="caption-subject">{{ \'APPLICATION_IF\' | translate }}</span>\n        <select data-ng-model="group.subType" class="form-control">\n          <option value="and"><strong>{{ \'APPLICATION_ALL\' | translate | lowercase }}</strong></option>\n          <option value="or"><strong>{{ \'APPLICATION_ANY\' | translate | lowercase }}</strong></option>\n        </select>\n        <span class="caption-subject">{{group.subType == \'and\' ? \'MESSAGE_CODITIONS_MET_ALL\' : \'MESSAGE_CODITIONS_MET_ANY\' | translate}}</span>\n      </h5>\n    </div>\n  </div>\n  <div class="portlet-body">\n    <div class="elastic-builder-group">\n      <div\n        data-ng-repeat="rule in group.rules"\n        data-elastic-builder-chooser="rule"\n        data-elastic-fields="elasticFields"\n        data-depth="{{ +depth + 1 }}"\n        data-on-remove="removeChild($index)"></div>\n\n      <div class="list-group-item actions list-group-item-custom" data-ng-class="getGroupClassName()">\n        <a href="#" class="btn green btn-sm" data-ng-click="addRule()">\n          <i class="icon-plus"></i> {{ \'APPLICATION_ADD_CONDITION\' | translate }}\n        </a>\n        <a class="btn red btn-sm remover" data-ng-click="onRemove()">\n          <i class="icon-trash"></i> {{ \'APPLICATION_REMOVE_GROUP\' | translate }}\n        </a>\n      </div>\n    </div>\n  </div>\n</div>\n<!-- END Portlet PORTLET-->\n'),a.put("angular-elastic-builder/RuleDirective.html",'<!-- <div class="elastic-builder-rule">\n  <select class="form-control" data-ng-model="rule.field" data-ng-options="key as key for (key, value) in elasticFields"></select>\n\n  <span data-elastic-type="getType()" data-rule="rule" data-guide="elasticFields[rule.field]"></span>\n\n  <a class="btn btn-xs btn-danger remover" data-ng-click="onRemove()">\n    <i class="fa fa-minus"></i>\n  </a>\n\n</div> -->\n<!-- <div class="elastic-builder-rule"> -->\n  <!-- <select class="form-control" data-ng-model="rule.field" data-ng-options="key as key for (key, value) in elasticFields"></select> -->\n  {{elasticFields[rule.field].action.label | translate}}\n  <select class="form-control" data-ng-model="rule.field" >\n  <option ng-repeat="option in elasticFields" value="{{option.value}}">{{ option.label | translate }}</option>\n  </select>\n  <!-- <ui-select class="form-control" data-ng-model="rule.field" theme="bootstrap">\n    <ui-select-match placeholder="{{\'APPLICATION_CONDITION\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n    <ui-select-choices repeat="value.value as key for (key, value) in elasticFields | filter: $select.search">\n      {{$translate.instant(key.name)}}\n    </ui-select-choices>\n  </ui-select> -->\n\n  <span data-elastic-type="getType()" data-rule="rule" data-guide="elasticFields[rule.field]"></span>\n\n  <!-- <a class="btn btn-xs btn-danger remover" data-ng-click="onRemove()">\n    <i class="fa fa-minus"></i>\n  </a> -->\n\n  <a class="btn remover" data-ng-click="onRemove()">\n    <i class="icon-trash"></i>\n  </a>\n\n<!-- </div> -->\n'),a.put("angular-elastic-builder/types/Boolean.html",'<span class="boolean-rule">\n  Equals\n\n  <!-- This is a weird hack to make sure these are numbers -->\n  <select\n    data-ng-model="rule.value"\n    class="form-control"\n    data-ng-options="booleans.indexOf(choice) as choice for choice in booleansOrder">\n  </select>\n</span>\n'),a.put("angular-elastic-builder/types/Date.html",'<span class="date-rule">\n  <select data-ng-model="rule.subType" class="form-control">\n\n    <optgroup label="Generic">\n      <option value="exists">Exists</option>\n      <option value="notExists">! Exists</option>\n    </optgroup>\n  </select>\n\n</span>\n'),a.put("angular-elastic-builder/types/Multi.html",'<!-- <span class="multi-rule">\n  <span data-ng-repeat="choice in guide.choices">\n    <label class="checkbox">\n      <input type="checkbox" data-ng-model="rule.values[choice]">\n      {{ choice }}\n    </label>\n  </span>\n</span> -->\n\n<span class="multi-rule">\n  {{guide.action.midterm | translate}}\n  <!-- Range Fields -->\n  <!-- <select data-ng-model="rule.values" class="form-control"> -->\n  <select data-ng-model="rule.value" class="form-control">\n    <!-- <optgroup label="Numeral"> -->\n      <option data-ng-repeat="(key, value) in guide.choices" value="{{value}}">{{key}}</option>\n    <!-- </optgroup> -->\n\n    <!-- <optgroup label="Generic">\n      <option value="exists">Exists</option>\n      <option value="notExists">! Exists</option>\n    </optgroup> -->\n  </select>\n\n  <!-- <input data-ng-if="inputNeeded()"\n    class="form-control"\n    data-ng-model="rule.value"\n    type="number"\n    min="{{ guide.minimum }}"\n    max="{{ guide.maximum }}"> -->\n</span>\n'),a.put("angular-elastic-builder/types/Multiterm.html",'<span class="elastic-multiterm">\n  <select data-ng-model="rule.subType" class="form-control">\n      <option value="equals">{{ \'APPLICATION_EQUALS_TO\' | translate }}</option>\n      <option value="notEquals">{{ \'APPLICATION_NOT_EQUALS_TO\' | translate }}</option>\n  </select>\n  <select data-ng-model="rule.value" class="form-control">\n      <option data-ng-repeat="(key, value) in guide.choices" value="{{value}}">{{value | capitalize}}</option>\n  </select>\n</span>\n'),a.put("angular-elastic-builder/types/Number.html",'<span class="number-rule">\n  <select data-ng-model="rule.subType" class="form-control">\n    <!-- <optgroup label="Numeral"> -->\n      <option value="equals">=</option>\n      <option value="gt">&gt;</option>\n      <option value="gte">&ge;</option>\n      <option value="lt">&lt;</option>\n      <option value="lte">&le;</option>\n    <!-- </optgroup> -->\n\n    <!-- <optgroup label="Generic"> -->\n      <!-- <option value="exists">Exists</option>\n      <option value="notExists">! Exists</option> -->\n    <!-- </optgroup> -->\n  </select>\n\n  <!-- Range Fields -->\n  <input data-ng-if="inputNeeded()"\n    class="form-control"\n    data-ng-model="rule.value"\n    type="number"\n    min="{{ guide.minimum }}"\n    max="{{ guide.maximum }}">\n\n    <!-- <span class="help-block">{{rule.help}}</span> -->\n\n</span>\n'),a.put("angular-elastic-builder/types/Term.html",'<!-- <span class="elastic-term">\n  <select data-ng-model="rule.subType" class="form-control"> -->\n    <!-- Term Options -->\n    <!-- <optgroup label="Text">\n      <option value="equals">Equals</option>\n      <option value="notEquals">! Equals</option>\n    </optgroup> -->\n\n    <!-- Generic Options -->\n    <!-- <optgroup label="Generic">\n      <option value="exists">Exists</option>\n      <option value="notExists">! Exists</option>\n    </optgroup>\n\n  </select>\n  <input\n    data-ng-if="inputNeeded()"\n    class="form-control"\n    data-ng-model="rule.value"\n    type="text">\n</span> -->\n\n\n<span class="elastic-term">\n  <select data-ng-model="rule.subType" class="form-control">\n    <!-- Term Options -->\n    <!-- <optgroup label="Text"> -->\n      <option value="equals">{{ \'APPLICATION_EQUALS_TO\' | translate }}</option>\n      <option value="notEquals">{{ \'APPLICATION_NOT_EQUALS_TO\' | translate }}</option>\n    <!-- </optgroup> -->\n\n    <!-- Generic Options -->\n    <!-- <optgroup label="Generic">\n      <option value="exists">Exists</option>\n      <option value="notExists">! Exists</option>\n    </optgroup> -->\n\n  </select>\n  <input\n    data-ng-if="inputNeeded()"\n    class="form-control input-medium"\n    data-ng-model="rule.value"\n    type="text">\n</span>\n')}])}(window.angular);var Metronic=function(){var a,b=!1,c=!1,d=!1,e=!1,f=[],g="assets/",h="img/",i="plugins/",j="css/",k={blue:"#89C4F4",red:"#F3565D",green:"#1bbc9b",purple:"#9b59b6",grey:"#95a5a6",yellow:"#F8CB00"},l=function(){"rtl"===$("body").css("direction")&&(b=!0),c=!!navigator.userAgent.match(/MSIE 8.0/),d=!!navigator.userAgent.match(/MSIE 9.0/),e=!!navigator.userAgent.match(/MSIE 10.0/),e&&$("html").addClass("ie10"),(e||d||c)&&$("html").addClass("ie")},m=function(){for(var a=0;a<f.length;a++){var b=f[a];b.call()}},n=function(){var a;if(c){var b;$(window).resize(function(){b!=document.documentElement.clientHeight&&(a&&clearTimeout(a),a=setTimeout(function(){m()},50),b=document.documentElement.clientHeight)})}else $(window).resize(function(){a&&clearTimeout(a),a=setTimeout(function(){m()},50)})},o=function(){$("body").on("click",".portlet > .portlet-title > .tools > a.remove",function(a){a.preventDefault();var b=$(this).closest(".portlet");$("body").hasClass("page-portlet-fullscreen")&&$("body").removeClass("page-portlet-fullscreen"),b.find(".portlet-title .fullscreen").tooltip("destroy"),b.find(".portlet-title > .tools > .reload").tooltip("destroy"),b.find(".portlet-title > .tools > .remove").tooltip("destroy"),b.find(".portlet-title > .tools > .config").tooltip("destroy"),b.find(".portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand").tooltip("destroy"),b.remove()}),$("body").on("click",".portlet > .portlet-title .fullscreen",function(a){
 a.preventDefault();var b=$(this).closest(".portlet");if(b.hasClass("portlet-fullscreen"))$(this).removeClass("on"),b.removeClass("portlet-fullscreen"),$("body").removeClass("page-portlet-fullscreen"),b.children(".portlet-body").css("height","auto");else{var c=Metronic.getViewPort().height-b.children(".portlet-title").outerHeight()-parseInt(b.children(".portlet-body").css("padding-top"))-parseInt(b.children(".portlet-body").css("padding-bottom"));$(this).addClass("on"),b.addClass("portlet-fullscreen"),$("body").addClass("page-portlet-fullscreen"),b.children(".portlet-body").css("height",c)}}),$("body").on("click",".portlet > .portlet-title > .tools > a.reload",function(a){a.preventDefault();var b=$(this).closest(".portlet").children(".portlet-body"),c=$(this).attr("data-url"),d=$(this).attr("data-error-display");c?(Metronic.blockUI({target:b,animate:!0,overlayColor:"none"}),$.ajax({type:"GET",cache:!1,url:c,dataType:"html",success:function(a){Metronic.unblockUI(b),b.html(a)},error:function(a,c,e){Metronic.unblockUI(b);var f="Error on reloading the content. Please check your connection and try again.";"toastr"==d&&toastr?toastr.error(f):"notific8"==d&&$.notific8?($.notific8("zindex",11500),$.notific8(f,{theme:"ruby",life:3e3})):alert(f)}})):(Metronic.blockUI({target:b,animate:!0,overlayColor:"none"}),window.setTimeout(function(){Metronic.unblockUI(b)},1e3))}),$('.portlet .portlet-title a.reload[data-load="true"]').click(),$("body").on("click",".portlet > .portlet-title > .tools > .collapse, .portlet .portlet-title > .tools > .expand",function(a){a.preventDefault()})},p=function(){if($().uniform){var a=$("input[type=checkbox]:not(.toggle, .make-switch, .icheck), input[type=radio]:not(.toggle, .star, .make-switch, .icheck)");a.size()>0&&a.each(function(){0===$(this).parents(".checker").size()&&$(this).show()})}},q=function(){$().iCheck&&$(".icheck").each(function(){var a=$(this).attr("data-checkbox")?$(this).attr("data-checkbox"):"icheckbox_minimal-grey",b=$(this).attr("data-radio")?$(this).attr("data-radio"):"iradio_minimal-grey";a.indexOf("_line")>-1||b.indexOf("_line")>-1?$(this).iCheck({checkboxClass:a,radioClass:b,insert:'<div class="icheck_line-icon"></div>'+$(this).attr("data-label")}):$(this).iCheck({checkboxClass:a,radioClass:b})})},r=function(){$().bootstrapSwitch&&$(".make-switch").bootstrapSwitch()},s=function(){$().confirmation&&$("[data-toggle=confirmation]").confirmation({container:"body",btnOkClass:"btn-xs btn-success",btnCancelClass:"btn-xs btn-danger"})},t=function(){$("body").on("shown.bs.collapse",".accordion.scrollable",function(a){Metronic.scrollTo($(a.target))})},u=function(){if(location.hash){var a=location.hash.substr(1);$('a[href="#'+a+'"]').parents(".tab-pane:hidden").each(function(){var a=$(this).attr("id");$('a[href="#'+a+'"]').click()}),$('a[href="#'+a+'"]').click()}},v=function(){$("body").on("hide.bs.modal",function(){$(".modal:visible").size()>1&&$("html").hasClass("modal-open")===!1?$("html").addClass("modal-open"):$(".modal:visible").size()<=1&&$("html").removeClass("modal-open")}),$("body").on("show.bs.modal",".modal",function(){$(this).hasClass("modal-scroll")&&$("body").addClass("modal-open-noscroll")}),$("body").on("hide.bs.modal",".modal",function(){$("body").removeClass("modal-open-noscroll")}),$("body").on("hidden.bs.modal",".modal:not(.modal-cached)",function(){$(this).removeData("bs.modal")})},w=function(){$(".tooltips").tooltip(),$(".portlet > .portlet-title .fullscreen").tooltip({container:"body",title:"Fullscreen"}),$(".portlet > .portlet-title > .tools > .reload").tooltip({container:"body",title:"Reload"}),$(".portlet > .portlet-title > .tools > .remove").tooltip({container:"body",title:"Remove"}),$(".portlet > .portlet-title > .tools > .config").tooltip({container:"body",title:"Settings"}),$(".portlet > .portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand").tooltip({container:"body",title:"Collapse/Expand"})},x=function(){$("body").on("click",".dropdown-menu.hold-on-click",function(a){a.stopPropagation()})},y=function(){$("body").on("click",'[data-close="alert"]',function(a){$(this).parent(".alert").hide(),$(this).closest(".note").hide(),a.preventDefault()}),$("body").on("click",'[data-close="note"]',function(a){$(this).closest(".note").hide(),a.preventDefault()}),$("body").on("click",'[data-remove="note"]',function(a){$(this).closest(".note").remove(),a.preventDefault()})},z=function(){$('[data-hover="dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover(),$(this).addClass("hover-initialized")})},A=function(){$(".popovers").popover(),$(document).on("click.bs.popover.data-api",function(b){a&&a.popover("hide")})},B=function(){Metronic.initSlimScroll(".scroller")},C=function(){jQuery.fancybox&&$(".fancybox-button").size()>0&&$(".fancybox-button").fancybox({groupAttr:"data-rel",prevEffect:"none",nextEffect:"none",closeBtn:!0,helpers:{title:{type:"inside"}}})},D=function(){(c||d)&&$("input[placeholder]:not(.placeholder-no-fix), textarea[placeholder]:not(.placeholder-no-fix)").each(function(){var a=$(this);""===a.val()&&""!==a.attr("placeholder")&&a.addClass("placeholder").val(a.attr("placeholder")),a.focus(function(){a.val()==a.attr("placeholder")&&a.val("")}),a.blur(function(){(""===a.val()||a.val()==a.attr("placeholder"))&&a.val(a.attr("placeholder"))})})},E=function(){$().select2&&$(".select2me").select2({placeholder:"Select"})};return{init:function(){l(),n(),p(),q(),r(),B(),C(),E(),o(),y(),x(),u(),w(),A(),t(),v(),s(),D()},initAjax:function(){p(),q(),r(),z(),B(),E(),C(),x(),w(),A(),t(),s()},initComponents:function(){this.initAjax()},setLastPopedPopover:function(b){a=b},addResizeHandler:function(a){f.push(a)},runResizeHandlers:function(){m()},scrollTo:function(a,b){var c=a&&a.size()>0?a.offset().top:0;a&&($("body").hasClass("page-header-fixed")&&(c-=$(".page-header").height()),c+=b?b:-1*a.height()),$("html,body").animate({scrollTop:c},"slow")},initSlimScroll:function(a){$(a).each(function(){if(!$(this).attr("data-initialized")){var a;a=$(this).attr("data-height")?$(this).attr("data-height"):$(this).css("height"),$(this).slimScroll({allowPageScroll:!0,size:"7px",color:$(this).attr("data-handle-color")?$(this).attr("data-handle-color"):"#bbb",wrapperClass:$(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv",railColor:$(this).attr("data-rail-color")?$(this).attr("data-rail-color"):"#eaeaea",position:b?"left":"right",height:a,alwaysVisible:"1"==$(this).attr("data-always-visible")?!0:!1,railVisible:"1"==$(this).attr("data-rail-visible")?!0:!1,disableFadeOut:!0}),$(this).attr("data-initialized","1")}})},destroySlimScroll:function(a){$(a).each(function(){if("1"===$(this).attr("data-initialized")){$(this).removeAttr("data-initialized"),$(this).removeAttr("style");var a={};$(this).attr("data-handle-color")&&(a["data-handle-color"]=$(this).attr("data-handle-color")),$(this).attr("data-wrapper-class")&&(a["data-wrapper-class"]=$(this).attr("data-wrapper-class")),$(this).attr("data-rail-color")&&(a["data-rail-color"]=$(this).attr("data-rail-color")),$(this).attr("data-always-visible")&&(a["data-always-visible"]=$(this).attr("data-always-visible")),$(this).attr("data-rail-visible")&&(a["data-rail-visible"]=$(this).attr("data-rail-visible")),$(this).slimScroll({wrapperClass:$(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv",destroy:!0});var b=$(this);$.each(a,function(a,c){b.attr(a,c)})}})},scrollTop:function(){Metronic.scrollTo()},blockUI:function(a){a=$.extend(!0,{},a);var b="";if(b=a.animate?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><div class="block-spinner-bar"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div></div>':a.iconOnly?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif" align=""></div>':a.textOnly?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><span>&nbsp;&nbsp;'+(a.message?a.message:"LOADING...")+"</span></div>":'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif" align=""><span>&nbsp;&nbsp;'+(a.message?a.message:"LOADING...")+"</span></div>",a.target){var c=$(a.target);c.height()<=$(window).height()&&(a.cenrerY=!0),c.block({message:b,baseZ:a.zIndex?a.zIndex:1e3,centerY:void 0!==a.cenrerY?a.cenrerY:!1,css:{top:"10%",border:"0",padding:"0",backgroundColor:"none"},overlayCSS:{backgroundColor:a.overlayColor?a.overlayColor:"#555",opacity:a.boxed?.05:.1,cursor:"wait"}})}else $.blockUI({message:b,baseZ:a.zIndex?a.zIndex:1e3,css:{border:"0",padding:"0",backgroundColor:"none"},overlayCSS:{backgroundColor:a.overlayColor?a.overlayColor:"#555",opacity:a.boxed?.05:.1,cursor:"wait"}})},unblockUI:function(a){a?$(a).unblock({onUnblock:function(){$(a).css("position",""),$(a).css("zoom","")}}):$.unblockUI()},startPageLoading:function(a){a&&a.animate?($(".page-spinner-bar").remove(),$("body").append('<div class="page-spinner-bar"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div>')):($(".page-loading").remove(),$("body").append('<div class="page-loading"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif"/>&nbsp;&nbsp;<span>'+(a&&a.message?a.message:"Loading...")+"</span></div>"))},stopPageLoading:function(){$(".page-loading, .page-spinner-bar").remove()},alert:function(a){a=$.extend(!0,{container:"",place:"append",type:"success",message:"",close:!0,reset:!0,focus:!0,closeInSeconds:0,icon:""},a);var b=Metronic.getUniqueID("Metronic_alert"),c='<div id="'+b+'" class="Metronic-alerts alert alert-'+a.type+' fade in">'+(a.close?'<button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>':"")+(""!==a.icon?'<i class="fa-lg fa fa-'+a.icon+'"></i>  ':"")+a.message+"</div>";return a.reset&&$(".Metronic-alerts").remove(),a.container?"append"==a.place?$(a.container).append(c):$(a.container).prepend(c):$("body").hasClass("page-container-bg-solid")?$(".page-title").after(c):$(".page-bar").size()>0?$(".page-bar").after(c):$(".page-breadcrumb").after(c),a.focus&&Metronic.scrollTo($("#"+b)),a.closeInSeconds>0&&setTimeout(function(){$("#"+b).remove()},1e3*a.closeInSeconds),b},initUniform:function(a){a?$(a).each(function(){0===$(this).parents(".checker").size()&&($(this).show(),$(this).uniform())}):p()},updateUniform:function(a){$.uniform.update(a)},initFancybox:function(){C()},getActualVal:function(a){return a=$(a),a.val()===a.attr("placeholder")?"":a.val()},getURLParameter:function(a){var b,c,d=window.location.search.substring(1),e=d.split("&");for(b=0;b<e.length;b++)if(c=e[b].split("="),c[0]==a)return unescape(c[1]);return null},isTouchDevice:function(){try{return document.createEvent("TouchEvent"),!0}catch(a){return!1}},getViewPort:function(){var a=window,b="inner";return"innerWidth"in window||(b="client",a=document.documentElement||document.body),{width:a[b+"Width"],height:a[b+"Height"]}},getUniqueID:function(a){return"prefix_"+Math.floor(Math.random()*(new Date).getTime())},isIE8:function(){return c},isIE9:function(){return d},isRTL:function(){return b},isAngularJsApp:function(){return"undefined"==typeof angular?!1:!0},getAssetsPath:function(){return g},setAssetsPath:function(a){g=a},setGlobalImgPath:function(a){h=a},getGlobalImgPath:function(){return g+h},setGlobalPluginsPath:function(a){i=a},getGlobalPluginsPath:function(){return g+i},getGlobalCssPath:function(){return g+j},getBrandColor:function(a){return k[a]?k[a]:""},getResponsiveBreakpoint:function(a){var b={xs:480,sm:768,md:900,lg:1200};return b[a]?b[a]:0}}}(),Layout=function(){var a="img/",b="css/",c=Metronic.getResponsiveBreakpoint("md"),d=function(){var a,b=$(".page-content"),d=$(".page-sidebar"),e=$("body");if(e.hasClass("page-footer-fixed")===!0&&e.hasClass("page-sidebar-fixed")===!1){var f=Metronic.getViewPort().height-$(".page-footer").outerHeight()-$(".page-header").outerHeight();b.height()<f&&b.attr("style","min-height:"+f+"px")}else{if(e.hasClass("page-sidebar-fixed"))a=g(),e.hasClass("page-footer-fixed")===!1&&(a-=$(".page-footer").outerHeight());else{var h=$(".page-header").outerHeight(),i=$(".page-footer").outerHeight();a=Metronic.getViewPort().width<c?Metronic.getViewPort().height-h-i:d.height()+20,a+h+i<=Metronic.getViewPort().height&&(a=Metronic.getViewPort().height-h-i)}b.attr("style","min-height:"+a+"px")}},e=function(a,b){var d=location.hash.toLowerCase(),e=$(".page-sidebar-menu");if("click"===a||"set"===a?b=$(b):"match"===a&&e.find("li > a").each(function(){var a=$(this).attr("href").toLowerCase();return a.length>1&&d.substr(1,a.length-1)==a.substr(1)?void(b=$(this)):void 0}),b&&0!=b.size()&&"javascript:;"!==b.attr("href").toLowerCase()&&"#"!==b.attr("href").toLowerCase()){parseInt(e.data("slide-speed")),e.data("keep-expanded");e.find("li.active").removeClass("active"),e.find("li > a > .selected").remove(),e.hasClass("page-sidebar-menu-hover-submenu")===!1?e.find("li.open").each(function(){0===$(this).children(".sub-menu").size()&&($(this).removeClass("open"),$(this).find("> a > .arrow.open").removeClass("open"))}):e.find("li.open").removeClass("open"),b.parents("li").each(function(){$(this).addClass("active"),$(this).find("> a > span.arrow").addClass("open"),1===$(this).parent("ul.page-sidebar-menu").size()&&$(this).find("> a").append('<span class="selected"></span>'),1===$(this).children("ul.sub-menu").size()&&$(this).addClass("open")}),"click"===a&&Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click()}},f=function(){jQuery(".page-sidebar").on("click","li > a",function(a){var b=$(this).next().hasClass("sub-menu");if(!(Metronic.getViewPort().width>=c&&1===$(this).parents(".page-sidebar-menu-hover-submenu").size())){if(b===!1)return void(Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click());if(!$(this).next().hasClass("sub-menu always-open")){var e=$(this).parent().parent(),f=$(this),g=$(".page-sidebar-menu"),h=jQuery(this).next(),i=g.data("auto-scroll"),j=parseInt(g.data("slide-speed")),k=g.data("keep-expanded");k!==!0&&(e.children("li.open").children("a").children(".arrow").removeClass("open"),e.children("li.open").children(".sub-menu:not(.always-open)").slideUp(j),e.children("li.open").removeClass("open"));var l=-200;h.is(":visible")?(jQuery(".arrow",jQuery(this)).removeClass("open"),jQuery(this).parent().removeClass("open"),h.slideUp(j,function(){i===!0&&$("body").hasClass("page-sidebar-closed")===!1&&($("body").hasClass("page-sidebar-fixed")?g.slimScroll({scrollTo:f.position().top}):Metronic.scrollTo(f,l)),d()})):b&&(jQuery(".arrow",jQuery(this)).addClass("open"),jQuery(this).parent().addClass("open"),h.slideDown(j,function(){i===!0&&$("body").hasClass("page-sidebar-closed")===!1&&($("body").hasClass("page-sidebar-fixed")?g.slimScroll({scrollTo:f.position().top}):Metronic.scrollTo(f,l)),d()})),a.preventDefault()}}}),jQuery(".page-sidebar").on("click"," li > a.ajaxify",function(a){a.preventDefault(),Metronic.scrollTop();var b=$(this).attr("href"),d=jQuery(".page-sidebar ul"),e=($(".page-content"),$(".page-content .page-content-body"));d.children("li.active").removeClass("active"),d.children("arrow.open").removeClass("open"),$(this).parents("li").each(function(){$(this).addClass("active"),$(this).children("a > span.arrow").addClass("open")}),$(this).parents("li").addClass("active"),Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click(),Metronic.startPageLoading();var f=$(this);$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(a){0===f.parents("li.open").size()&&$(".page-sidebar-menu > li.open > a").click(),Metronic.stopPageLoading(),e.html(a),Layout.fixContentHeight(),Metronic.initAjax()},error:function(a,b,c){Metronic.stopPageLoading(),e.html("<h4>Could not load the requested content.</h4>")}})}),jQuery(".page-content").on("click",".ajaxify",function(a){a.preventDefault(),Metronic.scrollTop();var b=$(this).attr("href"),d=($(".page-content"),$(".page-content .page-content-body"));Metronic.startPageLoading(),Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click(),$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(a){Metronic.stopPageLoading(),d.html(a),Layout.fixContentHeight(),Metronic.initAjax()},error:function(a,b,c){d.html("<h4>Could not load the requested content.</h4>"),Metronic.stopPageLoading()}})}),i(),$(".page-sidebar").on("click",".sidebar-search .remove",function(a){a.preventDefault(),$(".sidebar-search").removeClass("open")}),$(".page-sidebar .sidebar-search").on("keypress","input.form-control",function(a){return 13==a.which?($(".sidebar-search").submit(),!1):void 0}),$(".sidebar-search .submit").on("click",function(a){a.preventDefault(),$("body").hasClass("page-sidebar-closed")&&$(".sidebar-search").hasClass("open")===!1?(1===$(".page-sidebar-fixed").size()&&$(".page-sidebar .sidebar-toggler").click(),$(".sidebar-search").addClass("open")):$(".sidebar-search").submit()}),0!==$(".sidebar-search").size()&&($(".sidebar-search .input-group").on("click",function(a){a.stopPropagation()}),$("body").on("click",function(){$(".sidebar-search").hasClass("open")&&$(".sidebar-search").removeClass("open")}))},g=function(){var a=Metronic.getViewPort().height-$(".page-header").outerHeight();return $("body").hasClass("page-footer-fixed")&&(a-=$(".page-footer").outerHeight()),a},h=function(){var a=$(".page-sidebar-menu");return Metronic.destroySlimScroll(a),0===$(".page-sidebar-fixed").size()?void d():void(Metronic.getViewPort().width>=c&&(a.attr("data-height",g()),Metronic.initSlimScroll(a),d()))},i=function(){var a=$("body");a.hasClass("page-sidebar-fixed")&&$(".page-sidebar").on("mouseenter",function(){a.hasClass("page-sidebar-closed")&&$(this).find(".page-sidebar-menu").removeClass("page-sidebar-menu-closed")}).on("mouseleave",function(){a.hasClass("page-sidebar-closed")&&$(this).find(".page-sidebar-menu").addClass("page-sidebar-menu-closed")})},j=function(){var a=$("body");$.cookie&&"1"===$.cookie("sidebar_closed")&&Metronic.getViewPort().width>=c?($("body").addClass("page-sidebar-closed"),$(".page-sidebar-menu").addClass("page-sidebar-menu-closed")):$.cookie&&$.cookie("sidebar_closed","0"),$("body").on("click",".sidebar-toggler",function(b){var c=$(".page-sidebar"),d=$(".page-sidebar-menu");$(".sidebar-search",c).removeClass("open"),a.hasClass("page-sidebar-closed")?(a.removeClass("page-sidebar-closed"),d.removeClass("page-sidebar-menu-closed"),$.cookie&&$.cookie("sidebar_closed","0")):(a.addClass("page-sidebar-closed"),d.addClass("page-sidebar-menu-closed"),a.hasClass("page-sidebar-fixed")&&d.trigger("mouseleave"),$.cookie&&$.cookie("sidebar_closed","1")),$(window).trigger("resize")})},k=function(){$(".page-header").on("click",'.hor-menu a[data-toggle="tab"]',function(a){a.preventDefault();var b=$(".hor-menu .nav"),c=b.find("li.current");$("li.active",c).removeClass("active"),$(".selected",c).remove();var d=$(this).parents("li").last();d.addClass("current"),d.find("a:first").append('<span class="selected"></span>')}),$(".page-header").on("click",".search-form",function(a){$(this).addClass("open"),$(this).find(".form-control").focus(),$(".page-header .search-form .form-control").on("blur",function(a){$(this).closest(".search-form").removeClass("open"),$(this).unbind("blur")})}),$(".page-header").on("keypress",".hor-menu .search-form .form-control",function(a){return 13==a.which?($(this).closest(".search-form").submit(),!1):void 0}),$(".page-header").on("mousedown",".search-form.open .submit",function(a){a.preventDefault(),a.stopPropagation(),$(this).closest(".search-form").submit()}),$('[data-hover="megamenu-dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover(),$(this).addClass("hover-initialized")}),$(document).on("click",".mega-menu-dropdown .dropdown-menu",function(a){a.stopPropagation()})},l=function(){$("body").on("shown.bs.tab",'a[data-toggle="tab"]',function(){d()})},m=function(){var a=300,b=500;navigator.userAgent.match(/iPhone|iPad|iPod/i)?$(window).bind("touchend touchcancel touchleave",function(c){$(this).scrollTop()>a?$(".scroll-to-top").fadeIn(b):$(".scroll-to-top").fadeOut(b)}):$(window).scroll(function(){$(this).scrollTop()>a?$(".scroll-to-top").fadeIn(b):$(".scroll-to-top").fadeOut(b)}),$(".scroll-to-top").click(function(a){return a.preventDefault(),$("html, body").animate({scrollTop:0},b),!1})},n=function(){var a,b=$(".full-height-content");if(a=Metronic.getViewPort().height-$(".page-header").outerHeight(!0)-$(".page-footer").outerHeight(!0)-$(".page-title").outerHeight(!0)-$(".page-bar").outerHeight(!0),b.hasClass("portlet")){var d=b.find(".portlet-body");if(Metronic.getViewPort().width<c)return void Metronic.destroySlimScroll(d.find(".full-height-content-body"));a=a-b.find(".portlet-title").outerHeight(!0)-parseInt(b.find(".portlet-body").css("padding-top"))-parseInt(b.find(".portlet-body").css("padding-bottom"))-2,b.hasClass("full-height-content-scrollable")?(a-=35,d.find(".full-height-content-body").css("height",a),Metronic.initSlimScroll(d.find(".full-height-content-body"))):d.css("min-height",a)}else{if(Metronic.getViewPort().width<c)return void Metronic.destroySlimScroll(b.find(".full-height-content-body"));b.hasClass("full-height-content-scrollable")?(a-=35,b.find(".full-height-content-body").css("height",a),Metronic.initSlimScroll(b.find(".full-height-content-body"))):b.css("min-height",a)}};return{initHeader:function(){k()},setSidebarMenuActiveLink:function(a,b){e(a,b)},initSidebar:function(){h(),f(),j(),Metronic.isAngularJsApp()&&e("match"),Metronic.addResizeHandler(h)},initContent:function(){n(),l(),Metronic.addResizeHandler(d),Metronic.addResizeHandler(n)},initFooter:function(){m()},init:function(){this.initHeader(),this.initSidebar(),this.initContent(),this.initFooter()},fixContentHeight:function(){d()},initFixedSidebarHoverEffect:function(){i()},initFixedSidebar:function(){h()},getLayoutImgPath:function(){return Metronic.getAssetsPath()+a},getLayoutCssPath:function(){return Metronic.getAssetsPath()+b}}}();angular.module("xCallyShuttleApp").run(["$templateCache",function(a){a.put("app/agent/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-people"></i>\n					<a href="/agents/list">{{ \'APPLICATION_AGENTS\' | 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-people font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_AGENTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="agents.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_AGENT\' | translate }} <i class="fa fa-angle-down"></i>\n						</a>\n						<ul class="dropdown-menu pull-right">\n							<li>\n								<a href="/agents/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="getAgents([\'name\', \'fullname\', \'email\'])" csv-header="[\'Username\', \'Fullname\', \'Email\']" field-separator=";" filename="agents.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="displayedAgents" 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.agentsByPage" theme="bootstrap" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="agentByPage in agentsByPage | filter: $select.search">\n													<div ng-bind-html="agentByPage.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="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>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody>\n					    <tr data-ng-repeat="agent in displayedAgents" class="animate-repeat">\n								<td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="agents.checked" checklist-value="agent.id"></td>\n								<td>{{agent.fullname}}</td>\n					      <td>{{agent.name}}</td>\n					      <td><a data-ng-href="mailto:{{agent.email}}">{{agent.email}}</a></td>\n					      <td>\n					        <a class="btn default btn-xs blue-stripe" data-ng-href="/agents/view/{{agent.id}}/account">\n										{{ \'APPLICATION_PROFILE\' | translate }}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(agent.fullname,agent.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="displayedAgents.length">\n								<td colspan="5" style="text-align:center;">\n									<i>No agents 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						  </tr>\n					    <tr>\n					      <td colspan="5" class="text-center">\n									<div class="pagination" st-pagination st-items-by-page="conf.agentsByPage.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/agent/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() || agent.id === Auth.getCurrentUser().id" data-ng-class="{\'active\': !Auth.isAdmin() && agent.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="agent.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="agent.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="agent.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="agent.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&amp;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() || agent.id === Auth.getCurrentUser().id" data-ng-class="{\'active\': !Auth.isAdmin() && agent.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="agent.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="agent.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="agent.reNewPwd" nx-equal="agent.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/agent/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="/agents/list">{{ \'APPLICATION_AGENTS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{agent.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/{{agent.userpic ? agent.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						{{agent.fullname}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{agent.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.agents.view.account\')}">\n							<a data-ng-href="/agents/view/{{agent.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/agent/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="/agents/list">{{ \'APPLICATION_AGENTS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-options"></i>\n				<a href="/agents/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_AGENT\' | 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/agents/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/agents/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/agents/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/automation/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_AUTOMATIONS\' | 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_AUTOMATIONS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="Automations.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_AUTOMATION\' | translate }} <i class="fa fa-angle-down"></i>\n						</a>\n						<ul class="dropdown-menu pull-right">\n							<li>\n								<a href="/automations/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="getAutomations([\'name\', \'description\'])" csv-header="[\'Name\', \'Description\']" field-separator=";" filename="automations.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="displayedAutomations" 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.AutomationsByPage" theme="bootstrap" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="AutomationByPage in AutomationsByPage | filter: $select.search">\n													<div ng-bind-html="AutomationByPage.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(Automation, 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="Automation in displayedAutomations">\n								<td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="Automations.checked" checklist-value="Automation.id"></td>\n					      <td>{{Automation.name}}</td>\n								<td>{{Automation.description}}</td>\n								<td>{{Automation.channel | capitalize}}</td>\n								<td>\n									<input\n										data-ng-change="updateItem(Automation.id, Automation.status)",\n								    bs-switch\n								    ng-model="Automation.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="/automations/view/{{Automation.id}}/settings">\n										{{ \'APPLICATION_EDIT\' | translate }}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(Automation.name, Automation.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="displayedAutomations.length">\n								<td colspan="6" class="text-center">\n									<i>No available automations</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.AutomationsByPage.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/automation/view/view.html",'<!-- BEGIN PAGE HEADER-->\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-settings"></i>\n					<a href="/automations/list">{{ \'APPLICATION_AUTOMATIONS\' | translate }}</a>\n					<i class="fa fa-angle-right" data-ng-show="automation"></i>\n				</li>\n				<li data-ng-show="automation">\n					<a href="#">{{ automation.description || automation.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/automation.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						{{ automation.name }}\n					</div>\n					<div class="profile-usertitle-job">\n						{{ automation.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.automations.view.settings\')}">\n							<a href="/automations/view/{{automation.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/automation/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 && updateAutomation()" 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="automation.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="automation.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					<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="$automations.operators" properties="properties[automation.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[automation.channel]"></query-builder>\n						</div>\n					</div>\n\n						<input class="btn green-haze" type="button" value="{{\'APPLICATION_UPDATE\' | translate}}" data-ng-click="updateAutomation()"/>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/automation/wizard/wizard.html",'<div class="row">\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-settings"></i>\n					<a href="/automations/list">{{ \'APPLICATION_AUTOMATIONS\' | 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_AUTOMATIONS\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n					<!-- <pre>\n						{{item | json}}\n					</pre>\n					<pre>\n						{{conditionsData.query | json}}\n					</pre>\n					<pre>\n						{{actionsData.query | json}}\n					</pre> -->\n					<wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(forms.general.$valid)">\n						<form name="forms.general" data-ng-submit="submit()" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.name.$touched && 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.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="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}}" canexit="exitValidation(conditionsData.query.length && actionsData.query.length)">\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 $automations.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="$automations.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 PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
@@ -28,7 +28,7 @@ a.put("app/mail/template/view/view.agents.html",'<div class="row" data-ng-init="
 a.put("app/motionbar/motionbar.chat.html",'<div data-ng-include="\'components/quickSidebar/quickSidebar.html\'" data-ng-controller="QuickSidebarController" class="page-quick-sidebar-wrapper" style="margin-top: -92px;"></div>\n'),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\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"></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"></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">&times;</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-icon-only btn-default" href="#" data-ng-click="checkout()">\n						<i class="icon-cloud-download"></i>\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 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>No agents available</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&amp;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">&times;</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-icon-only btn-default" href="#" data-ng-click="pull()">\n						<i class="icon-cloud-download"></i>\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&amp;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&amp;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'),
@@ -42,5 +42,5 @@ a.put("app/voice/route/internal/view/view.applications.html",'<div ui-view class
 a.put("app/voice/route/outbound/view/view.routeSettings.html",'\n<div class="row" data-ng-init="initApplication();getApplication();getIntervals();">\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_APPLICATION_SETTINGS\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="updateItem()">\n					<div class="profile-usertitle-name">\n						{{(main.app | capitalize) || \'Application\'}}\n					</div>\n	        <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.info.$valid)">\n						<form name="forms.info" novalidate>\n							<div id="Dial" class="app-settings" ng-slide-down="main.app == \'Dial\'" lazy-render duration="1">\n							<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n\n							<!-- START TRUNK -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TRUNK\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="application.TrunkId" name="trunk" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="trunk.id as trunk in items | filter: $select.search">\n										<div ng-bind-html="trunk.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TRUNK -->\n\n							<!-- START CONTEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.context.$touched || forms.info.$submitted) && forms.info.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="application.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 items2 | 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_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.info.context.$touched || forms.info.$submitted) && forms.info.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.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_CALLERID\' | translate }}</label>\n								<input type="text" name="callerID" placeholder="{{ \'APPLICATION_CALLERID\' | translate }}" class="form-control" data-ng-model="application.callerID">\n								<span data-ng-show="(forms.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid" 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 CUTDIGITS -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_CUTDIGITS\' | translate}}</label>\n								<input type="number" class="form-control" name="cutdigits" data-ng-model="application.cutdigits">\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n							</div>\n							<!-- END CUTDIGITS -->\n						</div>\n						<div id="Custom" class="app-settings" ng-slide-down="main.app == \'custom\'" lazy-render duration="1">\n\n							<!-- START CUSTOMAPP -->\n							<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_CUSTOM_APP\' | translate }}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="customApp" placeholder="{{ \'APPLICATION_CUSTOM_APP\' | translate }}" class="form-control" data-ng-model="application.customApp" required>\n								<span data-ng-show="(forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid && forms.info.customApp.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CUSTOMAPP -->\n\n							<!-- START APPDATA -->\n							<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_ARGUMENTS\' | translate }}</label>\n								<input type="text" name="appdata" placeholder="{{ \'APPLICATION_ARGUMENTS\' | translate }}" class="form-control" data-ng-model="application.appdata">\n								<span data-ng-show="(forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid && forms.info.appdata.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END APPDATA -->\n						</div>\n						<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n					</form>\n					</wz-step>\n						<wz-step title="{{\'APPLICATION_INTERVAL\' | translate}}" canexit="formValidation(forms.interval.IntervalId.$valid || forms.interval.hasOwnProperty(\'t_from\') || forms.interval.intType.$modelValue === \'always\')">\n							<form name="forms.interval" novalidate>\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="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n						<!-- START INTERVAL_TYPE -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$invalid}">\n							<label class="control-label">{{\'APPLICATION_INTERVAL_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="interval.intType" theme="bootstrap" name="intType" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n								<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n									{{$translate.instant(intType.name)}}\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END INTERVAL_TYPE -->\n						<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'custom\'" lazy-render duration="1">\n								<!-- START TIME -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n									<div class="input-group input-large">\n										<fieldset class="pull-left" ng-disabled="interval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="interval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n										<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n										<fieldset ng-disabled="interval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="interval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n										<label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="interval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n									</div>\n								</div>\n								<!-- END TIME -->\n\n								<!-- START WEEKDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="interval.wd_from" theme="bootstrap" name="wd_from">\n											<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{$translate.instant(weekDay.name)}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="interval.wd_to" theme="bootstrap" name="wd_to">\n											<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{$translate.instant(weekDay.name)}}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END WEEKDAY -->\n\n								<!-- START MONTHDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="interval.md_from" theme="bootstrap" name="md_from">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="interval.md_to" theme="bootstrap" name="md_to">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTHDAY -->\n\n								<!-- START MONTH -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="interval.m_from" theme="bootstrap" name="m_from">\n											<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{$translate.instant(month.name)}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="interval.m_to" theme="bootstrap" name="m_to">\n											<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{$translate.instant(month.name)}}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTH -->\n							</div>\n\n							<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'list\'" lazy-render duration="1">\n\n								<!-- START INTERVALS -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="interval.IntervalId" theme="bootstrap" name="IntervalId" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n										<ui-select-choices repeat="interval.id as interval in Intervals | filter: $select.search">\n											{{$translate.instant(interval.name)}}\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END INTERVALS -->\n\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="goNext()">{{\'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 PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/voice/route/outbound/view/view.routes.html",'<div ui-view class="profile-content">\n<div class="row" data-ng-init="getRouteApplications()">\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_ACTIONS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn green-jungle " href="/voice/routes/outbound/view/{{route.id}}/route" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ROUTE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table class="table table-striped table-bordered table-hover">\n					  <thead>\n						  <tr>\n								<th>{{ \'APPLICATION_APPLICATION\' | translate }}</th>\n								<th>{{ \'APPLICATION_CONTEXT\' | translate }}</th>\n								<th>{{ \'APPLICATION_ARGUMENTS\' | translate }}</th>\n						    <th>{{ \'APPLICATION_TIME\' | translate }}</th>\n								<th></th>\n						  </tr>\n					  </thead>\n					  <tbody ui-sortable="sortableOptions" data-ng-model="routeApplications">\n					    <tr data-ng-repeat="application in routeApplications | orderBy:\'priority\'">\n								<td>{{application.app}}</td>\n								<td>{{application.context}}</td>\n								<td>{{application.appdata}}</td>\n								<td>{{application.interval}}</td>\n					      <td>\n									<a class="btn default btn-xs blue-stripe" data-ng-href="/voice/routes/outbound/view/{{route.id}}/routes/settings/{{application.id}}">\n										{{ \'APPLICATION_SETTINGS\' | translate}}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(\'Route\',application.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="routeApplications.length">\n								<td colspan="5" style="text-align:center;">\n									<i>{{ \'MESSAGE_NO_ROUTES_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/route/outbound/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_OUTBOUND\' | translate}} {{ \'APPLICATION_ROUTE\' | 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 && updateRoute()" novalidate>\n\n							<!-- START EXTEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PATTERN\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="exten" placeholder="{{\'APPLICATION_PATTERN\' | translate}}" class="form-control" data-ng-model="route.exten" required/>\n								<span data-ng-show="(forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END EXTEN -->\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="route.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_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 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="route.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\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/voice/route/outbound/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-call-out"></i>\n				<a href="/voice/routes/outbound/list">{{ \'APPLICATION_OUTBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | 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" data-ng-init="getContexts()">\n  	<div class="portlet-title">\n  		<div class="caption font-green-sharp">\n  			<i class="icon-call-out font-green-sharp"></i>\n  			<span class="caption-subject">{{ \'APPLICATION_OUTBOUND\' | translate }} {{ \'APPLICATION_ROUTE\' | 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.route.$valid)">\n			    <form name="forms.route" novalidate>\n\n            <!-- START EXTEN -->\n            <div class="form-group" data-ng-class="{\'has-error\': (forms.route.exten.$touched || forms.route.$submitted) && forms.route.exten.$invalid}">\n              <label class="control-label">{{\'APPLICATION_PATTERN\' | translate}}<span class="required" aria-required="true">*</span></label>\n              <input type="text" name="exten" placeholder="{{\'APPLICATION_PATTERN\' | translate}}" class="form-control" data-ng-model="item.exten" required/>\n              <span data-ng-show="(forms.route.exten.$touched || forms.route.$submitted) && forms.route.exten.$error.required" class="help-block help-block-error">\n                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n              </span>\n            </div>\n            <!-- END EXTEN -->\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\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/voicemail/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-envelope-letter"></i>\n					<a href="/voice/voicemails/list">{{ \'APPLICATION_VOICEMAILS\' | 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-envelope-letter font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_VOICEMAILS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="voicemails.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_VOICEMAIL\' | translate }} <i class="fa fa-angle-down"></i>\n						</a>\n						<ul class="dropdown-menu pull-right">\n							<li>\n								<a href="/voice/voicemails/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="getVoicemails([\'mailbox\', \'fullname\', \'email\'])" csv-header="[\'Mailbox\', \'Fullname\', \'Email\']" field-separator=";" filename="voicemails.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="displayedVoicemails" 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.voicemailsByPage" theme="bootstrap" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="voicemailByPage in voicemailsByPage | filter: $select.search">\n													<div ng-bind-html="voicemailByPage.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(voicemail, checked)" checklist-model checklist-value="uniqueid"></th>\n						    <th st-sort="mailbox">{{ \'APPLICATION_MAILBOX\' | translate }}</th>\n						    <th st-sort="fullname">{{ \'APPLICATION_FULLNAME\' | translate }}</th>\n						    <th st-sort="email">{{ \'APPLICATION_EMAIL\' | translate }}</th>\n								<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody>\n					    <tr data-ng-repeat="voicemail in displayedVoicemails" class="animate-repeat">\n								<td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="voicemails.checked" checklist-value="voicemail.uniqueid"></td>\n								<td>{{voicemail.mailbox}}</td>\n                <td>{{voicemail.fullname}}</td>\n					      <td>{{voicemail.email}}</td>\n					      <td>\n					        <a class="btn default btn-xs blue-stripe" data-ng-href="/voice/voicemails/view/{{voicemail.uniqueid}}/settings">\n										{{ \'APPLICATION_SETTINGS\' | translate}}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(voicemail.mailbox,voicemail.uniqueid)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="displayedVoicemails.length">\n								<td colspan="5" style="text-align:center;">\n									<i>{{ \'MESSAGE_NO_VOICEMAILS_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="mailbox" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_MAILBOX\' | 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="fullname" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_FULLNAME\' | 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						    </td>\n						  </tr>\n					    <tr>\n					      <td colspan="5" class="text-center">\n					        <div st-pagination class="pagination" st-items-by-page="conf.voicemailsByPage.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/voicemail/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getVoicemail()">\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-envelope-letter"></i>\n					<a href="/voice/voicemails/list">{{ \'APPLICATION_VOICEMAILS\' | translate }}</a>\n					<i data-ng-show="voicemail" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="voicemail">\n					<a href="#">{{voicemail.mailbox}}</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/voicemail.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						{{voicemail.mailbox}}\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.voicemails.view.settings\')}">\n							<a data-ng-href="/voice/voicemails/view/{{voicemail.uniqueid}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n            <li data-ng-class="{active: $state.is(\'main.voice.voicemails.view.messages\')}">\n              <a data-ng-href="/voice/voicemails/view/{{voicemail.uniqueid}}/messages">\n              <i class="icon-speech"></i>\n              {{ \'APPLICATION_MESSAGES\' | 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/voicemail/view/view.messages.html",'<div class="row" data-ng-init="getMessages()">\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_MESSAGES\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table class="table table-striped table-bordered table-hover">\n					  <thead>\n						  <tr>\n						    <th>{{ \'APPLICATION_CALLERID\' | translate }}</th>\n						    <th>{{ \'APPLICATION_DATE\' | translate }}</th>\n								<th>{{ \'APPLICATION_DURATION\' | translate }}</th>\n								<th>{{ \'APPLICATION_RECORDING\' | translate }}</th>\n								<th width="20%">{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody data-ng-model="voicemailMessages">\n					    <tr data-ng-repeat="message in voicemailMessages">\n								<td>{{message.callerid}}</td>\n								<td>{{returnMessageDate(message.stamp)}}</td>\n								<td>{{returnDuration(message.duration) | date: \'mm:ss\'}}</td>\n								<td>\n									<audio controls ng-src="{{encodeRecording(message.recording)}}" preload="none">\n			            Your browser does not support the audio tag.\n			          </audio>\n							</td>\n					      <td>\n									<a class="btn default btn-xs green-stripe" href="/api/voice/voicemails/messages/{{message.id}}/download" target="_self">\n										{{ \'APPLICATION_DOWNLOAD\' | translate}}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(\'message\',message.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="voicemailMessages.length">\n								<td colspan="5" style="text-align:center;">\n									<i>No messages available</i>\n								</td>\n							</tr>\n					  </tbody>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/voice/voicemail/view/view.settings.html",'<div class="row" data-ng-init="getContexts()">\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_VOICEMAIL\' | 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">\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 && updateVoiceVoicemail()" novalidate>\n\n							<!-- START MAILBOX -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.mailbox.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MAILBOX\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="mailbox" placeholder="{{\'APPLICATION_MAILBOX\' | translate}}" class="form-control" data-ng-model="voicemail.mailbox" required/>\n								<span data-ng-show="forms.general.$submitted && forms.general.mailbox.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MAILBOX -->\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_NEW_PASSWORD\' | translate}}</label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="voicemail.password" />\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_PASSWORD\' | translate}}</label>\n								<input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="voicemail.rpassword" nx-equal="voicemail.password"/>\n								<span data-ng-show="forms.general.$submitted && (forms.general.rpassword.$invalid || 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 FULLNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.fullname.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="fullname" placeholder="{{\'APPLICATION_FULLNAME\' | translate}}" class="form-control" data-ng-model="voicemail.fullname" required/>\n								<span data-ng-show="forms.general.$submitted && forms.general.fullname.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END FULLNAME -->\n\n							<!-- START EMAIL -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.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="voicemail.email" required/>\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 EMAIL -->\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="voicemail.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_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							<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="updateVoiceVoicemail()" novalidate>\n\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/voice/voicemail/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-envelope-letter"></i>\n				<a href="/voice/voicemails/list">{{ \'APPLICATION_VOICEMAILS\' | 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-envelope-letter font-green-sharp"></i>\n  			<span class="caption-subject">{{ \'APPLICATION_VOICEMAIL\' | 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 MAILBOX -->\n			      <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.mailbox.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_MAILBOX\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="text" name="mailbox" placeholder="{{\'APPLICATION_MAILBOX\' | translate}}" class="form-control" data-ng-model="item.mailbox" required/>\n							<span data-ng-show="forms.general.$submitted && forms.general.mailbox.$invalid" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END MAILBOX -->\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_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.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_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.general.$submitted && (forms.general.rpassword.$invalid || 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 FULLNAME -->\n            <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.fullname.$invalid}">\n              <label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n              <input type="text" name="fullname" placeholder="{{\'APPLICATION_FULLNAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n              <span data-ng-show="forms.general.$submitted && forms.general.fullname.$invalid" class="help-block help-block-error">\n                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n              </span>\n            </div>\n            <!-- END FULLNAME -->\n\n            <!-- START EMAIL -->\n            <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.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/>\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 EMAIL -->\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="item.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_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						<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/yourdashboard/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_DASHBOARD\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.dashboard" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.dashboard.name.$touched || forms.dashboard.$submitted) && forms.dashboard.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.dashboard.name.$touched || forms.dashboard.$submitted) && forms.dashboard.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.dashboard.$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/yourdashboard/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-screen-desktop"></i>\n					<a href="/yourdashboards/list">{{ \'APPLICATION_YOUR_DASHBOARDS\' | 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_YOUR_DASHBOARDS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="dashboards.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_DASHBOARD\' | translate }}\n						</button>\n					</div>\n					<a class="btn btn-icon-only btn-default" href="#" ng-csv="getDashboards([\'name\', \'description\'])" csv-header="[\'Name\', \'Description\']" field-separator=";" filename="dashboards.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="displayedDashboards" 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.dashboardsByPage" theme="bootstrap" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="dashboardByPage in dashboardsByPage | filter: $select.search">\n													<div ng-bind-html="dashboardByPage.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(dashboard, 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="dashboard in displayedDashboards" class="animate-repeat">\n								<td style="text-align: center; vertical-align: middle"><input data-ng-hide="dashboard.defaultEntry" type="checkbox" checklist-model="dashboards.checked" checklist-value="dashboard.id"></td>\n								<td>{{dashboard.name}}</td>\n					      <td>{{dashboard.description}}</td>\n					      <td>\n									<a class="btn default btn-xs green-stripe" data-ng-href="/yourdashboards/show/{{dashboard.id}}">\n										{{ \'APPLICATION_VIEW\' | translate}}\n					        </a>\n					        <a class="btn default btn-xs blue-stripe" data-ng-href="/yourdashboards/view/{{dashboard.id}}/settings">\n										{{ \'APPLICATION_SETTINGS\' | translate}}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(dashboard.name,dashboard.id)" data-ng-class="{\'disabled\': dashboard.defaultEntry}">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="displayedDashboards.length">\n								<td colspan="4" style="text-align:center;">\n									<i>{{ \'MESSAGE_NO_DASHBOARDS_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.dashboardsByPage.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/yourdashboard/show/show.html",'<div class="col-md-12" ng-init="getDashboard()">\n  <adf-dashboard\n          name="{{dashboard.name}}"\n          collapsible="{{dashboard.collapsible}}"\n          maximizable="{{dashboard.maximizable}}"\n          enableconfirmdelete="{{dashboard.enableconfirmdelete}}"\n          structure="{{dashboard.structure}}"\n          editable="{{dashboard.editable}}"\n          adf-model="dashboard.model"/>\n</div>\n'),a.put("app/yourdashboard/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getDashboard()">\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-screen-desktop"></i>\n					<a href="/yourdashboards/list">{{ \'APPLICATION_YOUR_DASHBOARDS\' | translate }}</a>\n					<i data-ng-show="dashboard" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="dashboard">\n					<a href="#">{{dashboard.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/dashboard.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						{{dashboard.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.yourdashboards.view.settings\')}">\n							<a data-ng-href="/yourdashboards/view/{{dashboard.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/yourdashboard/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_DASHBOARD\' | 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 && updateDashboard()" novalidate>\n\n							<!-- START VISIBLE TO ADMIN -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_VISIBLE_TO_ADMIN\' | translate}}</label><br>\n								<input\n									bs-switch\n									ng-model="dashboard.admin"\n									type="checkbox"\n									switch-active="{{ radioSwitch.isActive }}"\n									switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n									switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n									switch-on-color="{{ radioSwitch.onColor }}"\n									switch-off-color="{{ radioSwitch.offColor }}"\n									switch-animate="{{ radioSwitch.animate }}"\n									switch-size="{{ radioSwitch.size }}"\n									switch-label="{{ radioSwitch.label }}"\n									switch-icon="{{ radioSwitch.icon }}"\n									switch-radio-off="{{ radioSwitch.radioOff }}"\n									switch-label-width="{{ radioSwitch.labelWidth }}"\n									switch-handle-width="{{ radioSwitch.handleWidth }}">\n							</div>\n							<!-- END VISIBLE TO ADMIN -->\n\n							<!-- START VISIBLE TO USER -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_VISIBLE_TO_USER\' | translate}}</label><br>\n								<input\n									bs-switch\n									ng-model="dashboard.user"\n									type="checkbox"\n									switch-active="{{ radioSwitch.isActive }}"\n									switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n									switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n									switch-on-color="{{ radioSwitch.onColor }}"\n									switch-off-color="{{ radioSwitch.offColor }}"\n									switch-animate="{{ radioSwitch.animate }}"\n									switch-size="{{ radioSwitch.size }}"\n									switch-label="{{ radioSwitch.label }}"\n									switch-icon="{{ radioSwitch.icon }}"\n									switch-radio-off="{{ radioSwitch.radioOff }}"\n									switch-label-width="{{ radioSwitch.labelWidth }}"\n									switch-handle-width="{{ radioSwitch.handleWidth }}">\n							</div>\n							<!-- END VISIBLE TO USER -->\n\n							<!-- START VISIBLE TO AGENT -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_VISIBLE_TO_AGENT\' | translate}}</label><br>\n								<input\n									bs-switch\n									ng-model="dashboard.agent"\n									type="checkbox"\n									switch-active="{{ radioSwitch.isActive }}"\n									switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n									switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n									switch-on-color="{{ radioSwitch.onColor }}"\n									switch-off-color="{{ radioSwitch.offColor }}"\n									switch-animate="{{ radioSwitch.animate }}"\n									switch-size="{{ radioSwitch.size }}"\n									switch-label="{{ radioSwitch.label }}"\n									switch-icon="{{ radioSwitch.icon }}"\n									switch-radio-off="{{ radioSwitch.radioOff }}"\n									switch-label-width="{{ radioSwitch.labelWidth }}"\n									switch-handle-width="{{ radioSwitch.handleWidth }}">\n							</div>\n							<!-- END VISIBLE TO AGENT -->\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="dashboard.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/zendesk/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-handbag"></i>\n					<a href="/zendesk/list">{{ \'APPLICATION_ZENDESK\' | 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-handbag font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ZENDESK\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="accounts.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_ACCOUNT\' | translate }} <i class="fa fa-angle-down"></i>\n						</a>\n						<ul class="dropdown-menu pull-right">\n							<li>\n								<a href="/zendesk/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="getAccounts([\'name\',\'username\',\'remoteUri\',\'authType\',\'token\',\'password\'])" csv-header="[\'Name\', \'Username\', \'Remote Address\', \'Authentication Type\', \'Token\', \'Password\']" field-separator=";" filename="zendesk_accounts.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="displayedZdAccounts" st-pipe="initList" class="table table-striped table-bordered table-hover">\n					<div class="table-responsive">\n					  <thead>\n							<tr>\n								<th colspan="7">\n									<div class="row">\n										<div class="col-md-6">\n											<ui-select class="input-xsmall" ng-model="conf.accountsByPage" theme="bootstrap" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="accountByPage in accountsByPage | filter: $select.search">\n													<div ng-bind-html="accountByPage.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(account, checked)" checklist-model checklist-value="id"></th>\n						    <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n						    <th st-sort="username">{{ \'APPLICATION_EMAIL\' | translate }}</th>\n								<th st-sort="remoteUri">{{ \'APPLICATION_REMOTE_ADDRESS\' | translate }}</th>\n								<th>{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n								<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody>\n					    <tr data-ng-repeat="account in displayedZdAccounts" class="animate-repeat">\n								<td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="accounts.checked" checklist-value="account.id"></td>\n					      <td>{{account.name}}</td>\n					      <td>{{account.username}}</td>\n								<td>{{account.remoteUri}}</td>\n								<td>{{account.description}}</td>\n					      <td>\n					        <a class="btn default btn-xs blue-stripe" data-ng-href="/zendesk/view/{{account.id}}/account">\n										{{ \'APPLICATION_EDIT\' | translate }}\n					        </a>\n									<a class="btn default btn-xs green-stripe" data-ng-click="checkAccount(account.id)">\n										{{ \'APPLICATION_CHECK_CONNECTION\' | translate }}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(account.name,account.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="displayedZdAccounts.length">\n								<td colspan="7" style="text-align:center;">\n									<i>No account 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="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="remoteUri" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_REMOTE_ADDRESS\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td/>\n								<td/>\n						  </tr>\n					    <tr>\n					      <td colspan="7" class="text-center">\n									<div class="pagination" st-pagination st-items-by-page="conf.accountsByPage.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/zendesk/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_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_GENERALS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\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.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n\n              <!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.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="account.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" 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="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.username" required/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" 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 REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remoteUri" required />\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" 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 AUTH TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.authType.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}</label>\n								<ui-select data-ng-model="account.authType" name="authType" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="type in [\'password\', \'token\'] | filter: $select.search">\n										<div data-ng-bind="type | capitalize | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.authType.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START AUTH TYPE -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}" ng-slide-down="account.authType == \'password\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" 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 TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.token.$invalid}" ng-slide-down="account.authType == \'token\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="token" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.token" required/>\n								<span data-ng-show="forms.formSetting.token.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/zendesk/view/view.configuration.html",'<div class="row" data-ng-init="initConfiguration()">\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_CONFIGURATION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createConfiguration()">\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(formsConfiguration.info.$valid)">\n							<form name="formsConfiguration.info" novalidate>\n								<!-- START NAME -->\n								<div class="form-group" data-ng-class="{\'has-error\': formsConfiguration.info.$submitted && formsConfiguration.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="configuration.name" required/>\n									<span data-ng-show="formsConfiguration.info.name.$invalid && formsConfiguration.info.$submitted" 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="configuration.description"/>\n								</div>\n								<!-- END DESCRIPTION -->\n\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-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/zendesk/view/view.configurationSettings.html",'<div class="row" data-ng-init="getConfiguration();getVariables();getFields();">\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_CONFIGURATION\' | translate}}: {{configurationName}}</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_SUBJECT\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_DESCRIPTION\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_FIELDS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- SUBJECT TAB -->\n					<div class="tab-pane ui-padding active" id="tab_1_1">\n            <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by blank space:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemSubject()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="subjectItem in subjectConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="subjectItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(subjectItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="subjectItem.content" data-ng-change="updateField(subjectItem)">\n	                </div>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.VariableId" data-ng-change="updateField(subjectItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(subjectItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END SUBJECT TAB -->\n          <!-- DESCRIPTION TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_2">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by new line:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemDescription()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n							<div class="row" data-ng-repeat="descriptionItem in descriptionConfig">\n								<!-- <pre>\n									{{descriptionItem|json}}\n								</pre> -->\n	              <div class="col-md-2">\n	                <ui-select ng-model="descriptionItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n	                  <ui-select-choices repeat="item in descFieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-9" data-ng-if="descriptionItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="descriptionItem.content" data-ng-change="updateField(descriptionItem)">\n	                </div>\n	              </div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<input type="text" class="form-control" placeholder="Key" data-ng-model="descriptionItem.key" data-ng-change="updateField(descriptionItem)">\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<ui-select ng-model="descriptionItem.keyType" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'string\'">\n									<input type="text" class="form-control" placeholder="Value" data-ng-model="descriptionItem.keyContent" data-ng-change="updateField(descriptionItem)">\n								</div>\n	              <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.VariableId" data-ng-change="updateField(descriptionItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(descriptionItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END DESCRIPTION TAB -->\n          <!-- FIELDS TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_3">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">Add how to fill the fields present in your account:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemField()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="fieldItem in fieldConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="fieldItem.idField" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeFieldType(fieldItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                  <ui-select-choices repeat="item.id as item in accountFields | filter: $select.search">\n	                    <div ng-bind-html="item.title | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="getSystemFieldOptions(fieldItem.idField)">\n	                <div class="form-group">\n										<ui-select ng-model="fieldItem.content" theme="bootstrap" ng-disabled="disabled" data-ng-change="updateField(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n		                  <ui-select-choices repeat="item.value as item in getSystemFieldOptions(fieldItem.idField) | filter: $select.search">\n		                    <div ng-bind-html="item.name | highlight: $select.search"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField)">\n									<div class="form-group">\n										<ui-select ng-model="fieldItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n		                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n		                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n									</div>\n								</div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'string\'">\n	                <div class="form-group">\n										<input type="text" class="form-control" data-ng-model="fieldItem.content" data-ng-change="updateField(fieldItem)">\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'variable\'">\n	                <div class="form-group">\n										<ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.VariableId" data-ng-change="updateField(fieldItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(fieldItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END FIELDS TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/zendesk/view/view.configurations.html",'<div ui-view class="profile-content">\n	<div class="row" data-ng-init="getConfigurations()">\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_CONFIGURATIONS\' | translate}}</span>\n					</div>\n					<div class="actions">\n						<div class="btn-group">\n							<a class="btn green-jungle " href="/zendesk/view/{{account.id}}/configuration" data-toggle="dropdown">\n								<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}\n							</a>\n						</div>\n					</div>\n				</div>\n				<div class="portlet-body">\n					<!-- START TABLE -->\n					<table class="table table-striped table-bordered table-hover">\n						  <thead>\n							  <tr>\n							    <th>{{\'APPLICATION_NAME\' | translate}}</th>\n									<th>{{\'APPLICATION_DESCRIPTION\' | translate}}</th>\n									<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n							  </tr>\n						  </thead>\n							<tbody>\n						    <tr data-ng-repeat="configuration in configurations">\n									<td>{{configuration.name}}</td>\n									<td>{{configuration.description}}</td>\n						      <td>\n										<a class="btn default btn-xs blue-stripe" data-ng-href="/zendesk/view/{{account.id}}/configurations/settings/{{configuration.id}}">\n											{{ \'APPLICATION_SETTINGS\' | translate}}\n						        </a>\n						        <a class="btn default btn-xs red-stripe" data-ng-click="deleteConfiguration(configuration.name,configuration.id)">\n											{{ \'APPLICATION_DELETE\' | translate }}\n						        </a>\n						      </td>\n						    </tr>\n								<tr data-ng-hide="configurations.length">\n									<td colspan="5" style="text-align:center;">\n										<i>No configuration available</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/zendesk/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-handbag"></i>\n          <a href="/zendesk/list">{{ \'APPLICATION_ZENDESK\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{account.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 src="assets/images/media/zendesk.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						{{account.name}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{account.remoteUri}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.zendesk.view.account\')}">\n							<a ng-href="/zendesk/view/{{account.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.zendesk.view.configurations\') || $state.is(\'main.zendesk.view.configuration\')}">\n							<a ng-href="/zendesk/view/{{account.id}}/configurations">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_CONFIGURATIONS\' | 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/zendesk/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-handbag"></i>\n						<a href="/zendesk/list">{{ \'APPLICATION_ZENDESK\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\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_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.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.formSetting.name.$invalid && forms.formSetting.$submitted" 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              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.username" required ng-remote-validate="/api/zendesk/accounts/validate/username"/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.username.$touched || forms.formSetting.$submitted) && forms.formSetting.username.$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 REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remoteUri" required ng-remote-validate="/api/zendesk/accounts/validate/remoteUri"/>\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.remoteUri.$touched || forms.formSetting.$submitted) && forms.formSetting.remoteUri.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_DOMAIN\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START AUTH TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.authType.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}</label>\n								<ui-select data-ng-model="item.authType" name="authType" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="type in [\'password\', \'token\'] | filter: $select.search">\n										<div data-ng-bind="type | capitalize | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.authType.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START AUTH TYPE -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}" ng-slide-down="item.authType == \'password\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" 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 TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.token.$invalid}" ng-slide-down="item.authType == \'token\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="token" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.token" required/>\n								<span data-ng-show="forms.formSetting.token.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\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\n				</wizard>\n\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
-a.put("components/footer/footer.html",'<!-- BEGIN FOOTER -->\n<div class="page-footer">\n  <div class="page-footer-inner">\n     2015 &copy; xCALLY MOTION by Xenialab srl.\n  </div>\n  <div class="scroll-to-top">\n    <i class="icon-arrow-up"></i>\n  </div>\n</div>\n<!-- END FOOTER -->\n'),a.put("components/header/header.html",'<!-- BEGIN HEADER INNER -->\n<div class="page-header-inner" data-ng-init="initHeader()">\n  <!-- BEGIN LOGO -->\n  <div class="page-logo">\n    <a href="/">\n    <img src="assets/images/logo.png" alt="logo" class="logo-default"/>\n    </a>\n    <div class="menu-toggler sidebar-toggler">\n      <!-- DOC: Remove the above "hide" to enable the sidebar toggler button on header -->\n    </div>\n  </div>\n  <!-- END LOGO -->\n  <!-- BEGIN HEADER SEARCH BOX -->\n  <!-- DOC: Apply "search-form-expanded" right after the "search-form" class to have half expanded search box -->\n  <form class="search-form hide" action="extra_search.html" method="GET">\n    <div class="input-group">\n      <input type="text" class="form-control" placeholder="Search..." name="query">\n      <span class="input-group-btn">\n      <a href="javascript:;" class="btn submit"><i class="icon-magnifier"></i></a>\n      </span>\n    </div>\n  </form>\n  <!-- END HEADER SEARCH BOX -->\n  <!-- BEGIN RESPONSIVE MENU TOGGLER -->\n  <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">\n  </a>\n  <!-- END RESPONSIVE MENU TOGGLER -->\n  <!-- BEGIN TOP NAVIGATION MENU -->\n  <div class="top-menu">\n    <ul class="nav navbar-nav pull-right">\n      <!-- BEGIN LANGUAGE BAR -->\n      <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->\n      <li class="dropdown dropdown-language">\n        <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">\n        <img ng-src="assets/images/flags/{{ language }}.png">\n        <i class="fa fa-angle-down"></i>\n        </a>\n        <ul class="dropdown-menu dropdown-menu-default">\n          <li>\n            <a href="#" ng-click="changeLanguage(\'it\')">\n            <img alt="" src="assets/images/flags/it.png"> Italian </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'en_EN\')">\n            <img alt="" src="assets/images/flags/en_EN.png"> English </a>\n          </li>\n        </ul>\n      </li>\n      <!-- END LANGUAGE BAR -->\n      <!-- BEGIN USER LOGIN DROPDOWN -->\n      <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->\n      <li class="dropdown dropdown-user">\n        <a href="#" class="dropdown-toggle" dropdown-menu-hover data-toggle="dropdown" data-close-others="true">\n        <img class="img-circle" data-ng-src="api/users/avatar/{{getCurrentUser().userpic || \'unknown_avatar\'}}" alt="...">\n        <span class="username username-hide-on-mobile">\n          {{ getCurrentUser().fullname }} </span>\n        <i class="fa fa-angle-down"></i>\n        </a>\n        <ul class="dropdown-menu dropdown-menu-default">\n          <li>\n            <a ng-href=" {{isAdmin() ? \'/users/view/\'+getCurrentUser().id+\'/account\' : \'/agents/view/\'+getCurrentUser().id+\'/account\'}}">\n            <i class="icon-key"></i>Change password</a>\n          </li>\n          <!-- <li>\n            <a href="#">\n            <i class="icon-calendar"></i> My Calendar </a>\n          </li> -->\n          <!-- <li>\n            <a href="#">\n            <i class="icon-envelope-open"></i> My Inbox <span class="badge badge-danger">\n            3 </span>\n            </a>\n          </li> -->\n          <!-- <li>\n            <a href="#/todo">\n            <i class="icon-rocket"></i> My Tasks <span class="badge badge-success">\n            7 </span>\n            </a>\n          </li> -->\n          <!-- <li class="divider">\n          </li> -->\n          <!-- <li>\n            <a href="#">\n            <i class="icon-lock"></i> Lock Screen </a>\n          </li> -->\n          <li data-ng-click="logout()">\n            <a href="#">\n            <i class="icon-logout"></i> Log Out </a>\n          </li>\n        </ul>\n      </li>\n      <!-- END USER LOGIN DROPDOWN -->\n      <!-- BEGIN QUICK SIDEBAR TOGGLER -->\n      <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->\n      <li class="dropdown dropdown-quick-sidebar-toggler" data-ng-click="toggleQuickSidebar()">\n        <a href="#" class="dropdown-toggle">\n        <i class="icon-logout"></i>\n        </a>\n      </li>\n      <!-- END QUICK SIDEBAR TOGGLER -->\n    </ul>\n  </div>\n  <!-- END TOP NAVIGATION MENU -->\n</div>\n<!-- END HEADER INNER -->\n'),a.put("components/modal/delete.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</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("components/quickSidebar/modal/add.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</button>\n  <h4 ng-if="modal.title" ng-bind="modal.title | translate" class="modal-title"></h4>\n</div>\n\n<div class="modal-body">\n  <div class="portlet box blue">\n		<div class="portlet-title">\n			<div class="caption">\n				<i class="icon-people"></i>{{\'APPLICATION_SELECTED_AGENTS\' | translate}}\n			</div>\n		</div>\n		<div class="portlet-body">\n			<ul>\n				<li data-ng-repeat="item in items">\n					 {{item.fullname}}\n				</li>\n\n        <li data-ng-repeat="item in selected.items">\n					 {{item.fullname}}\n				</li>\n			</ul>\n		</div>\n	</div>\n\n  <ui-select multiple name="items" ng-model="selected.items" theme="bootstrap">\n    <ui-select-match placeholder="{{\'APPLICATION_SELECTED_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n    <ui-select-choices repeat="{id: agent.id, fullname: agent.fullname} as agent in agents.rows | filter: $select.search">\n      {{agent.fullname}}\n    </ui-select-choices>\n  </ui-select>\n</div>\n\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="selected.items.length">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("components/quickSidebar/modal/close.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</button>\n  <h4 ng-if="modal.title" ng-bind="modal.title | translate" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n  <p ng-if="modal.text" ng-bind="modal.text | translate"></p>\n  <!-- <div ng-if="modal.html" ng-bind-html="modal.html"></div> -->\n</div>\n<div class="modal-footer">\n  <button class="btn btn-danger" type="button" ng-click="ok()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\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("components/quickSidebar/quickSidebar.html",'<div class="page-quick-sidebar">\n  <div class="nav-justified">\n    <ul class="nav nav-tabs nav-justified">\n      <li data-ng-class="{active:currentTab==0}" data-ng-click="goToTab(0)">\n        <a href="#">\n          <!-- <i class="icon-people"></i> <span class="badge badge-danger">2</span> -->\n          <i class="icon-people"></i>\n        </a>\n      </li>\n      <li data-ng-class="{active:currentTab==1}" data-ng-click="goToTab(1)">\n        <a href="#">\n          <!-- <i class="icon-eye"></i> <span class="badge badge-success">7</span> -->\n        <i class="icon-eye"></i>\n        </a>\n      </li>\n      <li data-ng-class="{active:currentTab==2}" data-ng-click="goToTab(2)">\n        <a href="#">\n          <!-- <i class="icon-globe"></i> <span class="badge badge-success">7</span> -->\n        <i class="icon-globe"></i>\n        </a>\n      </li>\n      <li data-ng-class="{active:currentTab==3}" data-ng-click="goToTab(3)">\n        <a href="#">\n          <!-- <i class="icon-bubbles"></i> <span class="badge badge-success">7</span> -->\n        <i class="icon-bubbles"></i>\n        </a>\n      </li>\n    </ul>\n    <div class="tab-content">\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==0 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list" >\n          <div class="quicksidebar-search">\n            <div class="input-group">\n							<input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_AGENT\' | translate}}..." ng-model="searchAgent">\n							<span class="input-group-btn">\n							<i class="icon-magnifier"></i>\n							</span>\n						</div>\n          </div>\n          <ul class="media-list list-items" data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="agent in agents.rows | orderBy:\'-online\' | filter:searchAgent as resultsAgent" data-ng-if="agent.id !== currentUser.id">\n              <div class="media-status">\n                <!-- <span class="badge badge-success">8</span> -->\n              </div>\n              <img class="media-object" data-ng-src="api/users/avatar/{{agent.userpic ? agent.userpic : \'unknown_avatar\'}}" alt="{{agent.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(agent.id)">\n                <h4 class="media-heading"><span class="item-status">{{agent.fullname | characters:15 :true}} {{agent.internal}}</h4>\n                <div class="media-heading-small">\n                   <span class="badge badge-empty" data-ng-class="agent.online ? \'badge-success\' : \'badge-danger\'"></span></span> {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{agent.updatedAt}}">April 1, 2014</time>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="agents.rows.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_AGENTS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="resultsAgent.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_AGENTS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==1 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list">\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_USER\' | translate}}..." ng-model="searchUser">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n          <ul class="media-list list-items"  data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="user in users.rows | orderBy:\'-online\' | filter:searchUser as resultsUser" data-ng-if="user.id !== currentUser.id">\n              <div class="media-status">\n                <!-- <span class="badge badge-success">3</span> -->\n              </div>\n              <img class="media-object" data-ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" alt="{{user.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(user.id)">\n                <h4 class="media-heading">{{user.fullname | characters:15 :true}} {{user.internal}}</h4>\n                <div class="media-heading-small">\n                   <span class="badge badge-empty" data-ng-class="user.online ? \'badge-success\' : \'badge-danger\'"></span> {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{user.updatedAt}}">April 1, 2014</time>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="users.rows.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_USERS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="resultsUser.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_USERS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==2 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list">\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_USER\' | translate}}..." ng-model="searchChatRoomsExternals">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n          <ul class="media-list list-items"  data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="chatRoom in chatRooms | filter:{type:\'external\'} | filter:searchChatRoomsExternals as resultsChatRoomsExternals">\n              <div class="media-status">\n                <!-- <span class="badge badge-success">3</span> -->\n              </div>\n              <img class="media-object" data-ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" alt="{{user.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(null, chatRoom.id)">\n                <h4 class="media-heading">{{chatRoom.ChatVisitor.email}}</h4>\n                <div class="media-heading-small">\n                   {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{chatRoom.createdAt}}">April 1, 2014</time>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" data-ng-if="resultsChatRoomsExternals.length === 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_CHATS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==3 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list">\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_USER\' | translate}}..." ng-model="searchChatRoomsGroups">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n          <ul class="media-list list-items"  data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="chatRoom in chatRooms | filter:chatRoomsGroupsGreaterThan(2) | filter:searchChatRoomsGroups as resultsChatRoomsGroups">\n              <div class="media-status">\n                <!-- <span class="badge badge-success">3</span> -->\n              </div>\n              <img class="media-object" data-ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" alt="{{user.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(null, chatRoom.id)">\n                <h4 class="media-heading">{{chatRoom.name}}</h4>\n                <div class="media-heading-small">\n                   {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{chatRoom.updatedAt}}">April 1, 2014</time>\n                </div>\n                <div class="media-heading-small">\n                  <div data-ng-repeat="user in chatRoom.Users | map: \'fullname\'" class="inline">\n                    {{ $last ? user : user + \', \'}}\n                  </div>\n                </div>\n              </div>\n            </li>\n            <!-- <li class="media animate-repeat" ng-if="chatRooms.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_CHAT_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li> -->\n            <li class="media animate-repeat" data-ng-if="resultsChatRoomsGroups.length === 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_CHATS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat page-quick-sidebar-content-item-shown" ng-class="{active:messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list" >\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_MESSAGE\' | translate}}..." ng-model="searchMessage">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n        </div>\n        <div class="page-quick-sidebar-item">\n          <div class="page-quick-sidebar-chat-user" data-wrapper-class="page-quick-sidebar-list">\n            <div class="page-quick-sidebar-nav">\n                <a href="#" class="page-quick-sidebar-back-to-list" data-ng-click="goBack()"><i class="icon-arrow-left"></i>Back</a>\n            </div>\n            <div id="page-quick-sidebar-chat-user-messages" class="page-quick-sidebar-chat-user-messages" data-ng-style="style2" ng-scrollbars>\n              <div class="post animate-repea" data-ng-repeat="chatMessage in chatRoom.ChatMessages | filter:searchMessage as resultsMessage" data-ng-class="chatMessage.UserId === currentUser.id ? \'in\' : \'out\'">\n                <img class="avatar" alt="" ng-src="api/users/avatar/unknown_avatar"/>\n                <div class="message">\n                  <span class="arrow"></span>\n                  <a href="#" class="name">{{chatMessage.User.fullname || chatMessage.ChatVisitor .fullname}}</a> -\n                  <span class="datetime">\n                    <time is="relative-time" datetime="{{chatMessage.createdAt}}">\n                      April 1, 2014\n                    </time>\n                  </span>\n                  <ng-emoticons class="body" emoticons-data="chatMessage.body" emoticons-options="options"/>\n                  <!-- <div class="body" ng-bind-html="chatMessage.body"></div>\n                  <!-- <div ng-bind-html="chatMessage.body | emoticons:{\'linkTarget\':\'_blank\',\'newLine\':true}" class="ng-emoticons"></div> --> -->\n                </div>\n              </div>\n\n              <div class="media-body" style="text-align: center;" data-ng-if="resultsMessage.length == 0">\n                <h5 class="media-heading"><i>{{\'MESSAGE_NO_MESSAGES_FOUND\' | translate | lowercase}}</i></h5>\n              </div>\n\n              <div class="media-body" style="text-align: center;" data-ng-if="chatRoom.status === \'close\'">\n                <h5 class="media-heading"><i>{{\'MESSAGE_CHAT_CLOSED\' | translate | lowercase}}</i></h5>\n              </div>\n\n            </div>\n            <div class="page-quick-sidebar-chat-user-form">\n              <textarea rows="3" class="form-control" style="border:none;resize: none;" placeholder="Type a message here..." ng-enter="sendMessage()" data-ng-model="message.body" data-ng-disabled="chatRoom.status === \'close\'"></textarea>\n              <div class="btn-group" style="width:100%;background-color:white">\n                <button type="button" class="btn btn-default" style="border:none" data-ng-disabled="chatRoom.status === \'close\'" data-ng-click="addAgent(chatRoom.id)"><i class="icon-plus font-blue"></i></button>\n                <button type="button" class="btn btn-default pull-right" style="border:none" data-ng-disabled="chatRoom.status === \'close\'" data-ng-click="closeChatRoom(chatRoom.id)" data-ng-show="chatRoom.type === \'external\'"><i class="icon-close font-red"></i></button>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n'),a.put("components/sidebar/sidebar.html",'<div id="page-sidebar" class="page-sidebar navbar-collapse collapse">\n  <!-- BEGIN SIDEBAR MENU -->\n  <!-- DOC: Apply "page-sidebar-menu-light" class right after "page-sidebar-menu" to enable light sidebar menu style(without borders) -->\n  <!-- DOC: Apply "page-sidebar-menu-hover-submenu" class right after "page-sidebar-menu" to enable hoverable(hover vs accordion) sub menu mode -->\n  <!-- DOC: Apply "page-sidebar-menu-closed" class right after "page-sidebar-menu" to collapse("page-sidebar-closed" class must be applied to the body element) the sidebar sub menu mode -->\n  <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->\n  <!-- DOC: Set data-keep-expand="true" to keep the submenues expanded -->\n  <!-- DOC: Set data-auto-speed="200" to adjust the sub menu slide up/down speed -->\n  <ul data-ng-click="mainTab.active=true" class="page-sidebar-menu" data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" data-ng-class="{\'page-sidebar-menu-closed\': settings.layout.pageSidebarClosed}">\n    <!-- DOC: To remove the search box from the sidebar you just need to completely remove the below "sidebar-search-wrapper" LI element -->\n    <li class="sidebar-search-wrapper">\n      <!-- BEGIN RESPONSIVE QUICK SEARCH FORM -->\n      <!-- DOC: Apply "sidebar-search-bordered" class the below search form to have bordered search box -->\n      <!-- DOC: Apply "sidebar-search-bordered sidebar-search-solid" class the below search form to have bordered & solid search box -->\n      <form class="sidebar-search sidebar-search-bordered" action="extra_search.html" method="POST">\n        <a href="javascript:;" class="remove">\n        <i class="icon-close"></i>\n        </a>\n        <!-- <div class="input-group">\n          <input type="text" class="form-control" placeholder="Search...">\n          <span class="input-group-btn">\n          <a href="javascript:;" class="btn submit"><i class="icon-magnifier"></i></a>\n          </span>\n        </div> -->\n      </form>\n      <!-- END RESPONSIVE QUICK SEARCH FORM -->\n    </li>\n\n    <!-- START DASHBOARD CASE -->\n    <li class="start" data-ng-show="isAssociated(\'dashboard\')" data-ng-class="{active: $state.is(\'main.dashboard\')}">\n      <a href="/dashboard/voice">\n        <i class="icon-rocket"></i>\n        <span class="title">{{\'APPLICATION_DASHBOARD\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.dashboard\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END DASHBOARD CASE -->\n\n    <!-- START YOURDASHBOARD LIST CASE -->\n    <li data-ng-class="{active: $state.is(\'main.yourdashboards.show\')}" data-ng-show="Auth.isAdmin()">\n      <a href="javascript:;">\n        <i class="icon-screen-desktop"></i>\n        <span class="title" >{{\'APPLICATION_YOUR_DASHBOARDS\' | translate}}</span>\n        <span class="arrow" data-ng-class="{ open: $state.includes(\'main.yourdashboards.show\') }"></span>\n      </a>\n      <ul class="sub-menu" data-ng-init="getSidebarDashboards()">\n        <li data-ng-class="{active: $stateParams.id == dashboard.id && $state.includes(\'main.yourdashboards.show\')}" data-ng-repeat="dashboard in dashboards" data-ng-show="dashboard[Auth.getRole()] && dashboard.visible">\n          <a href="/yourdashboards/show/{{dashboard.id}}" >\n          <i class="icon-screen-tablet"></i>\n          <span class="title" >{{dashboard.name}}  </span>\n          </a>\n        </li>\n       </ul>\n    </li>\n    <!-- END YOURDASHBOARD LIST CASE -->\n\n    <!-- START STAFF SEPARATOR -->\n    <li class="heading" data-ng-show="Auth.isAdmin()">\n      <h3 class="uppercase"> <span >{{\'APPLICATION_STAFF\' | translate}}  </span> </h3>\n    </li>\n    <!-- END STAFF SEPARATOR -->\n\n    <!-- START USERS CASE -->\n    <!-- <li data-ng-show="isAssociated(\'users\')" data-ng-class="{active: $state.includes(\'main.users\')}"> -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.users\')}">\n      <a href="/users/list">\n        <i class="icon-eye"></i>\n        <span class="title" >{{\'APPLICATION_USERS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.users\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END USERS CASE -->\n\n    <!-- START AGENTS CASE -->\n    <!-- <li data-ng-show="isAssociated(\'agents\')" data-ng-class="{active: $state.includes(\'main.agents\')}"> -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.agents\')}">\n      <a href="/agents/list">\n        <i class="icon-people"></i>\n        <span class="title" >{{\'APPLICATION_AGENTS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.agents\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END AGENTS CASE -->\n\n    <!-- START TEAMS CASE -->\n    <li data-ng-show="isAssociated(\'teams\')" data-ng-class="{active: $state.includes(\'main.teams\')}">\n      <a href="/teams/list">\n        <i class="icon-shield"></i>\n        <span class="title" >{{\'APPLICATION_TEAMS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.teams\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END TEAMS CASE -->\n    <!-- END STAFF SEPARATOR -->\n\n    <!-- START CONTACT_MANAGER SEPARATOR -->\n    <li class="heading" data-ng-show="Auth.isAdmin()">\n      <h3 class="uppercase"> <span >{{\'APPLICATION_CONTACT_MANAGER\' | translate}}  </span> </h3>\n    </li>\n    <!-- END CONTACT_MANAGER SEPARATOR -->\n\n    <!-- START CONTACT_MANAGER CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.contactmanager\')}">\n      <a href="/contactmanager/list">\n        <i class=" fa fa-users"></i>\n        <span class="title" >{{\'APPLICATION_CONTACT_MANAGER\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.contactmanager\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END CONTACT_MANAGER CASE -->\n    <!-- END CONTACT_MANAGER SEPARATOR -->\n\n    <!-- START CHANNELS SEPARATOR -->\n    <li class="heading">\n      <h3 class="uppercase"> <span >{{\'APPLICATION_CHANNELS\' | translate}}  </span> </h3>\n    </li>\n\n    <!-- START icon-link CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{ active: $state.includes(\'main.voice\') }">\n      <a href="javascript:;">\n        <i class="icon-earphones-alt"></i>\n        <span class="title">{{ \'APPLICATION_VOICE\' | translate}}</span>\n        <span class="arrow" data-ng-class="{ open: $state.includes(\'main.voice\') }"></span>\n      </a>\n\n      <ul class="sub-menu">\n        <li data-ng-class="{active: $state.includes(\'main.voice.queues\')}">\n          <a href="/voice/queues/list">\n          <i class="icon-docs"></i>\n          <span class="title">{{\'APPLICATION_QUEUES\' | translate}}</span>\n          </a>\n        </li>\n        <li>\n          <a href="javascript:;">\n          <i class="icon-directions"></i>\n          <span class="title"> {{ \'APPLICATION_ROUTES\' | translate}} </span>\n          <span class="arrow" data-ng-class="{ open: $state.includes(\'main.voice.routes\') }"></span>\n          <ul class="sub-menu">\n            <li data-ng-class="{active: $state.includes(\'main.voice.routes.inbound\')}">\n              <a href="/voice/routes/inbound/list">\n              <i class="icon-call-in"></i>\n              <span class="title"> {{\'APPLICATION_INBOUND\' | translate}} </span>\n              </a>\n            </li>\n            <li data-ng-class="{active: $state.includes(\'main.voice.routes.outbound\')}">\n              <a href="/voice/routes/outbound/list">\n              <i class="icon-call-out"></i>\n              <span class="title"> {{\'APPLICATION_OUTBOUND\' | translate}} </span>\n              </a>\n            </li>\n            <li data-ng-class="{active: $state.includes(\'main.voice.routes.internal\')}">\n              <a href="/voice/routes/internal/list">\n              <i class="icon-reload"></i>\n              <span class="title"> {{\'APPLICATION_INTERNALS\' | translate}} </span>\n              </a>\n            </li>\n          </ul>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.voice.contexts\')}">\n          <a href="/voice/contexts/list">\n          <i class="icon-docs"></i>\n          <span class="title"> {{\'APPLICATION_CONTEXTS\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.voice.voicemails\')}">\n          <a href="/voice/voicemails/list">\n          <i class="icon-envelope-letter"></i>\n          <span class="title"> {{\'APPLICATION_VOICEMAILS\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.voice.mohs\')}">\n          <a href="/voice/mohs/list">\n          <i class="icon-music-tone"></i>\n          <span class="title"> {{\'APPLICATION_MOH\' | translate}} </span>\n          </a>\n        </li>\n        <!-- START REALTIME CASE -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.voice.realtime\')}">\n          <a href="/voice/realtime/view/agents">\n          <i class="icon-energy"></i>\n          <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n          </a>\n        </li>\n        <!-- END REALTIME CASE -->\n      </ul>\n    </li>\n    <!-- END icon-link CASE -->\n\n    <!-- START CHAT CASE -->\n    <li data-ng-show="isAssociated(\'chat\')" data-ng-class="{ active: $state.includes(\'main.chat\') }">\n      <a href="javascript:;">\n        <i class="icon-bubble"></i>\n        <span class="title">{{\'APPLICATION_CHAT\' | translate}}</span>\n        <span class="arrow" data-ng-class="{ open: $state.includes(\'main.chat\') }"></span>\n      </a>\n      <ul class="sub-menu">\n        <li data-ng-class="{active: $state.includes(\'main.chat.websites\')}">\n          <a href="/chat/websites/list">\n          <i class="icon-globe"></i>\n          <span class="title"> {{\'APPLICATION_WEB_SITES\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.chat.queues\')}">\n          <a href="/chat/queues/list">\n          <i class="icon-docs"></i>\n          <span class="title"> {{\'APPLICATION_QUEUES\' | translate}} </span>\n          </a>\n        </li>\n        <!-- START REALTIME CASE -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.chat.realtime\')}">\n          <a href="/chat/realtime/view/agents">\n          <i class="icon-energy"></i>\n          <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n          </a>\n        </li>\n        <!-- END REALTIME CASE -->\n      </ul>\n    </li>\n    <!-- END CHAT CASE -->\n\n    <!-- START MAIL CASE -->\n    <li data-ng-class="{ active: $state.includes(\'main.mail\') }">\n      <a href="javascript:;">\n        <i class="icon-envelope"></i>\n        <span class="title">{{\'APPLICATION_MAIL\' | translate}}</span>\n        <span class="arrow" data-ng-class="{ open: $state.includes(\'main.mail\') }"></span>\n      </a>\n\n      <ul class="sub-menu">\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.mail.accounts\') || $state.includes(\'main.mail.account\')}">\n          <a href="/mail/accounts/list">\n          <i class="icon-notebook"></i>\n          <span class="title"> {{\'APPLICATION_ACCOUNTS\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.mail.queues\') || $state.includes(\'main.mail.queue\')}">\n          <a href="/mail/queues/list">\n          <i class="icon-docs"></i>\n          <span class="title"> {{\'APPLICATION_QUEUES\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.mail.inbox\')}">\n          <a href="/mail/inbox/incoming">\n          <i class="icon-note"></i>\n          <span class="title"> {{\'APPLICATION_INBOX\' | translate}} </span>\n          </a>\n        </li>\n        <!-- <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.mail.statistics\')}">\n          <a href="/mail/statistics/summary">\n          <i class="icon-eyeglass"></i>\n          <span class="title"> {{\'APPLICATION_STATISTICS\' | translate}} </span>\n          </a>\n        </li> -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.mail.templates\')}">\n          <a href="/mail/templates/list">\n          <i class="icon-docs"></i>\n          <span class="title"> {{\'APPLICATION_TEMPLATES\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.mail.timeline\')}">\n          <a href="/mail/timeline/list">\n          <i class="icon-list"></i>\n          <span class="title"> {{\'APPLICATION_TIMELINE\' | translate}} </span>\n          </a>\n        </li>\n        <!-- START REALTIME CASE -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.mail.realtime\')}">\n          <a href="/mail/realtime/view/agents">\n          <i class="icon-energy"></i>\n          <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n          </a>\n        </li>\n        <!-- END REALTIME CASE -->\n      </ul>\n    </li>\n    <!-- END MAIL CASE -->\n\n    <!-- START FAX CASE -->\n    <li data-ng-class="{active: $state.includes(\'main.fax\')}">\n    <!-- <li data-ng-show="license.fax" data-ng-class="{active: $state.includes(\'main.fax\')}"> -->\n      <a href="javascript:;">\n        <i class="icon-paper-plane"></i>\n        <span class="title"> {{ \'APPLICATION_FAX\' | translate}}</span>\n        <span class="arrow" data-ng-class="{ open: $state.includes(\'main.fax\') }"></span>\n      </a>\n\n      <ul class="sub-menu">\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.fax.accounts\')}">\n          <a href="/fax/accounts/list">\n          <i class="icon-notebook"></i>\n          <span class="title"> {{ \'APPLICATION_ACCOUNTS\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.fax.queues\')}">\n          <a href="/fax/queues/list">\n          <i class="icon-docs"></i>\n          <span class="title"> {{ \'APPLICATION_QUEUES\' | translate }} </span>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.fax.inbox\')}">\n          <a href="/fax/inbox/incoming">\n          <i class="icon-note"></i>\n          <span class="title"> {{ \'APPLICATION_INBOX\' | translate }} </span>\n          </a>\n        </li>\n        <!-- <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.fax.statistics\')}">\n          <a href="/fax/statistics/summary">\n          <i class="icon-eyeglass"></i>\n          <span class="title"> {{ \'APPLICATION_STATISTICS\' | translate }} </span>\n          </a>\n        </li> -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.fax.automations\')}">\n          <a href="/fax/automations/list">\n          <i class="icon-settings"></i>\n          <span class="title"> {{\'APPLICATION_AUTOMATIONS\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.fax.timeline\')}">\n          <a href="/fax/timeline/list">\n          <i class="icon-list"></i>\n          <span class="title"> {{\'APPLICATION_TIMELINE\' | translate}} </span>\n          </a>\n        </li>\n      </ul>\n    </li>\n    <!-- END FAX CASE -->\n    <!-- END CHANNELS SEPARATOR -->\n\n    <!-- START INTEGRATIONS SEPARATOR -->\n    <li data-ng-show="Auth.isAdmin()" class="heading">\n      <h3 class="uppercase"> <span translate> APPLICATION_INTEGRATIONS </span> </h3>\n    </li>\n    <!-- START INTEGRATION CASE -->\n    <!--\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.is(\'main.market\')}">\n      <a href="/market">\n        <i class="icon-handbag"></i>\n        <span class="title" translate>Market Place</span>\n        <span data-ng-show="$state.includes(\'main.market\')" class="selected"></span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.is(\'main.integrations.list\')}">\n      <a href="/integrations/list">\n        <i class="icon-game-controller"></i>\n        <span class="title" translate>Test Your App</span>\n        <span data-ng-show="$state.includes(\'main.integrations.list\')" class="selected"></span>\n      </a>\n    </li>\n    -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.zendesk\')}">\n      <a href="/zendesk/list">\n        <i class="icon-handbag"></i>\n        <span class="title" >{{\'APPLICATION_ZENDESK\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.zendesk\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END INTEGRATIONS SEPARATOR -->\n\n    <!-- START TOOLS SEPARATOR -->\n    <li data-ng-show="Auth.isAdmin()" class="heading">\n      <h3 class="uppercase"> <span >{{\'APPLICATION_TOOLS\' | translate}}  </span> </h3>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.triggers\')}">\n      <a href="/triggers/list">\n      <i class="icon-bulb"></i>\n      <span class="title"> {{\'APPLICATION_TRIGGERS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.automations\')}">\n      <a href="/automations/list">\n      <i class="icon-settings"></i>\n      <span class="title"> {{\'APPLICATION_AUTOMATIONS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.trunks\')}">\n      <a href="/trunks/list">\n      <i class="icon-link"></i>\n      <span class="title"> {{\'APPLICATION_TRUNKS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.intervals\')}">\n      <a href="/intervals/list">\n      <i class="icon-clock"></i>\n      <span class="title"> {{\'APPLICATION_INTERVALS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.variables\')}">\n      <a href="/variables/list">\n      <i class="fa fa-eye"></i>\n      <span class="title" >{{\'APPLICATION_VARIABLES\' | translate}}  </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tags\')}">\n      <a href="/tags/list">\n      <i class="icon-tag"></i>\n      <span class="title" >{{\'APPLICATION_TAGS\' | translate}}  </span>\n      </a>\n    </li>\n    <!-- START CALLYSQUARE CASE -->\n    <!-- <li data-ng-show="isAssociated(\'callysquare\')" data-ng-class="{active: $state.includes(\'main.square\')}"> -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.square\')}">\n      <a href="javascript:;">\n        <i class="fa fa-superscript"></i>\n        <span class="title" >{{\'APPLICATION_CALLYSQUARE\' | translate}}</span>\n        <span class="arrow"></span>\n      </a>\n      <ul class="sub-menu">\n        <li data-ng-class="{active: $state.includes(\'main.square.projects\')}">\n          <a href="/square/projects/list">\n          <i class="fa fa-slack"></i>\n          <span class="title" >{{\'APPLICATION_PROJECTS\' | translate}}  </span>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.square.odbc\')}">\n          <a href="/square/odbcs/list">\n          <i class="fa fa-database"></i>\n          <span class="title" >{{\'APPLICATION_ODBC\' | translate}}  </span>\n          </a>\n        </li>\n       </ul>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.yourdashboards.list\') || $state.includes(\'main.yourdashboards.settings\')}">\n      <a href="/yourdashboards/list">\n      <i class="icon-grid"></i>\n      <span class="title"> {{\'APPLICATION_DASHBOARDS_MANAGER\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END CALLYSQUARE CASE -->\n\n    <!-- START AUTODIALER CASE -->\n    <!-- <li data-ng-show="Auth.isAdmin()">\n      <a href="javascript:;">\n        <i class="icon-call-out"></i>\n        <span class="title">AutoDialer</span>\n        <span class="arrow"></span>\n      </a>\n      <ul class="sub-menu">\n      </ul>\n    </li> -->\n    <!-- END AUTODIALER CASE -->\n\n    <!-- START ANALYTICS CASE -->\n    <!-- <li data-ng-show="isAssociated(\'analytics\')"> -->\n    <!-- <li data-ng-show="Auth.isAdmin()">\n      <a href="#/analytics">\n        <i class="icon-graph"></i>\n        <span class="title" >{{\'APPLICATION_ANALYTICS\' | translate}}</span>\n      </a>\n    </li> -->\n    <!-- END ANALYTICS CASE -->\n\n    <!-- END TOOLS SEPARATOR -->\n\n    <!-- START AUDIO SEPARATOR -->\n    <li data-ng-show="Auth.isAdmin()" class="heading">\n      <h3 class="uppercase"> <span >{{\'APPLICATION_AUDIO\' | translate}}  </span> </h3>\n    </li>\n    <!-- END AUDIO SEPARATOR -->\n\n    <!-- START AUDIO CASE -->\n    <!-- <li data-ng-show="isAssociated(\'audio\')" data-ng-class="{active: $state.is(\'main.sound\')}"> -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.sounds\')}">\n      <a href="/sounds/list">\n        <i class="icon-music-tone-alt"></i>\n        <span class="title" >{{\'APPLICATION_SOUNDS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.sounds\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END AUDIO CASE -->\n\n\n    <!-- START SETTINGS SEPARATOR -->\n    <li data-ng-show="Auth.isAdmin()" class="heading">\n      <h3 class="uppercase"> <span >{{\'APPLICATION_SETTINGS\' | translate}}  </span> </h3>\n    </li>\n    <!-- END SETTINGS SEPARATOR -->\n\n    <!-- START UPDATES CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.updates\')}">\n      <a href="/updates/list">\n        <i class="icon-cloud-download"></i>\n        <span class="title" >{{\'APPLICATION_UPDATES\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.updates\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END UPDATES CASE -->\n\n  </ul>\n  <!-- END SIDEBAR MENU -->\n</div>\n');
+a.put("components/footer/footer.html",'<!-- BEGIN FOOTER -->\n<div class="page-footer" data-ng-init="initFooter()">\n  <div class="page-footer-inner">\n     {{info.name}} v. {{info.version}} | 2015-2016 &copy; Powered by Xenialab\n  </div>\n  <div class="scroll-to-top">\n    <i class="icon-arrow-up"></i>\n  </div>\n</div>\n<!-- END FOOTER -->\n'),a.put("components/header/header.html",'<!-- BEGIN HEADER INNER -->\n<div class="page-header-inner" data-ng-init="initHeader()">\n  <!-- BEGIN LOGO -->\n  <div class="page-logo">\n    <a href="/">\n    <img src="assets/images/logo.png" alt="logo" class="logo-default"/>\n    </a>\n    <div class="menu-toggler sidebar-toggler">\n      <!-- DOC: Remove the above "hide" to enable the sidebar toggler button on header -->\n    </div>\n  </div>\n  <!-- END LOGO -->\n  <!-- BEGIN HEADER SEARCH BOX -->\n  <!-- DOC: Apply "search-form-expanded" right after the "search-form" class to have half expanded search box -->\n  <form class="search-form hide" action="extra_search.html" method="GET">\n    <div class="input-group">\n      <input type="text" class="form-control" placeholder="Search..." name="query">\n      <span class="input-group-btn">\n      <a href="javascript:;" class="btn submit"><i class="icon-magnifier"></i></a>\n      </span>\n    </div>\n  </form>\n  <!-- END HEADER SEARCH BOX -->\n  <!-- BEGIN RESPONSIVE MENU TOGGLER -->\n  <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">\n  </a>\n  <!-- END RESPONSIVE MENU TOGGLER -->\n  <!-- BEGIN TOP NAVIGATION MENU -->\n  <div class="top-menu">\n    <ul class="nav navbar-nav pull-right">\n      <!-- BEGIN LANGUAGE BAR -->\n      <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->\n      <li class="dropdown dropdown-language">\n        <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">\n        <img ng-src="assets/images/flags/{{ language }}.png">\n        <i class="fa fa-angle-down"></i>\n        </a>\n        <ul class="dropdown-menu dropdown-menu-default">\n          <li>\n            <a href="#" ng-click="changeLanguage(\'it\')">\n            <img alt="" src="assets/images/flags/it.png"> Italian </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'en_EN\')">\n            <img alt="" src="assets/images/flags/en_EN.png"> English </a>\n          </li>\n        </ul>\n      </li>\n      <!-- END LANGUAGE BAR -->\n      <!-- BEGIN USER LOGIN DROPDOWN -->\n      <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->\n      <li class="dropdown dropdown-user">\n        <a href="#" class="dropdown-toggle" dropdown-menu-hover data-toggle="dropdown" data-close-others="true">\n        <img class="img-circle" data-ng-src="api/users/avatar/{{getCurrentUser().userpic || \'unknown_avatar\'}}" alt="...">\n        <span class="username username-hide-on-mobile">\n          {{ getCurrentUser().fullname }} </span>\n        <i class="fa fa-angle-down"></i>\n        </a>\n        <ul class="dropdown-menu dropdown-menu-default">\n          <li>\n            <a ng-href=" {{isAdmin() ? \'/users/view/\'+getCurrentUser().id+\'/account\' : \'/agents/view/\'+getCurrentUser().id+\'/account\'}}">\n            <i class="icon-key"></i>Change password</a>\n          </li>\n          <!-- <li>\n            <a href="#">\n            <i class="icon-calendar"></i> My Calendar </a>\n          </li> -->\n          <!-- <li>\n            <a href="#">\n            <i class="icon-envelope-open"></i> My Inbox <span class="badge badge-danger">\n            3 </span>\n            </a>\n          </li> -->\n          <!-- <li>\n            <a href="#/todo">\n            <i class="icon-rocket"></i> My Tasks <span class="badge badge-success">\n            7 </span>\n            </a>\n          </li> -->\n          <!-- <li class="divider">\n          </li> -->\n          <!-- <li>\n            <a href="#">\n            <i class="icon-lock"></i> Lock Screen </a>\n          </li> -->\n          <li data-ng-click="logout()">\n            <a href="#">\n            <i class="icon-logout"></i> Log Out </a>\n          </li>\n        </ul>\n      </li>\n      <!-- END USER LOGIN DROPDOWN -->\n      <!-- BEGIN QUICK SIDEBAR TOGGLER -->\n      <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->\n      <li class="dropdown dropdown-quick-sidebar-toggler" data-ng-click="toggleQuickSidebar()">\n        <a href="#" class="dropdown-toggle">\n        <i class="icon-logout"></i>\n        </a>\n      </li>\n      <!-- END QUICK SIDEBAR TOGGLER -->\n    </ul>\n  </div>\n  <!-- END TOP NAVIGATION MENU -->\n</div>\n<!-- END HEADER INNER -->\n'),a.put("components/modal/delete.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</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("components/quickSidebar/modal/add.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</button>\n  <h4 ng-if="modal.title" ng-bind="modal.title | translate" class="modal-title"></h4>\n</div>\n\n<div class="modal-body">\n  <div class="portlet box blue">\n		<div class="portlet-title">\n			<div class="caption">\n				<i class="icon-people"></i>{{\'APPLICATION_SELECTED_AGENTS\' | translate}}\n			</div>\n		</div>\n		<div class="portlet-body">\n			<ul>\n				<li data-ng-repeat="item in items">\n					 {{item.fullname}}\n				</li>\n\n        <li data-ng-repeat="item in selected.items">\n					 {{item.fullname}}\n				</li>\n			</ul>\n		</div>\n	</div>\n\n  <ui-select multiple name="items" ng-model="selected.items" theme="bootstrap">\n    <ui-select-match placeholder="{{\'APPLICATION_SELECTED_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n    <ui-select-choices repeat="{id: agent.id, fullname: agent.fullname} as agent in agents.rows | filter: $select.search">\n      {{agent.fullname}}\n    </ui-select-choices>\n  </ui-select>\n</div>\n\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="selected.items.length">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("components/quickSidebar/modal/close.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</button>\n  <h4 ng-if="modal.title" ng-bind="modal.title | translate" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n  <p ng-if="modal.text" ng-bind="modal.text | translate"></p>\n  <!-- <div ng-if="modal.html" ng-bind-html="modal.html"></div> -->\n</div>\n<div class="modal-footer">\n  <button class="btn btn-danger" type="button" ng-click="ok()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\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("components/quickSidebar/quickSidebar.html",'<div class="page-quick-sidebar">\n  <div class="nav-justified">\n    <ul class="nav nav-tabs nav-justified">\n      <li data-ng-class="{active:currentTab==0}" data-ng-click="goToTab(0)">\n        <a href="#">\n          <!-- <i class="icon-people"></i> <span class="badge badge-danger">2</span> -->\n          <i class="icon-people"></i>\n        </a>\n      </li>\n      <li data-ng-class="{active:currentTab==1}" data-ng-click="goToTab(1)">\n        <a href="#">\n          <!-- <i class="icon-eye"></i> <span class="badge badge-success">7</span> -->\n        <i class="icon-eye"></i>\n        </a>\n      </li>\n      <li data-ng-class="{active:currentTab==2}" data-ng-click="goToTab(2)">\n        <a href="#">\n          <!-- <i class="icon-globe"></i> <span class="badge badge-success">7</span> -->\n        <i class="icon-globe"></i>\n        </a>\n      </li>\n      <li data-ng-class="{active:currentTab==3}" data-ng-click="goToTab(3)">\n        <a href="#">\n          <!-- <i class="icon-bubbles"></i> <span class="badge badge-success">7</span> -->\n        <i class="icon-bubbles"></i>\n        </a>\n      </li>\n    </ul>\n    <div class="tab-content">\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==0 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list" >\n          <div class="quicksidebar-search">\n            <div class="input-group">\n							<input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_AGENT\' | translate}}..." ng-model="searchAgent">\n							<span class="input-group-btn">\n							<i class="icon-magnifier"></i>\n							</span>\n						</div>\n          </div>\n          <ul class="media-list list-items" data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="agent in agents.rows | orderBy:\'-online\' | filter:searchAgent as resultsAgent" data-ng-if="agent.id !== currentUser.id">\n              <div class="media-status">\n                <!-- <span class="badge badge-success">8</span> -->\n              </div>\n              <img class="media-object" data-ng-src="api/users/avatar/{{agent.userpic ? agent.userpic : \'unknown_avatar\'}}" alt="{{agent.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(agent.id)">\n                <h4 class="media-heading"><span class="item-status">{{agent.fullname | characters:15 :true}} {{agent.internal}}</h4>\n                <div class="media-heading-small">\n                   <span class="badge badge-empty" data-ng-class="agent.online ? \'badge-success\' : \'badge-danger\'"></span></span> {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{agent.updatedAt}}">April 1, 2014</time>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="agents.rows.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_AGENTS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="resultsAgent.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_AGENTS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==1 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list">\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_USER\' | translate}}..." ng-model="searchUser">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n          <ul class="media-list list-items"  data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="user in users.rows | orderBy:\'-online\' | filter:searchUser as resultsUser" data-ng-if="user.id !== currentUser.id">\n              <div class="media-status">\n                <!-- <span class="badge badge-success">3</span> -->\n              </div>\n              <img class="media-object" data-ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" alt="{{user.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(user.id)">\n                <h4 class="media-heading">{{user.fullname | characters:15 :true}} {{user.internal}}</h4>\n                <div class="media-heading-small">\n                   <span class="badge badge-empty" data-ng-class="user.online ? \'badge-success\' : \'badge-danger\'"></span> {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{user.updatedAt}}">April 1, 2014</time>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="users.rows.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_USERS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="resultsUser.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_USERS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==2 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list">\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_USER\' | translate}}..." ng-model="searchChatRoomsExternals">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n          <ul class="media-list list-items"  data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="chatRoom in chatRooms | filter:{type:\'external\'} | filter:searchChatRoomsExternals as resultsChatRoomsExternals">\n              <div class="media-status">\n                <!-- <span class="badge badge-success">3</span> -->\n              </div>\n              <img class="media-object" data-ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" alt="{{user.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(null, chatRoom.id)">\n                <h4 class="media-heading">{{chatRoom.ChatVisitor.email}}</h4>\n                <div class="media-heading-small">\n                   {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{chatRoom.createdAt}}">April 1, 2014</time>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" data-ng-if="resultsChatRoomsExternals.length === 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_CHATS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==3 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list">\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_USER\' | translate}}..." ng-model="searchChatRoomsGroups">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n          <ul class="media-list list-items"  data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="chatRoom in chatRooms | filter:chatRoomsGroupsGreaterThan(2) | filter:searchChatRoomsGroups as resultsChatRoomsGroups">\n              <div class="media-status">\n                <!-- <span class="badge badge-success">3</span> -->\n              </div>\n              <img class="media-object" data-ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" alt="{{user.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(null, chatRoom.id)">\n                <h4 class="media-heading">{{chatRoom.name}}</h4>\n                <div class="media-heading-small">\n                   {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{chatRoom.updatedAt}}">April 1, 2014</time>\n                </div>\n                <div class="media-heading-small">\n                  <div data-ng-repeat="user in chatRoom.Users | map: \'fullname\'" class="inline">\n                    {{ $last ? user : user + \', \'}}\n                  </div>\n                </div>\n              </div>\n            </li>\n            <!-- <li class="media animate-repeat" ng-if="chatRooms.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_CHAT_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li> -->\n            <li class="media animate-repeat" data-ng-if="resultsChatRoomsGroups.length === 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_CHATS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat page-quick-sidebar-content-item-shown" ng-class="{active:messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list" >\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_MESSAGE\' | translate}}..." ng-model="searchMessage">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n        </div>\n        <div class="page-quick-sidebar-item">\n          <div class="page-quick-sidebar-chat-user" data-wrapper-class="page-quick-sidebar-list">\n            <div class="page-quick-sidebar-nav">\n                <a href="#" class="page-quick-sidebar-back-to-list" data-ng-click="goBack()"><i class="icon-arrow-left"></i>Back</a>\n            </div>\n            <div id="page-quick-sidebar-chat-user-messages" class="page-quick-sidebar-chat-user-messages" data-ng-style="style2" ng-scrollbars>\n              <div class="post animate-repea" data-ng-repeat="chatMessage in chatRoom.ChatMessages | filter:searchMessage as resultsMessage" data-ng-class="chatMessage.UserId === currentUser.id ? \'in\' : \'out\'">\n                <img class="avatar" alt="" ng-src="api/users/avatar/unknown_avatar"/>\n                <div class="message">\n                  <span class="arrow"></span>\n                  <a href="#" class="name">{{chatMessage.User.fullname || chatMessage.ChatVisitor .fullname}}</a> -\n                  <span class="datetime">\n                    <time is="relative-time" datetime="{{chatMessage.createdAt}}">\n                      April 1, 2014\n                    </time>\n                  </span>\n                  <ng-emoticons class="body" emoticons-data="chatMessage.body" emoticons-options="options"/>\n                  <!-- <div class="body" ng-bind-html="chatMessage.body"></div>\n                  <!-- <div ng-bind-html="chatMessage.body | emoticons:{\'linkTarget\':\'_blank\',\'newLine\':true}" class="ng-emoticons"></div> --> -->\n                </div>\n              </div>\n\n              <div class="media-body" style="text-align: center;" data-ng-if="resultsMessage.length == 0">\n                <h5 class="media-heading"><i>{{\'MESSAGE_NO_MESSAGES_FOUND\' | translate | lowercase}}</i></h5>\n              </div>\n\n              <div class="media-body" style="text-align: center;" data-ng-if="chatRoom.status === \'close\'">\n                <h5 class="media-heading"><i>{{\'MESSAGE_CHAT_CLOSED\' | translate | lowercase}}</i></h5>\n              </div>\n\n            </div>\n            <div class="page-quick-sidebar-chat-user-form">\n              <textarea rows="3" class="form-control" style="border:none;resize: none;" placeholder="Type a message here..." ng-enter="sendMessage()" data-ng-model="message.body" data-ng-disabled="chatRoom.status === \'close\'"></textarea>\n              <div class="btn-group" style="width:100%;background-color:white">\n                <button type="button" class="btn btn-default" style="border:none" data-ng-disabled="chatRoom.status === \'close\'" data-ng-click="addAgent(chatRoom.id)"><i class="icon-plus font-blue"></i></button>\n                <button type="button" class="btn btn-default pull-right" style="border:none" data-ng-disabled="chatRoom.status === \'close\'" data-ng-click="closeChatRoom(chatRoom.id)" data-ng-show="chatRoom.type === \'external\'"><i class="icon-close font-red"></i></button>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n'),a.put("components/sidebar/sidebar.html",'<div id="page-sidebar" class="page-sidebar navbar-collapse collapse">\n  <!-- BEGIN SIDEBAR MENU -->\n  <!-- DOC: Apply "page-sidebar-menu-light" class right after "page-sidebar-menu" to enable light sidebar menu style(without borders) -->\n  <!-- DOC: Apply "page-sidebar-menu-hover-submenu" class right after "page-sidebar-menu" to enable hoverable(hover vs accordion) sub menu mode -->\n  <!-- DOC: Apply "page-sidebar-menu-closed" class right after "page-sidebar-menu" to collapse("page-sidebar-closed" class must be applied to the body element) the sidebar sub menu mode -->\n  <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->\n  <!-- DOC: Set data-keep-expand="true" to keep the submenues expanded -->\n  <!-- DOC: Set data-auto-speed="200" to adjust the sub menu slide up/down speed -->\n  <ul data-ng-click="mainTab.active=true" class="page-sidebar-menu" data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" data-ng-class="{\'page-sidebar-menu-closed\': settings.layout.pageSidebarClosed}">\n    <!-- DOC: To remove the search box from the sidebar you just need to completely remove the below "sidebar-search-wrapper" LI element -->\n    <li class="sidebar-search-wrapper">\n      <!-- BEGIN RESPONSIVE QUICK SEARCH FORM -->\n      <!-- DOC: Apply "sidebar-search-bordered" class the below search form to have bordered search box -->\n      <!-- DOC: Apply "sidebar-search-bordered sidebar-search-solid" class the below search form to have bordered & solid search box -->\n      <form class="sidebar-search sidebar-search-bordered" action="extra_search.html" method="POST">\n        <a href="javascript:;" class="remove">\n        <i class="icon-close"></i>\n        </a>\n        <!-- <div class="input-group">\n          <input type="text" class="form-control" placeholder="Search...">\n          <span class="input-group-btn">\n          <a href="javascript:;" class="btn submit"><i class="icon-magnifier"></i></a>\n          </span>\n        </div> -->\n      </form>\n      <!-- END RESPONSIVE QUICK SEARCH FORM -->\n    </li>\n\n    <!-- START DASHBOARD CASE -->\n    <li class="start" data-ng-show="isAssociated(\'dashboard\')" data-ng-class="{active: $state.is(\'main.dashboard\')}">\n      <a href="/dashboard/voice">\n        <i class="icon-rocket"></i>\n        <span class="title">{{\'APPLICATION_DASHBOARD\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.dashboard\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END DASHBOARD CASE -->\n\n    <!-- START YOURDASHBOARD LIST CASE -->\n    <li data-ng-class="{active: $state.is(\'main.yourdashboards.show\')}" data-ng-show="Auth.isAdmin()">\n      <a href="javascript:;">\n        <i class="icon-screen-desktop"></i>\n        <span class="title" >{{\'APPLICATION_YOUR_DASHBOARDS\' | translate}}</span>\n        <span class="arrow" data-ng-class="{ open: $state.includes(\'main.yourdashboards.show\') }"></span>\n      </a>\n      <ul class="sub-menu" data-ng-init="getSidebarDashboards()">\n        <li data-ng-class="{active: $stateParams.id == dashboard.id && $state.includes(\'main.yourdashboards.show\')}" data-ng-repeat="dashboard in dashboards" data-ng-show="dashboard[Auth.getRole()] && dashboard.visible">\n          <a href="/yourdashboards/show/{{dashboard.id}}" >\n          <i class="icon-screen-tablet"></i>\n          <span class="title" >{{dashboard.name}}  </span>\n          </a>\n        </li>\n       </ul>\n    </li>\n    <!-- END YOURDASHBOARD LIST CASE -->\n\n    <!-- START STAFF SEPARATOR -->\n    <li class="heading" data-ng-show="Auth.isAdmin()">\n      <h3 class="uppercase"> <span >{{\'APPLICATION_STAFF\' | translate}}  </span> </h3>\n    </li>\n    <!-- END STAFF SEPARATOR -->\n\n    <!-- START USERS CASE -->\n    <!-- <li data-ng-show="isAssociated(\'users\')" data-ng-class="{active: $state.includes(\'main.users\')}"> -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.users\')}">\n      <a href="/users/list">\n        <i class="icon-eye"></i>\n        <span class="title" >{{\'APPLICATION_USERS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.users\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END USERS CASE -->\n\n    <!-- START AGENTS CASE -->\n    <!-- <li data-ng-show="isAssociated(\'agents\')" data-ng-class="{active: $state.includes(\'main.agents\')}"> -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.agents\')}">\n      <a href="/agents/list">\n        <i class="icon-people"></i>\n        <span class="title" >{{\'APPLICATION_AGENTS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.agents\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END AGENTS CASE -->\n\n    <!-- START TEAMS CASE -->\n    <li data-ng-show="isAssociated(\'teams\')" data-ng-class="{active: $state.includes(\'main.teams\')}">\n      <a href="/teams/list">\n        <i class="icon-shield"></i>\n        <span class="title" >{{\'APPLICATION_TEAMS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.teams\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END TEAMS CASE -->\n    <!-- END STAFF SEPARATOR -->\n\n    <!-- START CONTACT_MANAGER SEPARATOR -->\n    <li class="heading" data-ng-show="Auth.isAdmin()">\n      <h3 class="uppercase"> <span >{{\'APPLICATION_CONTACT_MANAGER\' | translate}}  </span> </h3>\n    </li>\n    <!-- END CONTACT_MANAGER SEPARATOR -->\n\n    <!-- START CONTACT_MANAGER CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.contactmanager\')}">\n      <a href="/contactmanager/list">\n        <i class=" fa fa-users"></i>\n        <span class="title" >{{\'APPLICATION_CONTACT_MANAGER\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.contactmanager\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END CONTACT_MANAGER CASE -->\n    <!-- END CONTACT_MANAGER SEPARATOR -->\n\n    <!-- START CHANNELS SEPARATOR -->\n    <li class="heading">\n      <h3 class="uppercase"> <span >{{\'APPLICATION_CHANNELS\' | translate}}  </span> </h3>\n    </li>\n\n    <!-- START icon-link CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{ active: $state.includes(\'main.voice\') }">\n      <a href="javascript:;">\n        <i class="icon-earphones-alt"></i>\n        <span class="title">{{ \'APPLICATION_VOICE\' | translate}}</span>\n        <span class="arrow" data-ng-class="{ open: $state.includes(\'main.voice\') }"></span>\n      </a>\n\n      <ul class="sub-menu">\n        <li data-ng-class="{active: $state.includes(\'main.voice.queues\')}">\n          <a href="/voice/queues/list">\n          <i class="icon-docs"></i>\n          <span class="title">{{\'APPLICATION_QUEUES\' | translate}}</span>\n          </a>\n        </li>\n        <li>\n          <a href="javascript:;">\n          <i class="icon-directions"></i>\n          <span class="title"> {{ \'APPLICATION_ROUTES\' | translate}} </span>\n          <span class="arrow" data-ng-class="{ open: $state.includes(\'main.voice.routes\') }"></span>\n          <ul class="sub-menu">\n            <li data-ng-class="{active: $state.includes(\'main.voice.routes.inbound\')}">\n              <a href="/voice/routes/inbound/list">\n              <i class="icon-call-in"></i>\n              <span class="title"> {{\'APPLICATION_INBOUND\' | translate}} </span>\n              </a>\n            </li>\n            <li data-ng-class="{active: $state.includes(\'main.voice.routes.outbound\')}">\n              <a href="/voice/routes/outbound/list">\n              <i class="icon-call-out"></i>\n              <span class="title"> {{\'APPLICATION_OUTBOUND\' | translate}} </span>\n              </a>\n            </li>\n            <li data-ng-class="{active: $state.includes(\'main.voice.routes.internal\')}">\n              <a href="/voice/routes/internal/list">\n              <i class="icon-reload"></i>\n              <span class="title"> {{\'APPLICATION_INTERNALS\' | translate}} </span>\n              </a>\n            </li>\n          </ul>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.voice.contexts\')}">\n          <a href="/voice/contexts/list">\n          <i class="icon-docs"></i>\n          <span class="title"> {{\'APPLICATION_CONTEXTS\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.voice.voicemails\')}">\n          <a href="/voice/voicemails/list">\n          <i class="icon-envelope-letter"></i>\n          <span class="title"> {{\'APPLICATION_VOICEMAILS\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.voice.mohs\')}">\n          <a href="/voice/mohs/list">\n          <i class="icon-music-tone"></i>\n          <span class="title"> {{\'APPLICATION_MOH\' | translate}} </span>\n          </a>\n        </li>\n        <!-- START REALTIME CASE -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.voice.realtime\')}">\n          <a href="/voice/realtime/view/agents">\n          <i class="icon-energy"></i>\n          <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n          </a>\n        </li>\n        <!-- END REALTIME CASE -->\n      </ul>\n    </li>\n    <!-- END icon-link CASE -->\n\n    <!-- START CHAT CASE -->\n    <li data-ng-show="isAssociated(\'chat\')" data-ng-class="{ active: $state.includes(\'main.chat\') }">\n      <a href="javascript:;">\n        <i class="icon-bubble"></i>\n        <span class="title">{{\'APPLICATION_CHAT\' | translate}}</span>\n        <span class="arrow" data-ng-class="{ open: $state.includes(\'main.chat\') }"></span>\n      </a>\n      <ul class="sub-menu">\n        <li data-ng-class="{active: $state.includes(\'main.chat.websites\')}">\n          <a href="/chat/websites/list">\n          <i class="icon-globe"></i>\n          <span class="title"> {{\'APPLICATION_WEB_SITES\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.chat.queues\')}">\n          <a href="/chat/queues/list">\n          <i class="icon-docs"></i>\n          <span class="title"> {{\'APPLICATION_QUEUES\' | translate}} </span>\n          </a>\n        </li>\n        <!-- START REALTIME CASE -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.chat.realtime\')}">\n          <a href="/chat/realtime/view/agents">\n          <i class="icon-energy"></i>\n          <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n          </a>\n        </li>\n        <!-- END REALTIME CASE -->\n      </ul>\n    </li>\n    <!-- END CHAT CASE -->\n\n    <!-- START MAIL CASE -->\n    <li data-ng-class="{ active: $state.includes(\'main.mail\') }">\n      <a href="javascript:;">\n        <i class="icon-envelope"></i>\n        <span class="title">{{\'APPLICATION_MAIL\' | translate}}</span>\n        <span class="arrow" data-ng-class="{ open: $state.includes(\'main.mail\') }"></span>\n      </a>\n\n      <ul class="sub-menu">\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.mail.accounts\') || $state.includes(\'main.mail.account\')}">\n          <a href="/mail/accounts/list">\n          <i class="icon-notebook"></i>\n          <span class="title"> {{\'APPLICATION_ACCOUNTS\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.mail.queues\') || $state.includes(\'main.mail.queue\')}">\n          <a href="/mail/queues/list">\n          <i class="icon-docs"></i>\n          <span class="title"> {{\'APPLICATION_QUEUES\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.mail.inbox\')}">\n          <a href="/mail/inbox/incoming">\n          <i class="icon-note"></i>\n          <span class="title"> {{\'APPLICATION_INBOX\' | translate}} </span>\n          </a>\n        </li>\n        <!-- <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.mail.statistics\')}">\n          <a href="/mail/statistics/summary">\n          <i class="icon-eyeglass"></i>\n          <span class="title"> {{\'APPLICATION_STATISTICS\' | translate}} </span>\n          </a>\n        </li> -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.mail.templates\')}">\n          <a href="/mail/templates/list">\n          <i class="icon-docs"></i>\n          <span class="title"> {{\'APPLICATION_TEMPLATES\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.mail.timeline\')}">\n          <a href="/mail/timeline/list">\n          <i class="icon-list"></i>\n          <span class="title"> {{\'APPLICATION_TIMELINE\' | translate}} </span>\n          </a>\n        </li>\n        <!-- START REALTIME CASE -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.mail.realtime\')}">\n          <a href="/mail/realtime/view/agents">\n          <i class="icon-energy"></i>\n          <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n          </a>\n        </li>\n        <!-- END REALTIME CASE -->\n      </ul>\n    </li>\n    <!-- END MAIL CASE -->\n\n    <!-- START FAX CASE -->\n    <li data-ng-class="{active: $state.includes(\'main.fax\')}">\n    <!-- <li data-ng-show="license.fax" data-ng-class="{active: $state.includes(\'main.fax\')}"> -->\n      <a href="javascript:;">\n        <i class="icon-paper-plane"></i>\n        <span class="title"> {{ \'APPLICATION_FAX\' | translate}}</span>\n        <span class="arrow" data-ng-class="{ open: $state.includes(\'main.fax\') }"></span>\n      </a>\n\n      <ul class="sub-menu">\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.fax.accounts\')}">\n          <a href="/fax/accounts/list">\n          <i class="icon-notebook"></i>\n          <span class="title"> {{ \'APPLICATION_ACCOUNTS\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.fax.queues\')}">\n          <a href="/fax/queues/list">\n          <i class="icon-docs"></i>\n          <span class="title"> {{ \'APPLICATION_QUEUES\' | translate }} </span>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.fax.inbox\')}">\n          <a href="/fax/inbox/incoming">\n          <i class="icon-note"></i>\n          <span class="title"> {{ \'APPLICATION_INBOX\' | translate }} </span>\n          </a>\n        </li>\n        <!-- <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.fax.statistics\')}">\n          <a href="/fax/statistics/summary">\n          <i class="icon-eyeglass"></i>\n          <span class="title"> {{ \'APPLICATION_STATISTICS\' | translate }} </span>\n          </a>\n        </li> -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.fax.automations\')}">\n          <a href="/fax/automations/list">\n          <i class="icon-settings"></i>\n          <span class="title"> {{\'APPLICATION_AUTOMATIONS\' | translate}} </span>\n          </a>\n        </li>\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.fax.timeline\')}">\n          <a href="/fax/timeline/list">\n          <i class="icon-list"></i>\n          <span class="title"> {{\'APPLICATION_TIMELINE\' | translate}} </span>\n          </a>\n        </li>\n      </ul>\n    </li>\n    <!-- END FAX CASE -->\n    <!-- END CHANNELS SEPARATOR -->\n\n    <!-- START INTEGRATIONS SEPARATOR -->\n    <li data-ng-show="Auth.isAdmin()" class="heading">\n      <h3 class="uppercase"> <span translate> APPLICATION_INTEGRATIONS </span> </h3>\n    </li>\n    <!-- START INTEGRATION CASE -->\n    <!--\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.is(\'main.market\')}">\n      <a href="/market">\n        <i class="icon-handbag"></i>\n        <span class="title" translate>Market Place</span>\n        <span data-ng-show="$state.includes(\'main.market\')" class="selected"></span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.is(\'main.integrations.list\')}">\n      <a href="/integrations/list">\n        <i class="icon-game-controller"></i>\n        <span class="title" translate>Test Your App</span>\n        <span data-ng-show="$state.includes(\'main.integrations.list\')" class="selected"></span>\n      </a>\n    </li>\n    -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.zendesk\')}">\n      <a href="/zendesk/list">\n        <i class="icon-handbag"></i>\n        <span class="title" >{{\'APPLICATION_ZENDESK\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.zendesk\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END INTEGRATIONS SEPARATOR -->\n\n    <!-- START TOOLS SEPARATOR -->\n    <li data-ng-show="Auth.isAdmin()" class="heading">\n      <h3 class="uppercase"> <span >{{\'APPLICATION_TOOLS\' | translate}}  </span> </h3>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.triggers\')}">\n      <a href="/triggers/list">\n      <i class="icon-bulb"></i>\n      <span class="title"> {{\'APPLICATION_TRIGGERS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.automations\')}">\n      <a href="/automations/list">\n      <i class="icon-settings"></i>\n      <span class="title"> {{\'APPLICATION_AUTOMATIONS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.trunks\')}">\n      <a href="/trunks/list">\n      <i class="icon-link"></i>\n      <span class="title"> {{\'APPLICATION_TRUNKS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.intervals\')}">\n      <a href="/intervals/list">\n      <i class="icon-clock"></i>\n      <span class="title"> {{\'APPLICATION_INTERVALS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.variables\')}">\n      <a href="/variables/list">\n      <i class="fa fa-eye"></i>\n      <span class="title" >{{\'APPLICATION_VARIABLES\' | translate}}  </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tags\')}">\n      <a href="/tags/list">\n      <i class="icon-tag"></i>\n      <span class="title" >{{\'APPLICATION_TAGS\' | translate}}  </span>\n      </a>\n    </li>\n    <!-- START CALLYSQUARE CASE -->\n    <!-- <li data-ng-show="isAssociated(\'callysquare\')" data-ng-class="{active: $state.includes(\'main.square\')}"> -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.square\')}">\n      <a href="javascript:;">\n        <i class="fa fa-superscript"></i>\n        <span class="title" >{{\'APPLICATION_CALLYSQUARE\' | translate}}</span>\n        <span class="arrow"></span>\n      </a>\n      <ul class="sub-menu">\n        <li data-ng-class="{active: $state.includes(\'main.square.projects\')}">\n          <a href="/square/projects/list">\n          <i class="fa fa-slack"></i>\n          <span class="title" >{{\'APPLICATION_PROJECTS\' | translate}}  </span>\n          </a>\n        </li>\n        <li data-ng-class="{active: $state.includes(\'main.square.odbc\')}">\n          <a href="/square/odbcs/list">\n          <i class="fa fa-database"></i>\n          <span class="title" >{{\'APPLICATION_ODBC\' | translate}}  </span>\n          </a>\n        </li>\n       </ul>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.yourdashboards.list\') || $state.includes(\'main.yourdashboards.settings\')}">\n      <a href="/yourdashboards/list">\n      <i class="icon-grid"></i>\n      <span class="title"> {{\'APPLICATION_DASHBOARDS_MANAGER\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END CALLYSQUARE CASE -->\n\n    <!-- START AUTODIALER CASE -->\n    <!-- <li data-ng-show="Auth.isAdmin()">\n      <a href="javascript:;">\n        <i class="icon-call-out"></i>\n        <span class="title">AutoDialer</span>\n        <span class="arrow"></span>\n      </a>\n      <ul class="sub-menu">\n      </ul>\n    </li> -->\n    <!-- END AUTODIALER CASE -->\n\n    <!-- START ANALYTICS CASE -->\n    <!-- <li data-ng-show="isAssociated(\'analytics\')"> -->\n    <!-- <li data-ng-show="Auth.isAdmin()">\n      <a href="#/analytics">\n        <i class="icon-graph"></i>\n        <span class="title" >{{\'APPLICATION_ANALYTICS\' | translate}}</span>\n      </a>\n    </li> -->\n    <!-- END ANALYTICS CASE -->\n\n    <!-- END TOOLS SEPARATOR -->\n\n    <!-- START AUDIO SEPARATOR -->\n    <li data-ng-show="Auth.isAdmin()" class="heading">\n      <h3 class="uppercase"> <span >{{\'APPLICATION_AUDIO\' | translate}}  </span> </h3>\n    </li>\n    <!-- END AUDIO SEPARATOR -->\n\n    <!-- START AUDIO CASE -->\n    <!-- <li data-ng-show="isAssociated(\'audio\')" data-ng-class="{active: $state.is(\'main.sound\')}"> -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.sounds\')}">\n      <a href="/sounds/list">\n        <i class="icon-music-tone-alt"></i>\n        <span class="title" >{{\'APPLICATION_SOUNDS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.sounds\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END AUDIO CASE -->\n\n\n    <!-- START SETTINGS SEPARATOR -->\n    <li data-ng-show="Auth.isAdmin()" class="heading">\n      <h3 class="uppercase"> <span >{{\'APPLICATION_SETTINGS\' | translate}}  </span> </h3>\n    </li>\n    <!-- END SETTINGS SEPARATOR -->\n\n    <!-- START UPDATES CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.updates\')}">\n      <a href="/updates/list">\n        <i class="icon-cloud-download"></i>\n        <span class="title" >{{\'APPLICATION_UPDATES\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.updates\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END UPDATES CASE -->\n\n  </ul>\n  <!-- END SIDEBAR MENU -->\n</div>\n');
 }]);
\ No newline at end of file
diff --git a/public/assets/languages/locale-en_EN.json b/public/assets/languages/locale-en_EN.json
index 1dbd1ba..1fd8197 100644
--- a/public/assets/languages/locale-en_EN.json
+++ b/public/assets/languages/locale-en_EN.json
@@ -9,7 +9,10 @@
   "APPLICATION_NEW_CONTACT": "New Contact",
   "MESSAGE_NO_CONTACTS_AVAILABLE": "No contacts available",
   "APPLICATION_USER": "User",
+  "MESSAGE_NO_AVAILABLE_UPDATES": "No available updates",
   "APPLICATION_ALWAYS": "Always",
+  "APPLICATION_ALREADY_UP_TO_DATE": "Already up to date",
+  "APPLICATION_UPDATED_TO_LATEST_VERSION": "Updated to the latest version",
   "APPLICATION_SURNAME": "Surname",
   "APPLICATION_AGENT": "Agent",
   "APPLICATION_CONFIRM_CLOSE": "Confirm Close",
@@ -653,6 +656,7 @@
   "MESSAGE_SAVE_AS_DRAFT": "Message saved as draft",
   "MESSAGE_WELL_DONE": "Well done",
   "MESSAGE_SUCCESS": "Success",
+  "MESSAGE_INFO": "Info",
   "MESSAGE_ERROR": "Error",
   "MESSAGE_SOMETHING_WENT_WRONG": "Something went wrong",
   "MESSAGE_ARE_YOU_SURE_YOU_WANT_TO_CLOSE_THE_CHAT": "Are you sure you want to close the chat?",
@@ -724,7 +728,7 @@
   "APPLICATION_EXTERNAL": "External",
   "APPLICATION_AT": "At",
   "APPLICATION_GO_TO": "Go to",
-  "APPLICATION_MESSAGE": "Go to",
+  "APPLICATION_MESSAGE": "Message",
   "APPLICATION_EMBED_SNIPPET": "Embed the Snippet",
   "MESSAGE_EMBED_SNIPPET": "Copy the following script and insert it into your website's HTML source code at the end of <body> tag. This code must be inserted into every page on which you wish to display the xCally Chat Snippet.",
   "MESSAGE_NO_AVAILABLE_APPLICATIONS": "No available applications",
diff --git a/public/assets/languages/locale-it.json b/public/assets/languages/locale-it.json
index 9e57279..fe6cd0b 100644
--- a/public/assets/languages/locale-it.json
+++ b/public/assets/languages/locale-it.json
@@ -8,11 +8,15 @@
   "APPLICATION_CHECKOUT": "Checkout",
   "APPLICATION_CONTACTS": "Contatti",
   "APPLICATION_NEW_CONTACT": "Nuovo Contatto",
+  "MESSAGE_NO_AVAILABLE_UPDATES": "Non ci sono aggiornamenti disponibili",
   "MESSAGE_NO_CONTACTS_AVAILABLE": "Nessun contatto disponibile",
+  "APPLICATION_ALREADY_UP_TO_DATE": "GiÃ  aggiornato",
+  "APPLICATION_UPDATED_TO_LATEST_VERSION": "Aggiornato all'ultima versione",
   "APPLICATION_ADD_FIELD": "Aggiungi campo",
   "APPLICATION_TAGS": "Tags",
   "APPLICATION_TAG": "Tag",
   "APPLICATION_NEW_TAG": "Nuovo Tag",
+  "MESSAGE_INFO": "Info",
   "MESSAGE_NO_TAGS_AVAILABLE": "Nessun Tag disponibile",
   "APPLICATION_AGENT": "Agente",
   "APPLICATION_SURNAME": "Cognome",
diff --git a/public/index.html b/public/index.html
index 507facd..87916f2 100644
--- a/public/index.html
+++ b/public/index.html
@@ -61,7 +61,7 @@
     <![endif]-->
     <script src="app/0e6d6720.vendor.js"></script>
 
-    <script src="app/f18fc4d6.app.js"></script>
+    <script src="app/c7c298e3.app.js"></script>
 
     <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
     <!-- BEGIN CORE PLUGINS -->
diff --git a/release-notes/changelog_0.0.3.txt b/release-notes/changelog_0.0.4.txt
similarity index 86%
rename from release-notes/changelog_0.0.3.txt
rename to release-notes/changelog_0.0.4.txt
index 6875e0b..7e5d690 100644
--- a/release-notes/changelog_0.0.3.txt
+++ b/release-notes/changelog_0.0.4.txt
@@ -1,5 +1,17 @@
 # xCALLY MOTION Changelog
 
+- * 872c986 - 2015-12-07: test commit 
+- * edef880 - 2015-12-07: new version 
+- * ae382fb - 2015-12-07: server side API 
+- * a25e4cb - 2015-12-07: client assets languages 
+- * d2c94d8 - 2015-12-07: client side update 
+- * 55740b7 - 2015-12-07: client side components 
+- * 3013717 - 2015-12-07: client side app update 
+- * aad6613 - 2015-12-07: server side API 
+- * ee52b95 - 2015-12-07: server side API 
+- * 45cf94d - 2015-12-07: client assets languages 
+- * 90fd223 - 2015-12-07: server side API 
+- * fa6644f - 2015-12-07: client side app main + update 
 - * 423e8e4 - 2015-12-07: modify variable app.json 
 - * aaf1b4c - 2015-12-07: server side api update 
 - * 89b5e99 - 2015-12-07: Title HTML Motion 
@@ -63,6 +75,4 @@
 - * dfa6a84 - 2015-12-01: client side languages components 
 - * 787afbe - 2015-12-01: client side header component 
 - * 8f08964 - 2015-12-01: client side app 
-- * d9684f3 - 2015-11-30: check on variable remove (used in zendesk configurations) 
-- * 4a8d16c - 2015-11-30: Zendesk subject configuration (server + client) 
 
diff --git a/server/api/setting/index.js b/server/api/setting/index.js
index 3040809..d39a451 100644
--- a/server/api/setting/index.js
+++ b/server/api/setting/index.js
@@ -8,6 +8,7 @@ var router = express.Router();
 
 router.get('/', auth.isAuthenticated(), controller.index);
 router.get('/internal', auth.isAuthenticated(), controller.getInternal);
+router.get('/info', controller.getInfo);
 router.get('/:id', auth.isAuthenticated(), controller.show);
 router.post('/', auth.isAuthenticated(), controller.create);
 router.put('/:id', auth.isAuthenticated(), controller.update);
diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js
index 1d966c1..4cbb858 100644
--- a/server/api/setting/setting.controller.js
+++ b/server/api/setting/setting.controller.js
@@ -54,6 +54,18 @@ exports.getInternal = function(req, res) {
     });
 };
 
+// Get list of settings
+exports.getInfo = function(req, res) {
+
+  var info = require('../../../package.json');
+
+  return res.status(200).send({
+    name: info.name,
+    version: info.version,
+    engines: info.engines
+  });
+};
+
 // Get a single setting
 exports.show = function(req, res) {
   Settings
diff --git a/server/api/update/index.js b/server/api/update/index.js
index 4c87e43..fd2e01b 100644
--- a/server/api/update/index.js
+++ b/server/api/update/index.js
@@ -6,10 +6,12 @@ var controller = require('./update.controller');
 var router = express.Router();
 
 router.get('/', controller.index);
+router.get('/pull', controller.pull);
+router.get('/checkout/:hash', controller.checkout);
 router.get('/:id', controller.show);
 router.post('/', controller.create);
 router.put('/:id', controller.update);
 router.patch('/:id', controller.update);
 router.delete('/:id', controller.destroy);
 
-module.exports = router;
\ No newline at end of file
+module.exports = router;
diff --git a/server/api/update/update.controller.js b/server/api/update/update.controller.js
index 2827f02..65546fc 100644
--- a/server/api/update/update.controller.js
+++ b/server/api/update/update.controller.js
@@ -23,30 +23,45 @@ exports.index = function(req, res) {
             return handleError(res, err);
           }
 
-          logs.all = _.take(logs.all, 10);
+          logs.all = _.take(logs.all, 50);
           console.log("Latest available tag: %s", logs.latest);
           return res.status(200).send(logs);
         });
     });
-
 };
 
 // Get a single update
 exports.show = function(req, res) {
 
+};
+
+// Get a single update
+exports.pull = function(req, res) {
   Git
-    .pull(function(err, update) {
+    .reset('soft', function(err, update) {
       console.log('update', update);
-      console.error('err', err);
-
       if (err) {
         return handleError(res, err);
       }
+      return res.status(201).send(update);
+    });
+  // Git
+  //   .pull(function(err, update) {
+  //     if (err) {
+  //       return handleError(res, err);
+  //     }
+  //     return res.status(201).send(update);
+  //   });
+};
 
-      if (update && update.summary.changes) {
-        return res.status(201).send(update);
+// Get a single update
+exports.checkout = function(req, res) {
+  console.log('req.params.hash', req.params.hash);
+  Git
+    .checkout(req.params.hash, function(err, update) {
+      if (err) {
+        return handleError(res, err);
       }
-
       return res.status(201).send(update);
     });
 };
diff --git a/server/app.js b/server/app.js
index 882c5e9..22a48cb 100644
--- a/server/app.js
+++ b/server/app.js
@@ -9,8 +9,6 @@ process.env.NODE_ENV = process.env.NODE_ENV || 'development';
 process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0;
 
 process.on('uncaughtException', function(err) {
-  // console.log('Caught exception: ' + err);
-
   if (typeof err === 'object') {
     if (err.message) {
       console.log('\nMessage: ' + err.message)
@@ -23,7 +21,6 @@ process.on('uncaughtException', function(err) {
   } else {
     console.log('dumpError :: argument is not an object');
   }
-
 });